sm2 加密解密通过
This commit is contained in:
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
declare module 'sm-crypto' {
|
||||
export interface SM2KeyPair {
|
||||
privateKey: string;
|
||||
publicKey: string;
|
||||
}
|
||||
|
||||
export const sm2: {
|
||||
generateKeyPairHex: (privateKey?: string) => SM2KeyPair;
|
||||
doEncrypt: (message: string, publicKey: string) => string;
|
||||
doDecrypt: (ciphertext: string, privateKey: string) => string;
|
||||
doSign: (message: string, privateKey: string) => string;
|
||||
doVerify: (message: string, signature: string, publicKey: string) => boolean;
|
||||
};
|
||||
|
||||
export const sm3: {
|
||||
digest: (message: string) => string;
|
||||
};
|
||||
|
||||
export const sm4: {
|
||||
encrypt: (message: string, key: string, options?: any) => string;
|
||||
decrypt: (ciphertext: string, key: string, options?: any) => string;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user