_pcp_key_t Struct Reference

PCP private key structure. More...

#include <structs.h>

Public Attributes

byte masterpub [32]
 ED25519 master public key signing key. More...
 
byte mastersecret [64]
 ED25519 master secret key signing key. More...
 
byte pub [32]
 Curve25519 encryption public key. More...
 
byte secret [32]
 Curve25519 encryption secret key. More...
 
byte edpub [32]
 ED25519 public signing key. More...
 
byte edsecret [64]
 ED25519 secret signing key. More...
 
byte nonce [24]
 random nonce used to encrypt secret keys More...
 
byte encrypted [176]
 concatenated and encrypted secret keys More...
 
char owner [255]
 the key owner, string More...
 
char mail [255]
 mail address of the owner, string More...
 
char id [17]
 key-id, used internally only, jenhash of public keys More...
 
uint8_t type
 key type: MASTER_SECRET or SECRET More...
 
uint64_t ctime
 creation time, epoch More...
 
uint32_t version
 key version More...
 
uint32_t serial
 serial number of the key, randomly generated More...
 

Detailed Description

PCP private key structure.

Most fields are self explanatory.

Some notes:

'encrypted' contains the encrypted secret keys (contatenated mastersecret, secret and edsecret). If it's set, the field 'secret' which contains the clear secret key will be zeroed with random values, the first byte will be 0. Same for the field 'edsecret'.

'nonce' contains the nonce required to decrypt the encrypted secret, if set.

'serial' is a random number.

'id' is a string containing the hex values of the CRC32 checksum of the public and secret key.

Upon creation everything will be filled with random bytes. String fields will contain a string followed by 0 followed by the rest of the pre-filled random bytes. To denote a string field as empty, the first byte will be set to 0.

There are dynamically calculated attributes as well:

'checksum' is a 256 bit SHA hash of the public key returned by pcpkey_getchecksum() or pcppubkey_getchecksum().

'random id' is a random art ascii image returned by pcppubkey_get_art() or pcpkey_get_art(), calculated from the public key.

If exported to a single file or printed, the structure will be encoded using Z85 encoding.

Definition at line 72 of file structs.h.

Member Data Documentation

uint64_t _pcp_key_t::ctime

creation time, epoch

Definition at line 85 of file structs.h.

byte _pcp_key_t::edpub[32]

ED25519 public signing key.

Definition at line 77 of file structs.h.

byte _pcp_key_t::edsecret[64]

ED25519 secret signing key.

Definition at line 78 of file structs.h.

byte _pcp_key_t::encrypted[176]

concatenated and encrypted secret keys

Definition at line 80 of file structs.h.

char _pcp_key_t::id[17]

key-id, used internally only, jenhash of public keys

Definition at line 83 of file structs.h.

char _pcp_key_t::mail[255]

mail address of the owner, string

Definition at line 82 of file structs.h.

byte _pcp_key_t::masterpub[32]

ED25519 master public key signing key.

Definition at line 73 of file structs.h.

byte _pcp_key_t::mastersecret[64]

ED25519 master secret key signing key.

Definition at line 74 of file structs.h.

byte _pcp_key_t::nonce[24]

random nonce used to encrypt secret keys

Definition at line 79 of file structs.h.

char _pcp_key_t::owner[255]

the key owner, string

Definition at line 81 of file structs.h.

byte _pcp_key_t::pub[32]

Curve25519 encryption public key.

Definition at line 75 of file structs.h.

byte _pcp_key_t::secret[32]

Curve25519 encryption secret key.

Definition at line 76 of file structs.h.

uint32_t _pcp_key_t::serial

serial number of the key, randomly generated

Definition at line 87 of file structs.h.

uint8_t _pcp_key_t::type

key type: MASTER_SECRET or SECRET

Definition at line 84 of file structs.h.

uint32_t _pcp_key_t::version

key version

Definition at line 86 of file structs.h.


The documentation for this struct was generated from the following file: