Constructor
new PKCS8Encrypted(encryptedKey)
A class for PKCS #5 and PKCS #12 password-encrypted private keys in PKCS #8 format
Parameters:
| Name | Type | Description |
|---|---|---|
encryptedKey |
FormatedData | GostASN1.EncryptedPrivateKeyInfo |
- 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, keyPassword, keyAlgorithm, encryptionAlgorithm) → {Promise}
-
Generate private key and return certification request
Parameters:
Name Type Description reqFormatedData | GostASN1.CertificationRequest The request templates keyPasswordKey | CryptoOperationData | string The secret key or password for decryption keyAlgorithmAlgorithmIdentifier | string The name of provider or algorithm encryptionAlgorithmAlgorithmIdentifier | string The encryption algorithm or provider name - Source:
Returns:
Promise to return GostCert.Request- Type
- Promise
-
getKey(keyPassword) → {Promise}
-
Get the private key info
Parameters:
Name Type Description keyPasswordKey | CryptoOperationData | string The secret key or password for decryption - Source:
Returns:
Promise to return decrypted GostKeys.PKCS8- Type
- Promise
-
getPrivateKey(keyPassword) → {Promise}
-
Get the private key
Parameters:
Name Type Description keyPasswordKey | CryptoOperationData | string The secret key or password for decryption - Source:
Returns:
Promise to return decrypted Key- Type
- Promise
-
setKey(keyInfo, keyPassword, encryptionAlgorithm) → {Promise}
-
Sets and encrypt the private key info
Parameters:
Name Type Description keyInfoFormatedData | GostKeys.PKCS8 The private key info keyPasswordKey | CryptoOperationData | string The secret key or password for encryption encryptionAlgorithmAlgorithmIdentifier | string The encryption algorithm or provider name - Source:
Returns:
Promise to return self object after set key- Type
- Promise
-
setPrivateKey(privateKey, keyPassword, encryptionAlgorithm) → {Promise}
-
Set the private key
Parameters:
Name Type Description privateKeyKey The private key keyPasswordKey | CryptoOperationData | string The secret key or password for decryption encryptionAlgorithmAlgorithmIdentifier | string The encryption algorithm or provider name - Source:
Returns:
Promise to return self object after set key- Type
- Promise