You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
458 B
28 lines
458 B
|
|
const {encrypt, decrypt,getSign, getKey, sm2} = require('./static/sm4'); |
|
|
|
|
|
class Sm4Service { |
|
sm4Encrypt(data, key) { |
|
return encrypt(data, key); |
|
} |
|
|
|
sm4Decrypt(data, key) { |
|
return decrypt(data, key); |
|
} |
|
|
|
getKey() { |
|
return getKey(); |
|
} |
|
|
|
getSign(data, key) { |
|
return getSign(data, key) |
|
} |
|
|
|
getSm2(key, publicKey,mode){ |
|
return sm2(key, publicKey,mode) |
|
} |
|
} |
|
|
|
|
|
module.exports = Sm4Service |