An encapsulated private key.
Synopsis
Declared in <key.h>
class CKey;
Member Functions
Name |
Description |
|
Constructors |
Assignment operators |
|
Compute a BIP324‐style ECDH shared secret. |
|
Compute a KeyPair |
|
Derive BIP32 child key. |
|
Create an ellswift‐encoded public key for this key, with specified entropy. |
|
Convert the private key to a CPrivKey (serialized OpenSSL private key data). This is expensive. |
|
Compute the public key from a private key. This is expensive. |
|
Check whether the public key corresponding to this private key is (to be) compressed. |
|
Check whether this private key is valid. |
|
Load private key and check that public key matches. |
|
Generate a new private key using a cryptographic PRNG. |
|
Initialize using begin and end iterators to byte data. |
|
Create a DER‐serialized signature. The test_case parameter tweaks the deterministic nonce. |
|
Create a compact signature (65 bytes), which allows reconstructing the used public key. The format is one header byte, followed by two times 32 bytes for the serialized r and s values. The header byte: 0x1B = first key with even y, 0x1C = first key with odd y, 0x1D = second key with even y, 0x1E = second key with odd y, add 0x04 for compressed keys. |
|
Create a BIP‐340 Schnorr signature, for the xonly‐pubkey corresponding to *this, optionally tweaked by *merkle_root. Additional nonce entropy is provided through aux. |
|
Verify thoroughly whether a private key and a public key match. This is done using a different mechanism than just regenerating it. |
|
Iterator to the first key byte. |
|
Pointer to the first key byte, or nullptr if the key is invalid. |
|
Iterator past the last key byte. |
|
Number of key bytes, or 0 if the key is invalid. |
Static Data Members
Name |
Description |
Size in bytes of a serialized private key whose public key is compressed. |
|
secp256k1: |
Friends
Name |
Description |
Compare two private keys for equality of compression flag and key material. |
Non-Member Functions
Name |
Description |
Decode a WIF‐encoded private key. |
|
Encode a private key in WIF format. |
|
Generate a new random private key. |
|
Sign a message. |
Created with MrDocs