WebCrypto GOST Class: PKCS8

GostKeys. PKCS8

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
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, keyAlgorithm) → {Promise}

Generate private key and return certification request
Parameters:
Name Type Description
req FormatedData | GostASN1.CertificationRequest The request templates
keyAlgorithm AlgorithmIdentifier | 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
privateKey Key The Private Key
Source:
Returns:
Promise to return the self object after set the key
Type
Promise