Attempts to decrypt a base64 encoded PrivateKey string with the given password. The privateKey must have been exported using the same password and underlying cipher (aes-gcm)
Promise<Uint8Array>
:
The private key protobuf
any
:
Uses the provided password to derive a pbkdf2 key. The key will then be used to encrypt the data.
(Uint8Array)
The data to decrypt
((string | Uint8Array))
A plain password
Promise<Uint8Array>
:
Uses the provided password to derive a pbkdf2 key. The key will then be used to decrypt the data. The options used to create this decryption cipher must be the same as those used to create the encryption cipher.
(Uint8Array)
The data to decrypt
((string | Uint8Array))
A plain password
Gets the ID of the key.
The key id is the base58 encoding of the SHA-256 multihash of its public key. The public key is a protobuf encoding containing a type and the DER encoding of the PKCS SubjectPublicKeyInfo.
Promise<String>
:
Exports the key into a password protected PEM format
Type: PrivateKey
Exports the given PrivateKey as a base64 encoded string. The PrivateKey is encrypted via a password derived PBKDF2 key leveraging the aes-gcm cipher algorithm.
(Uint8Array)
The PrivateKey protobuf
(string)
Promise<string>
:
A base64 encoded string
Gets the ID of the key.
The key id is the base58 encoding of the SHA-256 multihash of its public key. The public key is a protobuf encoding containing a type and the DER encoding of the PKCS SubjectPublicKeyInfo.
Promise<String>
:
Exports the key into a password protected format
(string)
The password to encrypt the key
(string
= libp2p-key
)
The format in which to export as
Promise<Uint8Array>
:
The encrypted private key
Gets the ID of the key.
The key id is the base58 encoding of the SHA-256 multihash of its public key. The public key is a protobuf encoding containing a type and the DER encoding of the PKCS SubjectPublicKeyInfo.
Promise<string>
:
Exports the key into a password protected format
(string)
The password to encrypt the key
(string
= libp2p-key
)
The format in which to export as
Promise<string>
:
The encrypted private key
Computes the Password-Based Key Derivation Function 2.
(string)
(string)
(number)
(number)
(in bytes)
(string)
The hash name ('sha1', 'sha2-512, ...)
string
:
A new password