提交 ac5cc2ff 编写于 作者: A Annie_wang

update docs

Signed-off-by: NAnnie_wang <annie.wangli@huawei.com>
上级 8542a39c
# @ohos.security.cert (Certificate)
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).
> **NOTE**
>
......@@ -59,6 +59,43 @@ Defines a list of data arrays.
| FORMAT_DER | 0 | Distinguished Encoding Rules (DER) format.|
| FORMAT_PEM | 1 | Privacy-Enhanced Mail (PEM) format.|
## CertItemType<sup>10+</sup>
Enumerates the certificate fields that can be obtained.
**System capability**: SystemCapability.Security.Cert
| Name | Value | Description |
| -------------------------------- | ---- | ------------------------------ |
| CERT_ITEM_TYPE_TBS | 0 | Information to be signed. |
| CERT_ITEM_TYPE_PUBLIC_KEY | 1 | Public key of the certificate. |
| CERT_ITEM_TYPE_ISSUER_UNIQUE_ID | 2 | Unique ID of the certificate issuer.|
| CERT_ITEM_TYPE_SUBJECT_UNIQUE_ID | 3 | Unique ID of the certificate subject. |
| CERT_ITEM_TYPE_EXTENSIONS | 4 | Certificate extensions, each of which is identified by a unique object identifier (OID). |
## ExtensionOidType<sup>10+</sup>
Enumerates the OID types of the certificate extensions that can be obtained.
**System capability**: SystemCapability.Security.Cert
| Name | Value | Description |
| ----------------------------- | ---- | --------------------------------------------- |
| EXTENSION_OID_TYPE_ALL | 0 | All object identifiers. |
| EXTENSION_OID_TYPE_CRITICAL | 1 | Object identifier whose **critical** is **true**. |
| EXTENSION_OID_TYPE_UNCRITICAL | 2 | Object identifier whose **critical** is **false**.|
## ExtensionEntryType<sup>10+</sup>
Enumerates the object types in certificate extensions that can be obtained.
**System capability**: SystemCapability.Security.Cert
| Name | Value | Description |
| ----------------------------------- | ---- | ---------------------------- |
| EXTENSION_ENTRY_TYPE_ENTRY | 0 | Entire object. |
| EXTENSION_ENTRY_TYPE_ENTRY_CRITICAL | 1 | Critical attribute of the object.|
| EXTENSION_ENTRY_TYPE_ENTRY_VALUE | 2 | Data of the object. |
## EncodingBlob
......@@ -99,16 +136,16 @@ Creates an **X509Cert** instance. This API uses an asynchronous callback to retu
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | -------------------------- |
| inStream | [EncodingBlob](#encodingblob) | Yes | X.509 certificate serialization data. |
| callback | AsyncCallback\<X509Cert> | Yes | Callback invoked to return the result. **X509Cert** instance created.|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------- | ---- | -------------------------- |
| inStream | [EncodingBlob](#encodingblob) | Yes | X.509 certificate serialization data. |
| callback | AsyncCallback\<[X509Cert](#x509cert)> | Yes | Callback invoked to return the result. **X509Cert** instance created.|
**Error codes**
| ID| Error Message |
| -------- | ------------- |
| 19020001 | Memory error. |
| 19020001 | memory error. |
**Example**
......@@ -149,13 +186,13 @@ Creates an **X509Cert** instance. This API uses a promise to return the result.
| Type | Description |
| ------- | ---------------- |
| Promise\<X509Cert> | **X509Cert** instance created.|
| Promise\<[X509Cert](#x509cert)> | **X509Cert** instance created.|
**Error codes**
| ID| Error Message |
| -------- | ------------- |
| 19020001 | Memory error. |
| 19020001 | memory error. |
**Example**
......@@ -184,7 +221,7 @@ Provides APIs for X.509 certificate operations.
verify(key : cryptoFramework.PubKey, callback : AsyncCallback\<void>) : void
Verifies the certificate signature. This API uses an asynchronous callback to return the result.
Verifies the signature of an X.509 certificate. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Security.Cert
......@@ -199,7 +236,7 @@ Verifies the certificate signature. This API uses an asynchronous callback to re
| ID| Error Message |
| -------- | ------------------ |
| 19030001 | Crypto operation error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -235,7 +272,7 @@ cryptoCert.createX509Cert(encodingBlob, function (error, x509Cert) {
verify(key : cryptoFramework.PubKey) : Promise\<void>
Verifies the certificate signature. This API uses a promise to return the result.
Verifies the signature of an X.509 certificate. This API uses a promise to return the result.
**System capability**: SystemCapability.Security.Cert
......@@ -255,7 +292,7 @@ Verifies the certificate signature. This API uses a promise to return the result
| ID| Error Message |
| -------- | ------------------ |
| 19030001 | Crypto operation error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -301,9 +338,9 @@ Obtains the serialized X.509 certificate data. This API uses an asynchronous cal
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -351,9 +388,9 @@ Obtains the serialized X.509 certificate data. This API uses a promise to return
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -397,8 +434,8 @@ Obtains the public key of this X.509 certificate. This API uses an asynchronous
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -446,10 +483,10 @@ Checks the validity period of this X.509 certificate. This API uses an asynchron
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19030001 | Crypto operation error.|
| 19030003 | The certificate has not taken effect. |
| 19030004 | The certificate has expired.|
| 19020001 | memory error. |
| 19030001 | crypto operation error.|
| 19030003 | the certificate has not taken effect. |
| 19030004 | the certificate has expired.|
**Example**
......@@ -570,9 +607,9 @@ Obtains the X.509 certificate issuer.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -614,9 +651,9 @@ Obtains the subject of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -658,9 +695,9 @@ Obtains the start time of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -702,9 +739,9 @@ Obtains the expiration time of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -746,9 +783,9 @@ Obtains the signature data of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -790,9 +827,9 @@ Obtains the signing algorithm of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -834,9 +871,9 @@ Obtains the object identifier (OID) of the X.509 certificate signing algorithm.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -878,9 +915,9 @@ Obtains the signing algorithm parameters of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -922,8 +959,8 @@ Obtains the key usage of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -965,9 +1002,9 @@ Obtains the usage of the extended key of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -1045,9 +1082,9 @@ Obtains the Subject Alternative Names (SANs) of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -1089,9 +1126,9 @@ Obtains the Issuer Alternative Names (IANs) of this X.509 certificate.
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error.|
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error.|
**Example**
......@@ -1115,6 +1152,336 @@ cryptoCert.createX509Cert(encodingBlob, function (error, x509Cert) {
});
```
### getItem<sup>10+</sup>
getItem(itemType: CertItemType) : DataBlob
Obtains the fields in the X.509 certificate.
**System capability**: SystemCapability.Security.Cert
**Return value**
| Type | Description |
| --------------------- | ----------------------------------------- |
| [DataBlob](#datablob) | Returns the obtained fields in DER format.|
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
```js
import cryptoCert from '@ohos.security.cert';
// Certificate binary data, which must be set based on the service.
let encodingData = null;
let encodingBlob = {
data: encodingData,
// Set the encoding format, which can be FORMAT_PEM or FORMAT_DER.
encodingFormat: cryptoCert.EncodingFormat.FORMAT_PEM
};
cryptoCert.createX509Cert(encodingBlob, function (error, x509Cert) {
if (error != null) {
console.log("createX509Cert failed, errCode: " + error.code + ", errMsg: " + error.message);
} else {
console.log("createX509Cert success");
let tbs = x509Cert.getItem(cryptoCert.CertItemType.CERT_ITEM_TYPE_TBS);
let pubKey = x509Cert.getItem(cryptoCert.CertItemType.CERT_ITEM_TYPE_PUBLIC_KEY);
}
});
```
## cryptoCert.createCertExtension<sup>10+</sup>
createCertExtension(inStream : EncodingBlob, callback : AsyncCallback\<CertExtension>) : void
Creates a **CertExtension** instance. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.Security.Cert
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------- | ---- | -------------------------- |
| inStream | [EncodingBlob](#encodingblob) | Yes | Serialized data of the certificate extension.|
| callback | AsyncCallback\<[CertExtension](#certextension10)> | Yes | Callback invoked to return the **CertExtension** instance created.|
**Error codes**
| ID| Error Message |
| -------- | ------------- |
| 19020001 | memory error. |
**Example**
```js
import cryptoCert from '@ohos.security.cert';
// Binary data of the certificate extension, which needs to be assigned by the service.
let encodingData = null;
let encodingBlob = {
data: encodingData,
// Assign a value based on the encodingData format. Currently, only FORMAT_DER is supported.
encodingFormat: cryptoCert.EncodingFormat.FORMAT_DER
};
cryptoCert.createCertExtension(encodingBlob, function (error, certExt) {
if (error != null) {
console.log("createCertExtension failed, errCode: " + error.code + ", errMsg: " + error.message);
} else {
console.log("createCertExtension success");
}
});
```
## cryptoCert.createCertExtension<sup>10+</sup>
createCertExtension(inStream : EncodingBlob) : Promise\<CertExtension>
Creates a **CertExtension** instance. This API uses a promise to return the result.
**System capability**: SystemCapability.Security.Cert
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | -------------------------- |
| inStream | [EncodingBlob](#encodingblob) | Yes | Serialized data of the certificate extension.|
**Return value**
| Type | Description |
| ------------------------------------------- | -------------------- |
| Promise\<[CertExtension](#certextension10)> | Promise used to return the **CertExtension** instance created.|
**Error codes**
| ID| Error Message |
| -------- | ------------- |
| 19020001 | memory error. |
**Example**
```js
import cryptoCert from '@ohos.security.cert';
// Binary data of the certificate extension, which needs to be assigned by the service.
let encodingData = null;
let encodingBlob = {
data: encodingData,
// Assign a value based on the encodingData format. Currently, only FORMAT_DER is supported.
encodingFormat: cryptoCert.EncodingFormat.FORMAT_DER
};
cryptoCert.createCertExtension(encodingBlob).then(certExt => {
console.log("createCertExtension success");
}, error => {
console.log("createCertExtension failed, errCode: " + error.code + ", errMsg: " + error.message);
});
```
## CertExtension<sup>10+</sup>
Provides APIs for operating the certificate extensions.
### getEncoded<sup>10+</sup>
getEncoded() : EncodingBlob
Obtains the serialized data of the certificate extensions.
**System capability**: SystemCapability.Security.Cert
**Return value**
| Type | Description |
| ----------------------------- | ---------------------------- |
| [EncodingBlob](#encodingblob) | Returns the serialized data obtained.|
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
```js
import cryptoCert from '@ohos.security.cert';
// Binary data of the certificate extension, which needs to be assigned by the service.
let encodingData = null;
let encodingBlob = {
data: encodingData,
// Assign a value based on the encodingData format. Currently, only FORMAT_DER is supported.
encodingFormat: cryptoCert.EncodingFormat.FORMAT_DER
};
cryptoCert.createCertExtension(encodingBlob, function (error, certExt) {
if (error != null) {
console.log("createCertExtension failed, errCode: " + error.code + ", errMsg: " + error.message);
} else {
console.log("createCertExtension success");
let encodingBlob = certExt.getEncoded()
}
});
```
### getOidList<sup>10+</sup>
getOidList(valueType : ExtensionOidType) : DataArray
Obtains the OIDs of the certificate extensions.
**System capability**: SystemCapability.Security.Cert
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------------------- | ---- | ------------------------------ |
| valueType | [ExtensionOidType](#extensionoidtype) | Yes | Type of the OIDs to obtain.|
**Return value**
| Type | Description |
| ----------------------- | -------------------------------- |
| [DataArray](#dataarray) | Returns a list of the OIDs obtained.|
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
```js
import cryptoCert from '@ohos.security.cert';
// Binary data of the certificate extension, which needs to be assigned by the service.
let encodingData = null;
let encodingBlob = {
data: encodingData,
// Assign a value based on the encodingData format. Currently, only FORMAT_DER is supported.
encodingFormat: cryptoCert.EncodingFormat.FORMAT_DER
};
cryptoCert.createCertExtension(encodingBlob, function (error, certExt) {
if (error != null) {
console.log("createCertExtension failed, errCode: " + error.code + ", errMsg: " + error.message);
} else {
console.log("createCertExtension success");
let oidList = certExt.getOidList(cryptoCert.ExtensionOidType.EXTENSION_OID_TYPE_ALL)
}
});
```
### getEntry<sup>10+</sup>
getEntry(valueType: ExtensionEntryType, oid : DataBlob) : DataBlob
Obtains the certificate extension object information.
**System capability**: SystemCapability.Security.Cert
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ----------------------------------------- | ---- | -------------------------------- |
| valueType | [ExtensionEntryType](#extensionentrytype) | Yes | Type of the information to obtain. |
| oid | [DataBlob](#datablob) | Yes | OID of the certificate extension to obtain.|
**Return value**
| Type | Description |
| --------------------- | ---------------------------- |
| [DataBlob](#datablob) | Returns the certificate extension object information obtained.|
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
```js
import cryptoCert from '@ohos.security.cert';
// Binary data of the certificate extension, which needs to be assigned by the service.
let encodingData = null;
let encodingBlob = {
data: encodingData,
// Assign a value based on the encodingData format. Currently, only FORMAT_DER is supported.
encodingFormat: cryptoCert.EncodingFormat.FORMAT_DER
};
cryptoCert.createCertExtension(encodingBlob, function (error, certExt) {
if (error != null) {
console.log("createCertExtension failed, errCode: " + error.code + ", errMsg: " + error.message);
} else {
console.log("createCertExtension success");
let oid = new Uint8Array([0x31, 0x2e, 0x32, 0x2e, 0x38, 0x2e, 0x31])
let oidBlob = {
data: oid
}
let entry = certExt.getEntry(cryptoCert.ExtensionEntryType.EXTENSION_ENTRY_TYPE_ENTRY, oidBlob)
}
});
```
### checkCA<sup>10+</sup>
checkCA() : number
Checks whether the certificate is a CA certificate.
**System capability**: SystemCapability.Security.Cert
**Return value**
| Type | Description |
| ------ | ------------------------------------------------------------ |
| 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
import cryptoCert from '@ohos.security.cert';
// Binary data of the certificate extension, which needs to be assigned by the service.
let encodingData = null;
let encodingBlob = {
data: encodingData,
// Assign a value based on the encodingData format. Currently, only FORMAT_DER is supported.
encodingFormat: cryptoCert.EncodingFormat.FORMAT_DER
};
cryptoCert.createCertExtension(encodingBlob, function (error, certExt) {
if (error != null) {
console.log("createCertExtension failed, errCode: " + error.code + ", errMsg: " + error.message);
} else {
console.log("createCertExtension success");
let res = certExt.checkCA()
}
});
```
## cryptoCert.createX509Crl
createX509Crl(inStream : EncodingBlob, callback : AsyncCallback\<X509Crl>) : void
......@@ -1125,16 +1492,16 @@ Creates an **X509Crl** instance. This API uses an asynchronous callback to retur
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | ------------------------------ |
| inStream | [EncodingBlob](#encodingblob) | Yes | Serialized certificate revocation list (CRL) data. |
| callback | AsyncCallback\<X509Crl> | Yes | Callback invoked to return the result. Promise used to return the **X509Crl** instance created.|
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------- | ---- | ------------------------------ |
| inStream | [EncodingBlob](#encodingblob) | Yes | Serialized certificate revocation list (CRL) data. |
| 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.|
| Type | Description |
| ----------------------------- | -------------------- |
| Promise\<[X509Crl](#x509crl)> | Promise used to return the **X509Crl** instance created.|
**Error codes**
| ID| Error Message |
| -------- | ------------- |
| 19020001 | Memory error. |
| 19020001 | memory error. |
**Example**
......@@ -1308,9 +1675,9 @@ Obtains the serialized X.509 CRL data. This API uses an asynchronous callback to
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1358,9 +1725,9 @@ Obtains the serialized X.509 CRL data. This API uses a promise to return the res
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1405,7 +1772,7 @@ Verifies the signature of the X.509 CRL. This API uses an asynchronous callback
| ID| Error Message |
| -------- | ----------------------- |
| 19030001 | Crypto operation error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1462,7 +1829,7 @@ Verifies the signature of the X.509 CRL. This API uses a promise to return the r
| ID| Error Message |
| -------- | ----------------------- |
| 19030001 | Crypto operation error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1545,9 +1912,9 @@ Obtains the issuer of the X.509 CRL.
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1589,9 +1956,9 @@ Obtains the date when the X.509 CRL was last updated.
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1633,9 +2000,9 @@ Obtains the date when the CRL will be updated the next time.
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1677,14 +2044,14 @@ Obtains the revoked X.509 certificate based on the specified serial number of th
| Type | Description |
| ---------------------- | --------------------- |
| X509CrlEntry | Promise used to return the revoked X.509 certificate obtained.|
| [X509CrlEntry](#x509crlentry) | Promise used to return the revoked X.509 certificate obtained.|
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1724,22 +2091,22 @@ Obtains the revoked X.509 certificate based on the specified certificate. This A
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | -------- | ---- | ------------ |
| cert | X509Cert | Yes | Certificate based on which the revoked certificate is obtained.|
| Name| Type | Mandatory| Description |
| ------ | --------------------- | ---- | ------------ |
| cert | [X509Cert](#x509cert) | Yes | Certificate based on which the revoked certificate is obtained.|
**Return value**
| Type | Description |
| ------------ | -------------------- |
| X509CrlEntry | Promise used to return the revoked X.509 certificate obtained.|
| [X509CrlEntry](#x509crlentry) | Promise used to return the revoked X.509 certificate obtained.|
**Error codes**
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1779,16 +2146,16 @@ Obtains all the revoked X.509 certificates. This API uses an asynchronous callba
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback<Array\<X509CrlEntry>> | Yes | Callback invoked to return the result. Promise used to return a list of revoked X.509 certificates.|
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------- | ---- | -------------------------------- |
| 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
**Return value**
| Type | Description |
| ----------------------------- | ---------------------- |
| Promise<Array\<X509CrlEntry>> | Promise used to return a list of revoked X.509 certificates.|
| Type | Description |
| ---------------------------------------------- | ---------------------- |
| Promise<Array\<[X509CrlEntry](#x509crlentry)>> | 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**
......@@ -1881,9 +2248,9 @@ Obtains the DER-encoded CRL information, the **tbsCertList** from this CRL. This
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1929,9 +2296,9 @@ Obtains the signature data of the X.509 CRL.
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -1973,9 +2340,9 @@ Obtains the signing algorithm of the X.509 CRL.
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -2017,9 +2384,9 @@ Obtains the OID of the X.509 CRL signing algorithm. OIDs are allocated by the In
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -2061,9 +2428,9 @@ Obtains the parameters of the X.509 CRL signing algorithm.
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -2111,9 +2478,9 @@ Creates a **CertChainValidator** object.
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -2157,15 +2524,15 @@ The certificate chain validator does not verify the certificate validity period
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19030002 | The certificate signature verification failed. |
| 19030003 | The certificate has not taken effect. |
| 19030004 | The certificate has expired. |
| 19030005 | Failed to obtain the certificate issuer. |
| 19030006 | The key cannot be used for signing a certificate. |
| 19030007 | The key cannot be used for digital signature. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
| 19030002 | the certificate signature verification failed. |
| 19030003 | the certificate has not taken effect. |
| 19030004 | the certificate has expired. |
| 19030005 | failed to obtain the certificate issuer. |
| 19030006 | the key cannot be used for signing a certificate. |
| 19030007 | the key cannot be used for digital signature. |
**Example**
......@@ -2217,15 +2584,15 @@ The certificate chain validator does not verify the certificate validity period
| ID| Error Message |
| -------- | ------------------------------------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19030002 | The certificate signature verification failed. |
| 19030003 | The certificate has not taken effect. |
| 19030004 | The certificate has expired. |
| 19030005 | Failed to obtain the certificate issuer. |
| 19030006 | The key cannot be used for signing a certificate. |
| 19030007 | The key cannot be used for digital signature. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
| 19030002 | the certificate signature verification failed. |
| 19030003 | the certificate has not taken effect. |
| 19030004 | the certificate has expired. |
| 19030005 | failed to obtain the certificate issuer. |
| 19030006 | the key cannot be used for signing a certificate. |
| 19030007 | the key cannot be used for digital signature. |
**Example**
......@@ -2295,9 +2662,9 @@ Obtains the serialized data of this revoked certificate. This API uses an asynch
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -2333,9 +2700,9 @@ Obtains the serialized data of this revoked certificate. This API uses a promise
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......@@ -2393,8 +2760,8 @@ Obtains the issuer of this revoked certificate. This API uses an asynchronous ca
| ID| Error Message |
| -------- | -------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
**Example**
......@@ -2428,9 +2795,9 @@ Obtains the date when the certificate was revoked. This API uses an asynchronous
| ID| Error Message |
| -------- | ----------------------- |
| 19020001 | Memory error. |
| 19020002 | Runtime error. |
| 19030001 | Crypto operation error. |
| 19020001 | memory error. |
| 19020002 | runtime error. |
| 19030001 | crypto operation error. |
**Example**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册