ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
openpgp.h File Reference

OpenPGP (RFC 4880) packet format parser. More...

Go to the source code of this file.

Data Structures

struct  openpgp_packet_header_t
 OpenPGP packet header information. More...
 
struct  openpgp_public_key_t
 OpenPGP public key packet data. More...
 
struct  openpgp_secret_key_t
 OpenPGP secret key packet data. More...
 

Macros

OpenPGP Constants
#define OPENPGP_TAG_PUBLIC_KEY   6
 OpenPGP packet tag for Public Key Packet.
 
#define OPENPGP_TAG_SECRET_KEY   5
 OpenPGP packet tag for Secret Key Packet.
 
#define OPENPGP_TAG_USER_ID   13
 OpenPGP packet tag for User ID Packet.
 
#define OPENPGP_TAG_SIGNATURE   2
 OpenPGP packet tag for Signature Packet.
 
#define OPENPGP_ALGO_EDDSA   22
 OpenPGP algorithm ID for EdDSA (Ed25519)
 
#define OPENPGP_ALGO_ECDH   18
 OpenPGP algorithm ID for ECDH (Curve25519)
 

Functions

PGP Armored Format Parsing
asciichat_error_t openpgp_parse_armored_pubkey (const char *armored_text, uint8_t ed25519_pk[32])
 Parse PGP armored key block and extract Ed25519 public key.
 
asciichat_error_t openpgp_parse_armored_seckey (const char *armored_text, uint8_t ed25519_pk[32], uint8_t ed25519_sk[32])
 Parse PGP armored secret key block and extract Ed25519 keypair.
 
OpenPGP Packet Parsing
asciichat_error_t openpgp_parse_packet_header (const uint8_t *data, size_t data_len, openpgp_packet_header_t *header)
 Parse OpenPGP packet header.
 
asciichat_error_t openpgp_parse_public_key_packet (const uint8_t *packet_body, size_t body_len, openpgp_public_key_t *pubkey)
 Parse OpenPGP Public Key Packet (tag 6)
 
asciichat_error_t openpgp_parse_secret_key_packet (const uint8_t *packet_body, size_t body_len, openpgp_secret_key_t *seckey)
 Parse OpenPGP Secret Key Packet (tag 5)
 
asciichat_error_t openpgp_extract_ed25519_from_mpi (const uint8_t *mpi, size_t mpi_len, uint8_t ed25519_pk[32])
 Extract Ed25519 public key from MPI-encoded data.
 
Base64 Decoding for PGP Armor
asciichat_error_t openpgp_base64_decode (const char *base64, size_t base64_len, uint8_t **binary_out, size_t *binary_len)
 Decode PGP armored base64 data.
 

Detailed Description

OpenPGP (RFC 4880) packet format parser.

Definition in file openpgp.h.