!10802 【算法库适配层】封装OpenSSL相关接口,向上提供PKCS1与PCSK8格式互转的能力

Merge pull request !10802 from 王静/master
This commit is contained in:
openharmony_ci 2024-04-30 08:36:40 +00:00 committed by Gitee
commit b7a1c93f89
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -850,6 +850,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;
}
/**
@ -941,6 +956,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;
}
/**
@ -1529,6 +1559,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.
*