WebCrypto GOST Class: PKCS8Encrypted

GostKeys. PKCS8Encrypted

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
source FormatedData Encoded data
Inherited From:
Source:

encode(format) → {FormatedData}

Encode the object
Parameters:
Name Type Description
format string 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
req FormatedData | GostASN1.CertificationRequest The request templates
keyPassword Key | CryptoOperationData | string The secret key or password for decryption
keyAlgorithm AlgorithmIdentifier | string The name of provider or algorithm
encryptionAlgorithm AlgorithmIdentifier | 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
keyPassword Key | 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
keyPassword Key | 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
keyInfo FormatedData | GostKeys.PKCS8 The private key info
keyPassword Key | CryptoOperationData | string The secret key or password for encryption
encryptionAlgorithm AlgorithmIdentifier | 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
privateKey Key The private key
keyPassword Key | CryptoOperationData | string The secret key or password for decryption
encryptionAlgorithm AlgorithmIdentifier | string The encryption algorithm or provider name
Source:
Returns:
Promise to return self object after set key
Type
Promise