mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-07 14:13:45 +00:00
【算法库适配层】封装OpenSSL相关接口,向上提供PKCS1与PCSK8格式互转的能力
Signed-off-by: 王静 <wangjing561@huawei.com>
This commit is contained in:
parent
e059267be2
commit
84f1e46cb9
62
api/@ohos.security.cryptoFramework.d.ts
vendored
62
api/@ohos.security.cryptoFramework.d.ts
vendored
@ -838,6 +838,21 @@ declare namespace cryptoFramework {
|
||||
* @since 12
|
||||
*/
|
||||
getEncodedDer(format: string): DataBlob;
|
||||
|
||||
/**
|
||||
* Encode the private key object to string in PEM format.
|
||||
*
|
||||
* @param { string } format - indicates the encoding format.
|
||||
* @returns { string } the string of the key object in PEM format.
|
||||
* @throws { BusinessError } 401 - invalid parameters.
|
||||
* @throws { BusinessError } 17620001 - memory error.
|
||||
* @throws { BusinessError } 17630001 - crypto operation error.
|
||||
* @syscap SystemCapability.Security.CryptoFramework
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
getEncodedPem(format: string): string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -917,6 +932,21 @@ declare namespace cryptoFramework {
|
||||
* @since 12
|
||||
*/
|
||||
getEncodedDer(format: string): DataBlob;
|
||||
|
||||
/**
|
||||
* Encode the public key object to string in PEM format.
|
||||
*
|
||||
* @param { string } format - indicates the encoding format.
|
||||
* @returns { string } the string of the key object in PEM format.
|
||||
* @throws { BusinessError } 401 - invalid parameters.
|
||||
* @throws { BusinessError } 17620001 - memory error.
|
||||
* @throws { BusinessError } 17630001 - crypto operation error.
|
||||
* @syscap SystemCapability.Security.CryptoFramework
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
getEncodedPem(format: string): string;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1448,6 +1478,38 @@ declare namespace cryptoFramework {
|
||||
*/
|
||||
convertKeySync(pubKey: DataBlob | null, priKey: DataBlob | null): KeyPair;
|
||||
|
||||
/**
|
||||
* Used to convert asymmetric key in PEM format to keypair object.
|
||||
*
|
||||
* @param { string | null } pubKey - the public key string in PEM format.
|
||||
* @param { string | null } priKey - the private key string in PEM format.
|
||||
* @returns { Promise<KeyPair> } return keypair.
|
||||
* @throws { BusinessError } 401 - invalid parameters.
|
||||
* @throws { BusinessError } 17620001 - memory error.
|
||||
* @throws { BusinessError } 17630001 - crypto operation error.
|
||||
* @syscap SystemCapability.Security.CryptoFramework
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
convertPemKey(pubKey: string | null, priKey: string | null): Promise<KeyPair>;
|
||||
|
||||
/**
|
||||
* Used to convert asymmetric key in PEM format to keypair object.
|
||||
*
|
||||
* @param { string | null } pubKey - the public key string in PEM format.
|
||||
* @param { string | null } priKey - the private key string in PEM format.
|
||||
* @returns { KeyPair } return keypair.
|
||||
* @throws { BusinessError } 401 - invalid parameters.
|
||||
* @throws { BusinessError } 17620001 - memory error.
|
||||
* @throws { BusinessError } 17630001 - crypto operation error.
|
||||
* @syscap SystemCapability.Security.CryptoFramework
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
convertPemKeySync(pubKey: string | null, priKey: string | null): KeyPair;
|
||||
|
||||
/**
|
||||
* The algName of the AsyKeyGenerator.
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user