A Keypair is an object that can group relevant keys for a user in the webb system. The keys managed by a keypair are as follows:
pubkey = poseidon(privkey)
Initialize a new keypair from a passed hex string. Generates a random private key if not defined.
hex string of a field element for the
Decrypt data using keypair private key
A Buffer of the decrypted data
a hex string with data
Encrypt data using keypair encryption key
a hex string encoding of encrypted data with this encryption key
A buffer to encrypt
a 0x-prefixed, 32 fixed byte hex-string representation of the encryption key
a 0x-prefixed, 32 fixed byte hex-string representation of the public key
a string of public parts of this keypair object: pubkey and encryption key.
Initialize new keypair from string data.
The keypair object configured with appropriate public values.
If the string object is not 66 chars or 130 chars.
A string which contains public keydata. (0, 66), the slice for the pubKey value, 0x-prefixed, which is required. (66, 130), the slice for the encryptionKey value, which is optional to enable encrypt and decrypt functionality. It should be hex encoded.
Generated using TypeDoc