Skip to main content

PrivateKeyCiphertext

Overview

Represents an encrypted private key. The PrivateKeyCiphertext class provides methods for encrypting and decrypting private keys using a secret string. This allows for secure storage of private keys.

Methods

encryptPrivateKey

Encrypt a private key using a secret string. The secret is sensitive and will be needed to decrypt the private key later, so it should be stored securely.

encryptPrivateKey(private_key, secret)PrivateKeyCiphertext
ParamTypeDescription
private_keyPrivateKeyPrivate key to encrypt
secretstringSecret to encrypt the private key with
returnPrivateKeyCiphertextPrivate key ciphertext

decryptToPrivateKey

Decrypts a private ciphertext using a secret string. This must be the same secret used to encrypt the private key.

decryptToPrivateKey(secret)PrivateKey
ParamTypeDescription
secretstringSecret used to encrypt the private key
returnPrivateKeyPrivate key

toString

Returns the ciphertext string

toString() ► string
ParamType
returnstring

fromString

Creates a PrivateKeyCiphertext from a string

fromString(ciphertext)PrivateKeyCiphertext
ParamTypeDescription
ciphertextstringCiphertext string
returnPrivateKeyCiphertextPrivate key ciphertext