From 5ac288620baa01fcf6740cc686109938c8e5e43d Mon Sep 17 00:00:00 2001 From: lanming Date: Wed, 19 Feb 2025 20:01:26 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E7=AE=97=E6=B3=95=E5=BA=93?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=BE=93=E5=87=BAutf8=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E7=9A=84=E4=B8=BB=E4=BD=93=E5=92=8C=E9=A2=81=E5=8F=91=E8=80=85?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lanming --- api/@ohos.security.cert.d.ts | 109 ++++++++++++++++++++++++++++++++++- 1 file changed, 106 insertions(+), 3 deletions(-) diff --git a/api/@ohos.security.cert.d.ts b/api/@ohos.security.cert.d.ts index 46327cf13..53b0a4126 100644 --- a/api/@ohos.security.cert.d.ts +++ b/api/@ohos.security.cert.d.ts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022-2024 Huawei Device Co., Ltd. + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -17,7 +17,7 @@ * @file * @kit DeviceCertificateKit */ -import type { AsyncCallback } from './@ohos.base'; +import type { AsyncCallback, BusinessError } from './@ohos.base'; import cryptoFramework from './@ohos.security.cryptoFramework'; /** @@ -1421,6 +1421,23 @@ declare namespace cert { */ getIssuerName(): DataBlob; + /** + * Get X509 cert issuer name according to the encoding type. + * + * @param { EncodingType } encodingType indicates the encoding type. + * @returns { string } X509 cert issuer name. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Incorrect parameter types; + *
2. Parameter verification failed. + * @throws { BusinessError } 19020001 - memory error. + * @throws { BusinessError } 19020002 - runtime error. + * @throws { BusinessError } 19030001 - crypto operation error. + * @syscap SystemCapability.Security.Cert + * @crossplatform + * @atomicservice + * @since 20 + */ + getIssuerName(encodingType: EncodingType): string; + /** * Get X509 cert subject name. * @@ -1965,6 +1982,23 @@ declare namespace cert { */ toString(): string; + /** + * Get the string type data of the object according to the encoding type. + * + * @param { EncodingType } encodingType indicates the encoding type. + * @returns { string } the string type data of the object. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Incorrect parameter types; + *
2. Parameter verification failed. + * @throws { BusinessError } 19020001 - memory error. + * @throws { BusinessError } 19020002 - runtime error. + * @throws { BusinessError } 19030001 - crypto operation error. + * @syscap SystemCapability.Security.Cert + * @crossplatform + * @atomicservice + * @since 20 + */ + toString(encodingType: EncodingType): string; + /** * Get the hash value of DER format data. * @@ -2598,6 +2632,24 @@ declare namespace cert { */ getCertIssuer(): DataBlob; + /** + * Get the issuer name of the x509 certificate described by this entry according to the encoding type. + * + * @param { EncodingType } encodingType indicates the encoding type. + * @returns { string } issuer name. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Incorrect parameter types; + *
2. Parameter verification failed. + * @throws { BusinessError } 801 - this operation is not supported. + * @throws { BusinessError } 19020001 - memory error. + * @throws { BusinessError } 19020002 - runtime error. + * @throws { BusinessError } 19030001 - crypto operation error. + * @syscap SystemCapability.Security.Cert + * @crossplatform + * @atomicservice + * @since 20 + */ + getCertIssuer(encodingType: EncodingType): string; + /** * Get the revocation date from x509CRL entry. * @@ -3266,6 +3318,23 @@ declare namespace cert { */ getIssuerName(): DataBlob; + /** + * Get the issuer name from CRL according to the encoding type. + * + * @param { EncodingType } encodingType indicates the encoding type. + * @returns { string } issuer name of CRL. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Incorrect parameter types; + *
2. Parameter verification failed. + * @throws { BusinessError } 19020001 - memory error. + * @throws { BusinessError } 19020002 - runtime error. + * @throws { BusinessError } 19030001 - crypto operation error. + * @syscap SystemCapability.Security.Cert + * @crossplatform + * @atomicservice + * @since 20 + */ + getIssuerName(encodingType: EncodingType): string; + /** * Get lastUpdate value from CRL. * @@ -3637,6 +3706,23 @@ declare namespace cert { */ toString(): string; + /** + * Get the string type data of the object according to the encoding type. + * + * @param { EncodingType } encodingType indicates the encoding type. + * @returns { string } the string type data of the object. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Incorrect parameter types; + *
2. Parameter verification failed. + * @throws { BusinessError } 19020001 - memory error. + * @throws { BusinessError } 19020002 - runtime error. + * @throws { BusinessError } 19030001 - crypto operation error. + * @syscap SystemCapability.Security.Cert + * @crossplatform + * @atomicservice + * @since 20 + */ + toString(encodingType: EncodingType): string; + /** * Get the hash value of DER format data. * @@ -5234,7 +5320,7 @@ declare namespace cert { */ interface X500DistinguishedName { /** - * Get distinguished name string. + * Get distinguished name string in ASCII encoding type. * * @returns { string } distinguished name string. * @throws { BusinessError } 19020001 - memory error. @@ -5247,6 +5333,23 @@ declare namespace cert { */ getName(): string; + /** + * Get distinguished name string according to the encoding type. + * + * @param { EncodingType } encodingType - the specified encoding type. + * @returns { string } distinguished name string. + * @throws { BusinessError } 401 - invalid parameters. Possible causes: 1. Incorrect parameter types; + *
2. Parameter verification failed. + * @throws { BusinessError } 19020001 - memory error. + * @throws { BusinessError } 19020002 - runtime error. + * @throws { BusinessError } 19030001 - crypto operation error. + * @syscap SystemCapability.Security.Cert + * @crossplatform + * @atomicservice + * @since 20 + */ + getName(encodingType: EncodingType): string; + /** * Get distinguished name string by type. * -- Gitee