libpcp  0.2.1
Public Attributes | List of all members
_pcp_key_t Struct Reference

PCP private key structure. More...

#include <key.h>

Public Attributes

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

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 93 of file key.h.

Member Data Documentation

uint64_t _pcp_key_t::ctime

creation time, epoch

Definition at line 106 of file key.h.

byte _pcp_key_t::edpub[32]

ED25519 public signing key.

Definition at line 98 of file key.h.

byte _pcp_key_t::edsecret[64]

ED25519 secret signing key.

Definition at line 99 of file key.h.

byte _pcp_key_t::encrypted[176]

concatenated and encrypted secret keys

Definition at line 101 of file key.h.

char _pcp_key_t::id[17]

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

Definition at line 104 of file key.h.

char _pcp_key_t::mail[255]

mail address of the owner, string

Definition at line 103 of file key.h.

byte _pcp_key_t::masterpub[32]

ED25519 master public key signing key.

Definition at line 94 of file key.h.

byte _pcp_key_t::mastersecret[64]

ED25519 master secret key signing key.

Definition at line 95 of file key.h.

byte _pcp_key_t::nonce[24]

random nonce used to encrypt secret keys

Definition at line 100 of file key.h.

char _pcp_key_t::owner[255]

the key owner, string

Definition at line 102 of file key.h.

byte _pcp_key_t::pub[32]

Curve25519 encryption public key.

Definition at line 96 of file key.h.

byte _pcp_key_t::secret[32]

Curve25519 encryption secret key.

Definition at line 97 of file key.h.

uint32_t _pcp_key_t::serial

serial number of the key, randomly generated

Definition at line 108 of file key.h.

uint8_t _pcp_key_t::type

key type: MASTER_SECRET or SECRET

Definition at line 105 of file key.h.

uint32_t _pcp_key_t::version

key version

Definition at line 107 of file key.h.


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