Creates a new instance of KeyPair
.
When no privateKey
value is passed, the constructor generates a new
Ed25519 key pair using the systems random number generator (CSPRNG) as a
seed.
Warning: Depending on the context this does not guarantee the random number generator to be cryptographically secure (eg. broken / hijacked browser or system implementations), so make sure to only run this in trusted environments.
Optional
privateKey: stringHexadecimal encoded private key. Warning: Absolutely no validation is done on the key. If you give this function bytes which do not represent a valid point, or which do not represent corresponding parts of the key, then your KeyPair will be broken and it will be your fault.
KeyPair instance
import { KeyPair } from 'p2panda-js';
const keyPair = new KeyPair('1f9e81007da0c007314a151be11be392de4cdc76888fbc5a8c62aa03c6730c6a');
Readonly
Internal
__internalGenerated using TypeDoc
Ed25519 key pair to sign Bamboo entries with.
Example