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 containerFormatedData - Source:
Returns:
-
decode(container) → {GostKeys.ViPNetContainer}
-
Decode container
Parameters:
Name Type Description containerFormatedData - Source:
Returns:
-
encode(format) → {CryptoOperationData}
-
Encode objet to container
Parameters:
Name Type Description formatstring The encoded data format - Source:
Returns:
- Type
- CryptoOperationData
-
encode(object, format) → {CryptoOperationData}
-
Encode object
Parameters:
Name Type Description objectGostKeys.ViPNetContainer formatstring The encoded data format - Source:
Returns:
- Type
- CryptoOperationData
-
getCertificate(index) → {Promise}
-
Get the certificate from the container
Parameters:
Name Type Description indexnumber 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 keyPasswordstring The password for decryption indexnumber 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 keyPasswordstring The password of secrect key for decryption indexnumber 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 certificateFormatedData | GostCert.X509 The certificate indexnumber 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 keyInfoFormatedData | GostKeys.PKCS8 The key keyPasswordstring The password for decryption indexnumber Index of the entriy. Default 0 daysnumber Validity days. Default 7305 days (20 years) - Source:
Returns:
Promise to return self object after set the key- Type
- Promise