获取证书名称支持中文

Signed-off-by: 王静 <wangjing561@huawei.com>
This commit is contained in:
王静 2024-05-13 20:09:51 +08:00
parent 10fbd4eb78
commit 64df5bf4a8

View File

@ -1030,6 +1030,27 @@ declare namespace cert {
encodingFormat: EncodingFormat;
}
/**
* Enum for Encoding type.
*
* @enum { number }
* @syscap SystemCapability.Security.Cert
* @crossplatform
* @atomicservice
* @since 12
*/
enum EncodingType {
/**
* Indicates to utf8 type.
*
* @syscap SystemCapability.Security.Cert
* @crossplatform
* @atomicservice
* @since 12
*/
ENCODING_UTF8 = 0
}
/**
* Provides the x509 cert type.
*
@ -1414,7 +1435,11 @@ declare namespace cert {
/**
* Get X509 cert subject name.
*
* @param { EncodingType } [encodingType] indicates the encoding type, if the encoding type parameter is not set,
* the default ASCII encoding is used.
* @returns { DataBlob } X509 cert subject name.
* @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Incorrect parameter types;
* <br>2. Parameter verification failed.
* @throws { BusinessError } 19020001 - memory error.
* @throws { BusinessError } 19020002 - runtime error.
* @throws { BusinessError } 19030001 - crypto operation error.
@ -1423,7 +1448,7 @@ declare namespace cert {
* @atomicservice
* @since 12
*/
getSubjectName(): DataBlob;
getSubjectName(encodingType?: EncodingType): DataBlob;
/**
* Get X509 cert not before time.
@ -4668,7 +4693,7 @@ declare namespace cert {
* create object CertCRLCollection
*
* @param { Array<X509Cert> } certs - array of X509Cert.
* @param { Array<X509CRL> } [options] crls - array of X509CRL.
* @param { Array<X509CRL> } [crls] - array of X509CRL.
* @returns { CertCRLCollection }
* @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Mandatory parameters are left unspecified;
* <br>2. Incorrect parameter types; 3. Parameter verification failed.