From bbbc6da375d6584c7b2bcc74e838fff943f489d4 Mon Sep 17 00:00:00 2001 From: Justus Winter Date: Thu, 28 Nov 2019 15:27:33 +0100 Subject: Call TPKs Certificates, update identifiers, documentation. - Fixes #387. --- openpgp-ffi/include/sequoia/openpgp.h | 244 ++++++++++++------------ openpgp-ffi/include/sequoia/openpgp/error.h | 8 +- openpgp-ffi/include/sequoia/openpgp/serialize.h | 4 +- openpgp-ffi/include/sequoia/openpgp/types.h | 44 ++--- 4 files changed, 150 insertions(+), 150 deletions(-) (limited to 'openpgp-ffi/include') diff --git a/openpgp-ffi/include/sequoia/openpgp.h b/openpgp-ffi/include/sequoia/openpgp.h index 6f7be6d1..b169f78f 100644 --- a/openpgp-ffi/include/sequoia/openpgp.h +++ b/openpgp-ffi/include/sequoia/openpgp.h @@ -585,7 +585,7 @@ pgp_packet_t pgp_literal_into_packet (pgp_literal_t literal); /*/ void pgp_literal_free (pgp_literal_t literal); -/* openpgp::tpk::UserIDBinding. */ +/* openpgp::cert::UserIDBinding. */ /*/ /// Returns the user id. @@ -603,7 +603,7 @@ char *pgp_user_id_binding_user_id (pgp_user_id_binding_t binding); /*/ pgp_signature_t pgp_user_id_binding_selfsig(pgp_user_id_binding_t binding); -/* openpgp::tpk::UserIDBindingIter. */ +/* openpgp::cert::UserIDBindingIter. */ /*/ /// Returns the next element in the iterator. @@ -615,7 +615,7 @@ pgp_user_id_binding_t pgp_user_id_binding_iter_next (pgp_user_id_binding_iter_t /*/ void pgp_user_id_binding_iter_free (pgp_user_id_binding_iter_t iter); -/* openpgp::tpk::KeyIter. */ +/* openpgp::cert::KeyIter. */ /*/ /// Changes the iterator to only return keys that are certification @@ -628,7 +628,7 @@ void pgp_user_id_binding_iter_free (pgp_user_id_binding_iter_t iter); /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_certification_capable (pgp_tpk_key_iter_t iter); +void pgp_cert_key_iter_certification_capable (pgp_cert_key_iter_t iter); /*/ /// Changes the iterator to only return keys that are certification @@ -641,7 +641,7 @@ void pgp_tpk_key_iter_certification_capable (pgp_tpk_key_iter_t iter); /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_signing_capable (pgp_tpk_key_iter_t iter); +void pgp_cert_key_iter_signing_capable (pgp_cert_key_iter_t iter); /*/ /// Changes the iterator to only return keys that are capable of @@ -654,7 +654,7 @@ void pgp_tpk_key_iter_signing_capable (pgp_tpk_key_iter_t iter); /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_encrypting_capable_at_rest (pgp_tpk_key_iter_t); +void pgp_cert_key_iter_encrypting_capable_at_rest (pgp_cert_key_iter_t); /*/ /// Changes the iterator to only return keys that are capable of @@ -667,28 +667,28 @@ void pgp_tpk_key_iter_encrypting_capable_at_rest (pgp_tpk_key_iter_t); /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_encrypting_capable_for_transport (pgp_tpk_key_iter_t); +void pgp_cert_key_iter_encrypting_capable_for_transport (pgp_cert_key_iter_t); /*/ /// Changes the iterator to only return keys that are alive. /// -/// If you call this function (or `pgp_tpk_key_iter_alive_at`), only +/// If you call this function (or `pgp_cert_key_iter_alive_at`), only /// the last value is used. /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_alive (pgp_tpk_key_iter_t iter); +void pgp_cert_key_iter_alive (pgp_cert_key_iter_t iter); /*/ /// Changes the iterator to only return keys that are alive at the /// specified time. /// -/// If you call this function (or `pgp_tpk_key_iter_alive`), only the +/// If you call this function (or `pgp_cert_key_iter_alive`), only the /// last value is used. /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_alive_at (pgp_tpk_key_iter_t iter, time_t when); +void pgp_cert_key_iter_alive_at (pgp_cert_key_iter_t iter, time_t when); /*/ /// Changes the iterator to only return keys whose revocation status @@ -696,14 +696,14 @@ void pgp_tpk_key_iter_alive_at (pgp_tpk_key_iter_t iter, time_t when); /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_revoked (pgp_tpk_key_iter_t iter, bool revoked); +void pgp_cert_key_iter_revoked (pgp_cert_key_iter_t iter, bool revoked); /*/ /// Changes the iterator to only return keys that have secret keys. /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_secret (pgp_tpk_key_iter_t iter); +void pgp_cert_key_iter_secret (pgp_cert_key_iter_t iter); /*/ /// Changes the iterator to only return keys that have unencrypted @@ -711,7 +711,7 @@ void pgp_tpk_key_iter_secret (pgp_tpk_key_iter_t iter); /// /// Note: you may not call this function after starting to iterate. /*/ -void pgp_tpk_key_iter_unencrypted_secret (pgp_tpk_key_iter_t iter); +void pgp_cert_key_iter_unencrypted_secret (pgp_cert_key_iter_t iter); /*/ /// Returns a reference to the next key. Returns NULL if there are no @@ -725,117 +725,117 @@ void pgp_tpk_key_iter_unencrypted_secret (pgp_tpk_key_iter_t iter); /// If rev is not NULL, this stores the key's revocation status in /// *rev. /*/ -pgp_key_t pgp_tpk_key_iter_next (pgp_tpk_key_iter_t iter, +pgp_key_t pgp_cert_key_iter_next (pgp_cert_key_iter_t iter, pgp_signature_t *signature, pgp_revocation_status_t *rev); /*/ -/// Frees an pgp_tpk_key_iter_t. +/// Frees an pgp_cert_key_iter_t. /*/ -void pgp_tpk_key_iter_free (pgp_tpk_key_iter_t iter); +void pgp_cert_key_iter_free (pgp_cert_key_iter_t iter); -/* openpgp::tpk. */ +/* openpgp::cert. */ /*/ -/// Returns the first TPK encountered in the reader. +/// Returns the first Cert encountered in the reader. /*/ -pgp_tpk_t pgp_tpk_from_reader (pgp_error_t *errp, +pgp_cert_t pgp_cert_from_reader (pgp_error_t *errp, pgp_reader_t reader); /*/ -/// Returns the first TPK encountered in the file. +/// Returns the first Cert encountered in the file. /*/ -pgp_tpk_t pgp_tpk_from_file (pgp_error_t *errp, +pgp_cert_t pgp_cert_from_file (pgp_error_t *errp, const char *filename); /*/ -/// Returns the first TPK found in `m`. +/// Returns the first Cert found in `m`. /// /// Consumes `m`. /*/ -pgp_tpk_t pgp_tpk_from_packet_pile (pgp_error_t *errp, +pgp_cert_t pgp_cert_from_packet_pile (pgp_error_t *errp, pgp_packet_pile_t m); /*/ -/// Returns the first TPK found in `buf`. +/// Returns the first Cert found in `buf`. /// -/// `buf` must be an OpenPGP-encoded TPK. +/// `buf` must be an OpenPGP-encoded Cert. /*/ -pgp_tpk_t pgp_tpk_from_bytes (pgp_error_t *errp, +pgp_cert_t pgp_cert_from_bytes (pgp_error_t *errp, const uint8_t *b, size_t len); /*/ -/// Returns the first TPK found in the packet parser. +/// Returns the first Cert found in the packet parser. /// /// Consumes the packet parser result. /*/ -pgp_tpk_t pgp_tpk_from_packet_parser (pgp_error_t *errp, +pgp_cert_t pgp_cert_from_packet_parser (pgp_error_t *errp, pgp_packet_parser_result_t ppr); /*/ -/// Frees the TPK. +/// Frees the Cert. /*/ -void pgp_tpk_free (pgp_tpk_t tpk); +void pgp_cert_free (pgp_cert_t cert); /*/ -/// Clones the TPK. +/// Clones the Cert. /*/ -pgp_tpk_t pgp_tpk_clone (pgp_tpk_t tpk); +pgp_cert_t pgp_cert_clone (pgp_cert_t cert); /*/ -/// Compares TPKs. +/// Compares Certs. /*/ -int pgp_tpk_equal (const pgp_tpk_t a, const pgp_tpk_t b); +int pgp_cert_equal (const pgp_cert_t a, const pgp_cert_t b); /*/ /// Returns a human readable description of this object intended for /// communication with end users. /*/ -char *pgp_tpk_to_string (const pgp_tpk_t fp); +char *pgp_cert_to_string (const pgp_cert_t fp); /*/ /// Returns a human readable description of this object suitable for /// debugging. /*/ -char *pgp_tpk_debug (const pgp_tpk_t tpk); +char *pgp_cert_debug (const pgp_cert_t cert); /*/ -/// Serializes the TPK. +/// Serializes the Cert. /*/ -pgp_status_t pgp_tpk_serialize (pgp_error_t *errp, - const pgp_tpk_t tpk, +pgp_status_t pgp_cert_serialize (pgp_error_t *errp, + const pgp_cert_t cert, pgp_writer_t writer); /*/ -/// Merges `other` into `tpk`. +/// Merges `other` into `cert`. /// /// If `other` is a different key, then nothing is merged into -/// `tpk`, but `tpk` is still canonicalized. +/// `cert`, but `cert` is still canonicalized. /// -/// Consumes `tpk` and `other`. +/// Consumes `cert` and `other`. /*/ -pgp_tpk_t pgp_tpk_merge (pgp_error_t *errp, - pgp_tpk_t tpk, - pgp_tpk_t other); +pgp_cert_t pgp_cert_merge (pgp_error_t *errp, + pgp_cert_t cert, + pgp_cert_t other); /*/ -/// Adds packets to the TPK. +/// Adds packets to the Cert. /// -/// This recanonicalizes the TPK. If the packets are invalid, they +/// This recanonicalizes the Cert. If the packets are invalid, they /// are dropped. /// -/// Consumes `tpk` and the packets in `packets`. The buffer, however, +/// Consumes `cert` and the packets in `packets`. The buffer, however, /// must be freed by the caller. /*/ -pgp_tpk_t pgp_tpk_merge_packets (pgp_error_t *errp, - pgp_tpk_t tpk, +pgp_cert_t pgp_cert_merge_packets (pgp_error_t *errp, + pgp_cert_t cert, pgp_packet_t *packets, size_t packets_len); /*/ /// Returns the fingerprint. /*/ -pgp_fingerprint_t pgp_tpk_fingerprint (const pgp_tpk_t tpk); +pgp_fingerprint_t pgp_cert_fingerprint (const pgp_cert_t cert); /*/ @@ -843,91 +843,91 @@ pgp_fingerprint_t pgp_tpk_fingerprint (const pgp_tpk_t tpk); /// /// This object writes out secret keys during serialization. /// -/// [`TSK`]: tpk/struct.TSK.html +/// [`TSK`]: cert/struct.TSK.html /*/ -pgp_tsk_t pgp_tpk_as_tsk (pgp_tpk_t tpk); +pgp_tsk_t pgp_cert_as_tsk (pgp_cert_t cert); /*/ -/// Returns a reference to the TPK's primary key. +/// Returns a reference to the Cert's primary key. /// -/// The tpk still owns the key. The caller should neither modify nor +/// The cert still owns the key. The caller should neither modify nor /// free the key. /*/ -pgp_key_t pgp_tpk_primary_key (pgp_tpk_t tpk); +pgp_key_t pgp_cert_primary_key (pgp_cert_t cert); /*/ -/// Returns the TPK's revocation status at the specified time. +/// Returns the Cert's revocation status at the specified time. /// -/// Note: this only returns whether the TPK has been revoked, and does +/// Note: this only returns whether the Cert has been revoked, and does /// not reflect whether an individual user id, user attribute or /// subkey has been revoked. /// -/// If `when` is 0, then returns the TPK's revocation status as of the +/// If `when` is 0, then returns the Cert's revocation status as of the /// time of the call. /*/ -pgp_revocation_status_t pgp_tpk_revoked (pgp_tpk_t tpk, time_t when); +pgp_revocation_status_t pgp_cert_revoked (pgp_cert_t cert, time_t when); /*/ /// Writes a revocation certificate to the writer. /// -/// This function consumes the writer. It does *not* consume tpk. +/// This function consumes the writer. It does *not* consume cert. /*/ -pgp_signature_t pgp_tpk_revoke (pgp_error_t *errp, - pgp_tpk_t tpk, +pgp_signature_t pgp_cert_revoke (pgp_error_t *errp, + pgp_cert_t cert, pgp_signer_t primary_signer, pgp_reason_for_revocation_t code, const char *reason); /*/ -/// Adds a revocation certificate to the tpk. +/// Adds a revocation certificate to the cert. /// -/// This function consumes the tpk. +/// This function consumes the cert. /*/ -pgp_tpk_t pgp_tpk_revoke_in_place (pgp_error_t *errp, - pgp_tpk_t tpk, +pgp_cert_t pgp_cert_revoke_in_place (pgp_error_t *errp, + pgp_cert_t cert, pgp_signer_t primary_signer, pgp_reason_for_revocation_t code, const char *reason); /*/ -/// Returns whether the TPK has expired. +/// Returns whether the Cert has expired. /// /// If `when` is 0, then the current time is used. /*/ -int pgp_tpk_expired(pgp_tpk_t tpk, time_t at); +int pgp_cert_expired(pgp_cert_t cert, time_t at); /*/ -/// Returns whether the TPK is alive at the specified time. +/// Returns whether the Cert is alive at the specified time. /// /// If `when` is 0, then the current time is used. /*/ -int pgp_tpk_alive(pgp_tpk_t tpk, time_t when); +int pgp_cert_alive(pgp_cert_t cert, time_t when); /*/ -/// Changes the TPK's expiration. +/// Changes the Cert's expiration. /// /// Expiry is when the key should expire in seconds relative to the /// key's creation (not the current time). /// -/// This function consumes `tpk` and returns a new `TPK`. +/// This function consumes `cert` and returns a new `Cert`. /*/ -pgp_tpk_t pgp_tpk_set_expiry(pgp_error_t *errp, - pgp_tpk_t tpk, +pgp_cert_t pgp_cert_set_expiry(pgp_error_t *errp, + pgp_cert_t cert, pgp_signer_t signer, uint32_t expiry); /*/ -/// Returns whether the TPK includes any secret key material. +/// Returns whether the Cert includes any secret key material. /*/ -int pgp_tpk_is_tsk(pgp_tpk_t tpk); +int pgp_cert_is_tsk(pgp_cert_t cert); /*/ /// Returns an iterator over the `UserIDBinding`s. /*/ -pgp_user_id_binding_iter_t pgp_tpk_user_id_binding_iter (pgp_tpk_t tpk); +pgp_user_id_binding_iter_t pgp_cert_user_id_binding_iter (pgp_cert_t cert); /*/ -/// Returns an iterator over all `Key`s in a TPK. +/// Returns an iterator over all `Key`s in a Cert. /// /// That is, this returns an iterator over the primary key and any /// subkeys, along with the corresponding signatures. @@ -937,71 +937,71 @@ pgp_user_id_binding_iter_t pgp_tpk_user_id_binding_iter (pgp_tpk_t tpk); /// has no binding signature, the signature carrying the primary key's /// key flags is returned (either a direct key signature, or the /// self-signature on the primary User ID). There are corner cases -/// where no such signature exists (e.g. partial TPKs), therefore this +/// where no such signature exists (e.g. partial Certs), therefore this /// iterator may return `None` for the primary key's signature. /// /// A valid `Key` has at least one good self-signature. /// -/// Compare with `pgp_tpk_key_iter_valid`, which filters out expired and +/// Compare with `pgp_cert_key_iter_valid`, which filters out expired and /// revoked keys. /*/ -pgp_tpk_key_iter_t pgp_tpk_key_iter_all (pgp_tpk_t tpk); +pgp_cert_key_iter_t pgp_cert_key_iter_all (pgp_cert_t cert); /*/ -/// Returns an iterator over the live and unrevoked `Key`s in a TPK. +/// Returns an iterator over the live and unrevoked `Key`s in a Cert. /// -/// Compare with `pgp_tpk_key_iter_all`, which doesn't filter out +/// Compare with `pgp_cert_key_iter_all`, which doesn't filter out /// expired and revoked keys by default. /*/ -pgp_tpk_key_iter_t pgp_tpk_key_iter_valid (pgp_tpk_t tpk); +pgp_cert_key_iter_t pgp_cert_key_iter_valid (pgp_cert_t cert); /*/ -/// Returns the TPK's primary user id (if any). +/// Returns the Cert's primary user id (if any). /*/ -char *pgp_tpk_primary_user_id(pgp_tpk_t tpk); +char *pgp_cert_primary_user_id(pgp_cert_t cert); /*/ -/// Returns a TPKParser. +/// Returns a CertParser. /// -/// A TPK parser parses a keyring, which is simply zero or more TPKs +/// A Cert parser parses a keyring, which is simply zero or more Certs /// concatenated together. /*/ -pgp_tpk_parser_t pgp_tpk_parser_from_bytes(pgp_error_t *errp, +pgp_cert_parser_t pgp_cert_parser_from_bytes(pgp_error_t *errp, char *buf, size_t len); /*/ -/// Returns a TPKParser. +/// Returns a CertParser. /// -/// A TPK parser parses a keyring, which is simply zero or more TPKs +/// A Cert parser parses a keyring, which is simply zero or more Certs /// concatenated together. /*/ -pgp_tpk_parser_t pgp_tpk_parser_from_packet_parser(pgp_packet_parser_result_t ppr); +pgp_cert_parser_t pgp_cert_parser_from_packet_parser(pgp_packet_parser_result_t ppr); /*/ -/// Returns the next TPK, if any. +/// Returns the next Cert, if any. /// -/// If there is an error parsing the TPK, it is returned in *errp. +/// If there is an error parsing the Cert, it is returned in *errp. /// /// If this function returns NULL and does not set *errp, then the end /// of the file was reached. /*/ -pgp_tpk_t pgp_tpk_parser_next(pgp_error_t *errp, pgp_tpk_parser_t parser); +pgp_cert_t pgp_cert_parser_next(pgp_error_t *errp, pgp_cert_parser_t parser); /*/ -/// Frees an pgp_tpk_key_iter_t. +/// Frees an pgp_cert_key_iter_t. /*/ -void pgp_tpk_parser_free (pgp_tpk_parser_t parser); +void pgp_cert_parser_free (pgp_cert_parser_t parser); -/* TPKBuilder */ +/* CertBuilder */ /*/ -/// Creates a new `pgp_tpk_builder_t`. +/// Creates a new `pgp_cert_builder_t`. /// -/// The returned TPKBuilder is setup to only create a +/// The returned CertBuilder is setup to only create a /// certification-capable primary key using the default cipher suite. /// You'll almost certainly want to add subkeys, and user ids. /*/ -pgp_tpk_builder_t pgp_tpk_builder_new(void); +pgp_cert_builder_t pgp_cert_builder_new(void); /*/ /// Generates a general-purpose key. @@ -1009,7 +1009,7 @@ pgp_tpk_builder_t pgp_tpk_builder_new(void); /// The key's primary key is certification- and signature-capable. /// The key has one subkey, an encryption-capable subkey. /*/ -pgp_tpk_builder_t pgp_tpk_builder_general_purpose(pgp_tpk_cipher_suite_t cs, +pgp_cert_builder_t pgp_cert_builder_general_purpose(pgp_cert_cipher_suite_t cs, const char *uid); /*/ @@ -1017,49 +1017,49 @@ pgp_tpk_builder_t pgp_tpk_builder_general_purpose(pgp_tpk_cipher_suite_t cs, /// /// [Autocrypt Level 1]: https://autocrypt.org/level1.html /*/ -pgp_tpk_builder_t pgp_tpk_builder_autocrypt(const char *uid); +pgp_cert_builder_t pgp_cert_builder_autocrypt(const char *uid); /*/ -/// Frees an `pgp_tpk_builder_t`. +/// Frees an `pgp_cert_builder_t`. /*/ -void pgp_tpk_builder_free(pgp_tpk_builder_t tpkb); +void pgp_cert_builder_free(pgp_cert_builder_t certb); /*/ /// Sets the encryption and signature algorithms for primary and all /// subkeys. /*/ -void pgp_tpk_builder_set_cipher_suite(pgp_tpk_builder_t *tpkb, - pgp_tpk_cipher_suite_t cs); +void pgp_cert_builder_set_cipher_suite(pgp_cert_builder_t *certb, + pgp_cert_cipher_suite_t cs); /*/ /// Adds a new user ID. The first user ID added replaces the default /// ID that is just the empty string. /*/ -void pgp_tpk_builder_add_userid(pgp_tpk_builder_t *tpkb, const char *uid); +void pgp_cert_builder_add_userid(pgp_cert_builder_t *certb, const char *uid); /*/ /// Adds a signing capable subkey. /*/ -void pgp_tpk_builder_add_signing_subkey(pgp_tpk_builder_t *tpkb); +void pgp_cert_builder_add_signing_subkey(pgp_cert_builder_t *certb); /*/ /// Adds an encryption capable subkey. /*/ -void pgp_tpk_builder_add_encryption_subkey(pgp_tpk_builder_t *tpkb); +void pgp_cert_builder_add_encryption_subkey(pgp_cert_builder_t *certb); /*/ /// Adds an certification capable subkey. /*/ -void pgp_tpk_builder_add_certification_subkey(pgp_tpk_builder_t *tpkb); +void pgp_cert_builder_add_certification_subkey(pgp_cert_builder_t *certb); /*/ -/// Generates the actual TPK. +/// Generates the actual Cert. /// -/// Consumes `tpkb`. +/// Consumes `certb`. /*/ -pgp_status_t pgp_tpk_builder_generate(pgp_error_t *errp, - pgp_tpk_builder_t tpkb, - pgp_tpk_t *tpk, +pgp_status_t pgp_cert_builder_generate(pgp_error_t *errp, + pgp_cert_builder_t certb, + pgp_cert_t *cert, pgp_signature_t *revocation); @@ -1629,7 +1629,7 @@ pgp_writer_stack_t pgp_literal_writer_new (pgp_error_t *errp, /// /// The stream will be encrypted using a generated session key, /// which will be encrypted using the given passwords, and all -/// encryption-capable subkeys of the given TPKs. +/// encryption-capable subkeys of the given Certs. /*/ pgp_writer_stack_t pgp_encryptor_new (pgp_error_t *errp, pgp_writer_stack_t inner, @@ -1717,13 +1717,13 @@ pgp_verification_result_variant_t pgp_verification_result_variant ( /*/ bool pgp_verification_result_good_checksum (pgp_verification_result_t, pgp_signature_t *, - pgp_tpk_t *, + pgp_cert_t *, pgp_key_t *, pgp_signature_t *, pgp_revocation_status_t *); bool pgp_verification_result_not_alive (pgp_verification_result_t, pgp_signature_t *, - pgp_tpk_t *, + pgp_cert_t *, pgp_key_t *, pgp_signature_t *, pgp_revocation_status_t *); @@ -1731,7 +1731,7 @@ bool pgp_verification_result_missing_key (pgp_verification_result_t, pgp_signature_t *); bool pgp_verification_result_bad_checksum (pgp_verification_result_t, pgp_signature_t *, - pgp_tpk_t *, + pgp_cert_t *, pgp_key_t *, pgp_signature_t *, pgp_revocation_status_t *); diff --git a/openpgp-ffi/include/sequoia/openpgp/error.h b/openpgp-ffi/include/sequoia/openpgp/error.h index 0691e178..accd24ab 100644 --- a/openpgp-ffi/include/sequoia/openpgp/error.h +++ b/openpgp-ffi/include/sequoia/openpgp/error.h @@ -103,9 +103,9 @@ typedef enum pgp_status { PGP_STATUS_MISSING_SESSION_KEY = -27, /*/ - /// Malformed TPK. + /// Malformed Cert. /*/ - PGP_STATUS_MALFORMED_TPK = -13, + PGP_STATUS_MALFORMED_Cert = -13, /*/ /// Bad signature. @@ -128,9 +128,9 @@ typedef enum pgp_status { PGP_STATUS_INDEX_OUT_OF_RANGE = -23, /*/ - /// TPK not supported. + /// Cert not supported. /*/ - PGP_STATUS_UNSUPPORTED_TPK = -24, + PGP_STATUS_UNSUPPORTED_Cert = -24, /* Dummy value to make sure the enumeration has a defined size. Do not use this value. */ diff --git a/openpgp-ffi/include/sequoia/openpgp/serialize.h b/openpgp-ffi/include/sequoia/openpgp/serialize.h index 7d41d9b0..09d62c95 100644 --- a/openpgp-ffi/include/sequoia/openpgp/serialize.h +++ b/openpgp-ffi/include/sequoia/openpgp/serialize.h @@ -30,11 +30,11 @@ pgp_keyid_t pgp_recipient_keyid (const pgp_recipient_t); void pgp_recipient_set_keyid (pgp_recipient_t, pgp_keyid_t); /*/ -/// Collects recipients from a `pgp_tpk_key_iter_t`. +/// Collects recipients from a `pgp_cert_key_iter_t`. /// /// Consumes the iterator. The returned buffer must be freed using /// libc's allocator. /*/ -pgp_recipient_t *pgp_recipients_from_key_iter (pgp_tpk_key_iter_t, size_t *); +pgp_recipient_t *pgp_recipients_from_key_iter (pgp_cert_key_iter_t, size_t *); #endif diff --git a/openpgp-ffi/include/sequoia/openpgp/types.h b/openpgp-ffi/include/sequoia/openpgp/types.h index f16c5923..c0b3bbd7 100644 --- a/openpgp-ffi/include/sequoia/openpgp/types.h +++ b/openpgp-ffi/include/sequoia/openpgp/types.h @@ -42,7 +42,7 @@ typedef enum pgp_armor_kind { PGP_ARMOR_KIND_MESSAGE, /*/ - /// A transferable public key. + /// A certificate. /*/ PGP_ARMOR_KIND_PUBLICKEY, @@ -374,28 +374,28 @@ typedef struct pgp_user_id_binding *pgp_user_id_binding_t; typedef struct pgp_user_id_binding_iter *pgp_user_id_binding_iter_t; /*/ -/// An iterator over keys in a TPK. +/// An iterator over keys in a Cert. /*/ -typedef struct pgp_tpk_key_iter *pgp_tpk_key_iter_t; +typedef struct pgp_cert_key_iter *pgp_cert_key_iter_t; /*/ -/// A transferable public key (TPK). +/// An OpenPGP Certificate. /// -/// A TPK (see [RFC 4880, section 11.1]) can be used to verify +/// A Certificate (see [RFC 4880, section 11.1]) can be used to verify /// signatures and encrypt data. It can be stored in a keystore and /// uploaded to keyservers. /// /// [RFC 4880, section 11.1]: https://tools.ietf.org/html/rfc4880#section-11.1 /*/ -typedef struct pgp_tpk *pgp_tpk_t; +typedef struct pgp_cert *pgp_cert_t; /*/ -/// A parser for TPKs +/// A parser for Certs /// -/// A `TPKParser` parses a keyring, which is simply zero or more -/// binary TPKs concatenated together. +/// A `CertParser` parses a keyring, which is simply zero or more +/// binary Certs concatenated together. /*/ -typedef struct pgp_tpk_parser *pgp_tpk_parser_t; +typedef struct pgp_cert_parser *pgp_cert_parser_t; /*/ /// A transferable secret key (TSK). @@ -408,48 +408,48 @@ typedef struct pgp_tpk_parser *pgp_tpk_parser_t; typedef struct pgp_tsk *pgp_tsk_t; -typedef enum pgp_tpk_cipher_suite { +typedef enum pgp_cert_cipher_suite { /*/ /// EdDSA and ECDH over Curve25519 with SHA512 and AES256. /*/ - PGP_TPK_CIPHER_SUITE_CV25519, + PGP_CERT_CIPHER_SUITE_CV25519, /*/ /// 3072 bit RSA with SHA512 and AES256. /*/ - PGP_TPK_CIPHER_SUITE_RSA3K, + PGP_CERT_CIPHER_SUITE_RSA3K, /*/ /// EdDSA and ECDH over NIST P-256 with SHA256 and AES256 /*/ - PGP_TPK_CIPHER_SUITE_P256, + PGP_CERT_CIPHER_SUITE_P256, /*/ /// EdDSA and ECDH over NIST P-384 with SHA384 and AES256 /*/ - PGP_TPK_CIPHER_SUITE_P384, + PGP_CERT_CIPHER_SUITE_P384, /*/ /// EdDSA and ECDH over NIST P-521 with SHA512 and AES256 /*/ - PGP_TPK_CIPHER_SUITE_P521, + PGP_CERT_CIPHER_SUITE_P521, /*/ /// 2048 bit RSA with SHA512 and AES256. /*/ - PGP_TPK_CIPHER_SUITE_RSA2K, + PGP_CERT_CIPHER_SUITE_RSA2K, /*/ /// 4096 bit RSA with SHA512 and AES256. /*/ - PGP_TPK_CIPHER_SUITE_RSA4K, + PGP_CERT_CIPHER_SUITE_RSA4K, /* Dummy value to make sure the enumeration has a defined size. Do not use this value. */ - PGP_TPK_CIPHER_SUITE_FORCE_WIDTH = INT_MAX, -} pgp_tpk_cipher_suite_t; + PGP_CERT_CIPHER_SUITE_FORCE_WIDTH = INT_MAX, +} pgp_cert_cipher_suite_t; -typedef struct pgp_tpk_builder *pgp_tpk_builder_t; +typedef struct pgp_cert_builder *pgp_cert_builder_t; typedef struct pgp_writer_stack *pgp_writer_stack_t; @@ -494,7 +494,7 @@ typedef enum pgp_verification_result_variant { typedef pgp_status_t (*pgp_decryptor_get_public_keys_cb_t) (void *, pgp_keyid_t *, size_t, - pgp_tpk_t **, size_t *, + pgp_cert_t **, size_t *, void (**free)(void *)); typedef pgp_status_t (pgp_decryptor_do_decrypt_cb_t) ( -- cgit v1.2.3