Constructor
new PKCS8(keyInfo)
A class for private keys in PKCS #8 format
Parameters:
| Name | Type | Description |
|---|---|---|
keyInfo |
FormatedData | GostASN1.PrivateKeyInfo |
- 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(req, keyAlgorithm) → {Promise}
-
Generate private key and return certification request
Parameters:
Name Type Description reqFormatedData | GostASN1.CertificationRequest The request templates keyAlgorithmAlgorithmIdentifier | string The name of provider or algorithm identifier - Source:
Returns:
Promise to return the GostCert.Request after key generation- Type
- Promise
-
getPrivateKey() → {Promise}
-
Get the private key
- Source:
Returns:
Promise to return the Key- Type
- Promise
-
setPrivateKey(privateKey) → {Promise}
-
Set the private key
Parameters:
Name Type Description privateKeyKey The Private Key - Source:
Returns:
Promise to return the self object after set the key- Type
- Promise