ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
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
 The framing fields needed to locate and classify one OpenPGP packet body. More...
struct  openpgp_public_key_t
 The parsed identity portion of an OpenPGP public-key packet. More...
struct  openpgp_secret_key_t
 The parsed public and private material from an OpenPGP secret-key packet. More...

Macros

OpenPGP Constants

The framing fields needed to locate and classify one OpenPGP packet body

The parsed identity portion of an OpenPGP public-key packet

The parsed public and private material from an OpenPGP secret-key packet

#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_binary_pubkey (const uint8_t *data, size_t data_len, uint8_t ed25519_pk[32])
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.
asciichat_error_t openpgp_parse_binary_seckey (const uint8_t *data, size_t data_len, uint8_t ed25519_pk[32], uint8_t ed25519_sk[32])
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.