Constructor
new Request(req)
A class that encapsulates a DER-encoded PKCS #10 certificate request. The request contains
the subject's name and public key, and it is signed with the subject's private key.
The public key contained in the request is used to verify the signature.
The signature on the request is verified automatically when the request is read.
Note that the subject's private key is used only to produce a signature when the request is output,
and is not actually stored with the request.
Parameters:
| Name | Type | Description |
|---|---|---|
req |
FormatedData | GostASN1.CertificationRequest |
- Source:
Extends
Methods
-
check()
-
Check the object structure
- Inherited From:
- Source:
-
decode(source)
-
Decode the source to self object
Parameters:
Name Type Description sourceFormatedData Encoded data - Inherited From:
- Source:
-
encode(format) → {FormatedData}
-
Encode the object
Parameters:
Name Type Description formatstring Encoding format 'DER', 'CER' or 'PEM' - Inherited From:
- Source:
Returns:
- Type
- FormatedData
-
generate(keyAlgorithm) → {Promise}
-
Generate key pair and sign request
Parameters:
Name Type Description keyAlgorithmAlgorithmIdentifier | string The name of provider or algorithm - Source:
Returns:
Promise to return GostASN1.PrivateKeyInfo after request generation- Type
- Promise
-
getProvider()
-
Get appropriate crypto provider for public key
- Source:
Returns:
Object Set of crypto provider algorithms -
sign(privateKey)
-
Generate the contents of this request and sign it.
Parameters:
Name Type Description privateKeyGostASN1.PrivateKeyInfo The subject's private key - Source:
Returns:
Promise to return self object after sign the request -
verify() → {Promise}
-
Verify the Certification Request. Checks the signature on the public key in the request.
- Source:
Returns:
Promise to return self object if the certificate is valid- Type
- Promise