WebCrypto GOST Class: ViPNetContainer

GostKeys. ViPNetContainer

Constructor

new ViPNetContainer(container)

A class for password-encrypted private keys in ViPNet container
Parameters:
Name Type Description
container FormatedData | GostKeys.ViPNetContainer
Source:

Methods

decode(container) → {GostKeys.ViPNetContainer}

Decode container to the object
Parameters:
Name Type Description
container FormatedData
Source:
Returns:
Type
GostKeys.ViPNetContainer

decode(container) → {GostKeys.ViPNetContainer}

Decode container
Parameters:
Name Type Description
container FormatedData
Source:
Returns:
Type
GostKeys.ViPNetContainer

encode(format) → {CryptoOperationData}

Encode objet to container
Parameters:
Name Type Description
format string The encoded data format
Source:
Returns:
Type
CryptoOperationData

encode(object, format) → {CryptoOperationData}

Encode object
Parameters:
Name Type Description
object GostKeys.ViPNetContainer
format string The encoded data format
Source:
Returns:
Type
CryptoOperationData

getCertificate(index) → {Promise}

Get the certificate from the container
Parameters:
Name Type Description
index number Index of the entriy. Default 0
Source:
Returns:
Promise to return GostCert.X509
Type
Promise

getKey(keyPassword, index) → {Promise}

Get the private key info
Parameters:
Name Type Description
keyPassword string The password for decryption
index number Index of the entriy. Default 0
Source:
Returns:
Promise to return GostKeys.PKCS8
Type
Promise

getPrivateKey(keyPassword, index) → {Promise}

Get the private key
Parameters:
Name Type Description
keyPassword string The password of secrect key for decryption
index number Index of the entriy. Default 0
Source:
Returns:
Promise to return the Key
Type
Promise

setCertificate(certificate, index) → {Promise}

Set the certificate to the container
Parameters:
Name Type Description
certificate FormatedData | GostCert.X509 The certificate
index number Index of the entriy. Default 0
Source:
Returns:
Promise to return self object after set certificate
Type
Promise

setKey(keyInfo, keyPassword, index, days) → {Promise}

Set the key to the container
Parameters:
Name Type Description
keyInfo FormatedData | GostKeys.PKCS8 The key
keyPassword string The password for decryption
index number Index of the entriy. Default 0
days number Validity days. Default 7305 days (20 years)
Source:
Returns:
Promise to return self object after set the key
Type
Promise