The **certificate** module provides APIs for performing certificate operations. For details about the APIs for implementing the basic algorithm capabilities based on the cryptographic (crypto) framework, see [Crypto Framework](js-apis-cryptoFramework.md).
The certificate algorithm library framework provides certificate-related APIs. For details about the APIs for implementing the basic algorithm capabilities based on the cryptographic (crypto) framework, see [Crypto Framework](js-apis-cryptoFramework.md).
| number | If the key purpose in the certificate extension contains signing and the CA field in the basic constraints is **true**, the certificate is a CA certificate.<br/>Returns **-1** if the certificate is not a CA certificate; returns the path length in the basic constraints otherwise. <br/>Returns **-2** if the certificate is a CA certificate but the path length is not specified in the basic constraints, which means the path length is not limited. |
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
```js
importcryptoCertfrom'@ohos.security.cert';
// Binary data of the certificate extension, which needs to be assigned by the service.
letencodingData=null;
letencodingBlob={
data:encodingData,
// Assign a value based on the encodingData format. Currently, only FORMAT_DER is supported.
| callback | AsyncCallback\<[X509Crl](#x509crl)> | Yes | Callback invoked to return the result. Promise used to return the **X509Crl** instance created.|
**Error codes**
| ID| Error Message |
| -------- | ------------- |
| 19020001 | Memory error. |
| 19020001 | memory error. |
**Example**
...
...
@@ -1173,15 +1540,15 @@ Creates an **X509Crl** instance. This API uses a promise to return the result.
**Return value**
| Type | Description |
| ----------------- | -------------------- |
| Promise\<X509Crl> | Promise used to return the **X509Crl** instance created.|
| callback | AsyncCallback<Array\<X509CrlEntry>> | Yes | Callback invoked to return the result. Promise used to return a list of revoked X.509 certificates.|
| callback | AsyncCallback<Array\<[X509CrlEntry](#x509crlentry)>> | Yes | Callback invoked to return the result. Promise used to return a list of revoked X.509 certificates.|
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19030001 | crypto operation error. |
**Example**
...
...
@@ -1828,16 +2195,16 @@ Obtains all the revoked X.509 certificates. This API uses a promise to return th