|
Botan 3.11.0
Crypto and TLS for C&
|
#include <botan/ffi.h>#include <botan/assert.h>#include <botan/internal/ffi_cert.h>#include <botan/internal/ffi_pkey.h>#include <botan/internal/ffi_rng.h>#include <botan/internal/ffi_util.h>#include <memory>Go to the source code of this file.
| int botan_x509_cert_allowed_extended_usage_oid | ( | botan_x509_cert_t | cert, |
| botan_asn1_oid_t | oid ) |
Check if the certificate allows the specified extended usage OID. See RFC 5280 Section 4.2.1.12 for OIDs to query for this. If no extended key usage extension is found in the certificate, this always returns "not success".
This is similar to botan_x509_cert_allowed_extended_usage_str but takes an OID object instead of a string describing the OID.
Definition at line 584 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
| int botan_x509_cert_allowed_extended_usage_str | ( | botan_x509_cert_t | cert, |
| const char * | oid ) |
Check if the certificate allows the specified extended usage OID. See RFC 5280 Section 4.2.1.12 for OIDs to query for this. If no extended key usage extension is found in the certificate, this always returns "not success".
Typical OIDs to check for:
The oid parameter can be either a canonical OID string or identifiers as indicated in the examples above.
Definition at line 569 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_allowed_usage | ( | botan_x509_cert_t | cert, |
| unsigned int | key_usage ) |
Definition at line 554 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_destroy | ( | botan_x509_cert_t | cert | ) |
Definition at line 593 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_cert_dup | ( | botan_x509_cert_t * | cert_obj, |
| botan_x509_cert_t | cert ) |
Definition at line 186 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_cert_excluded_name_constraints | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | constraint ) |
Extracts "excluded" name constraints from a given cert one-by-one. Returns BOTAN_FFI_ERROR_OUT_OF_RANGE if the given index is larger than the available number of "excluded" name constraints.
Definition at line 824 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::NameConstraints::excluded(), Botan_FFI::ffi_new_object(), and Botan::X509_Certificate::name_constraints().
| int botan_x509_cert_excluded_name_constraints_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Definition at line 846 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_authority_key_id | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Definition at line 678 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
| int botan_x509_cert_get_fingerprint | ( | botan_x509_cert_t | cert, |
| const char * | hash, | ||
| uint8_t | out[], | ||
| size_t * | out_len ) |
Definition at line 665 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_issuer_dn | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t | index, | ||
| uint8_t | out[], | ||
| size_t * | out_len ) |
Enumerates the names of the given key in the issuer DN. If index is out of bounds, BOTAN_FFI_ERROR_BAD_PARAMETER is returned.
TODO(Botan4) use BOTAN_FFI_ERROR_OUT_OF_RANGE instead of BAD_PARAMETER TODO(Botan4) this should use char for the out param
Definition at line 473 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_issuer_dn_count | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t * | count ) |
Definition at line 491 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_path_length_constraint | ( | botan_x509_cert_t | cert, |
| size_t * | path_limit ) |
Retrieves the path length constraint from the certificate. If no such constraint is present, BOTAN_FFI_ERROR_NO_VALUE is returned.
Definition at line 435 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_public_key | ( | botan_x509_cert_t | cert, |
| botan_pubkey_t * | key ) |
Definition at line 455 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_cert_get_public_key_bits | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Definition at line 696 of file ffi_cert.cpp.
References botan_x509_cert_view_public_key_bits(), and Botan_FFI::copy_view_bin().
| int botan_x509_cert_get_serial_number | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Definition at line 640 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
| int botan_x509_cert_get_subject_dn | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t | index, | ||
| uint8_t | out[], | ||
| size_t * | out_len ) |
Enumerates the names of the given key in the subject DN. If index is out of bounds, BOTAN_FFI_ERROR_BAD_PARAMETER is returned.
TODO(Botan4) use BOTAN_FFI_ERROR_OUT_OF_RANGE instead of BAD_PARAMETER TODO(Botan4) this should use char for the out param
Definition at line 507 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_subject_dn_count | ( | botan_x509_cert_t | cert, |
| const char * | key, | ||
| size_t * | count ) |
Definition at line 525 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_get_subject_key_id | ( | botan_x509_cert_t | cert, |
| uint8_t | out[], | ||
| size_t * | out_len ) |
Definition at line 687 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_vec_output().
| int botan_x509_cert_get_time_expires | ( | botan_x509_cert_t | cert, |
| char | out[], | ||
| size_t * | out_len ) |
Definition at line 612 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_get_time_starts | ( | botan_x509_cert_t | cert, |
| char | out[], | ||
| size_t * | out_len ) |
Definition at line 602 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::write_str_output().
| int botan_x509_cert_hostname_match | ( | botan_x509_cert_t | cert, |
| const char * | hostname ) |
Check if the certificate matches the specified hostname via alternative name or CN match. RFC 5280 wildcards also supported.
Definition at line 937 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_is_ca | ( | botan_x509_cert_t | cert | ) |
Returns 1 iff the cert is a CA certificate
Definition at line 426 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_issuer_alternative_names | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | alt_name ) |
Provides access to all "issuer alternative names", where each entry is returned as a botan_x509_general_name_t. If the given index is not within range of the available entries, BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. If cert does not contain an IssuerAlternativeNames extension, BOTAN_FFI_ERROR_NO_VALUE is returned.
Definition at line 898 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::Extensions::extension_set(), Botan_FFI::ffi_new_object(), Botan::OID::from_string(), Botan::X509_Certificate::issuer_alt_name(), and Botan::X509_Certificate::v3_extensions().
| int botan_x509_cert_issuer_alternative_names_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Definition at line 923 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::X509_Certificate::issuer_alt_name().
| int botan_x509_cert_load | ( | botan_x509_cert_t * | cert_obj, |
| const uint8_t | cert_bits[], | ||
| size_t | cert_bits_len ) |
Definition at line 204 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_cert_load_file | ( | botan_x509_cert_t * | cert_obj, |
| const char * | cert_path ) |
Definition at line 169 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_cert_not_after | ( | botan_x509_cert_t | cert, |
| uint64_t * | time_since_epoch ) |
Definition at line 631 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_not_before | ( | botan_x509_cert_t | cert, |
| uint64_t * | time_since_epoch ) |
Definition at line 622 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_permitted_name_constraints | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | constraint ) |
Extracts "permitted" name constraints from a given cert one-by-one. Returns BOTAN_FFI_ERROR_OUT_OF_RANGE if the given index is larger than the available number of "permitted" name constraints.
Definition at line 789 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), Botan::X509_Certificate::name_constraints(), and Botan::NameConstraints::permitted().
| int botan_x509_cert_permitted_name_constraints_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Definition at line 811 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_cert_serial_number | ( | botan_x509_cert_t | cert, |
| botan_mp_t * | serial_number ) |
Definition at line 649 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), Botan::BigInt::from_bytes(), and Botan::X509_Certificate::serial_number().
| int botan_x509_cert_subject_alternative_names | ( | botan_x509_cert_t | cert, |
| size_t | index, | ||
| botan_x509_general_name_t * | alt_name ) |
Provides access to all "subject alternative names", where each entry is returned as a botan_x509_general_name_t. If the given index is not within range of the available entries, BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. If cert does not contain a SubjectAlternativeNames extension, BOTAN_FFI_ERROR_NO_VALUE is returned.
Definition at line 859 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::Extensions::extension_set(), Botan_FFI::ffi_new_object(), Botan::OID::from_string(), Botan::X509_Certificate::subject_alt_name(), and Botan::X509_Certificate::v3_extensions().
| int botan_x509_cert_subject_alternative_names_count | ( | botan_x509_cert_t | cert, |
| size_t * | count ) |
Definition at line 884 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::X509_Certificate::subject_alt_name().
| int botan_x509_cert_to_string | ( | botan_x509_cert_t | cert, |
| char | out[], | ||
| size_t * | out_len ) |
Definition at line 541 of file ffi_cert.cpp.
References botan_x509_cert_view_as_string(), and Botan_FFI::copy_view_str().
| const char * botan_x509_cert_validation_status | ( | int | code | ) |
Returns a pointer to a static character string explaining the status code, or else NULL if unknown.
Definition at line 1017 of file ffi_cert.cpp.
References Botan::to_string().
| int botan_x509_cert_verify | ( | int * | validation_result, |
| botan_x509_cert_t | cert, | ||
| const botan_x509_cert_t * | intermediates, | ||
| size_t | intermediates_len, | ||
| const botan_x509_cert_t * | trusted, | ||
| size_t | trusted_len, | ||
| const char * | trusted_path, | ||
| size_t | required_strength, | ||
| const char * | hostname, | ||
| uint64_t | reference_time ) |
Returns 0 if the validation was successful, 1 if validation failed, and negative on error. A status code with details is written to *validation_result
Intermediates or trusted lists can be null Trusted path can be null
Definition at line 950 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::UNSPECIFIED, and Botan::x509_path_validate().
| int botan_x509_cert_verify_with_crl | ( | int * | validation_result, |
| botan_x509_cert_t | cert, | ||
| const botan_x509_cert_t * | intermediates, | ||
| size_t | intermediates_len, | ||
| const botan_x509_cert_t * | trusted, | ||
| size_t | trusted_len, | ||
| const botan_x509_crl_t * | crls, | ||
| size_t | crls_len, | ||
| const char * | trusted_path, | ||
| size_t | required_strength, | ||
| const char * | hostname, | ||
| uint64_t | reference_time ) |
Different flavor of botan_x509_cert_verify, supports revocation lists. CRLs are passed as an array, same as intermediates and trusted CAs
Definition at line 1420 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::safe_get(), Botan::UNSPECIFIED, and Botan::x509_path_validate().
| int botan_x509_cert_view_as_string | ( | botan_x509_cert_t | cert, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
Definition at line 545 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
Referenced by botan_x509_cert_to_string().
| int botan_x509_cert_view_binary_values | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Retrieve a specific binary value from an X.509 certificate.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
cert does not provide the requested value_type at all or not in binary format. Definition at line 278 of file ffi_cert.cpp.
References Botan::X509_Certificate::authority_key_id(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, BOTAN_X509_TBS_DATA_BITS, Botan_FFI::invoke_view_callback(), Botan::X509_Certificate::raw_issuer_dn(), Botan::X509_Certificate::raw_subject_dn(), Botan::X509_Certificate::serial_number(), Botan::X509_Certificate::subject_key_id(), and Botan::X509_Certificate::subject_public_key_info().
Referenced by botan_x509_cert_view_binary_values_count().
| int botan_x509_cert_view_binary_values_count | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Definition at line 333 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_cert_view_binary_values().
| int botan_x509_cert_view_public_key_bits | ( | botan_x509_cert_t | cert, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Definition at line 700 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::invoke_view_callback().
Referenced by botan_x509_cert_get_public_key_bits().
| int botan_x509_cert_view_string_values | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
Retrieve a specific string value from an X.509 certificate.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
cert does not provide the requested value_type at all or not in string format. Definition at line 345 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, BOTAN_X509_TBS_DATA_BITS, Botan::Cert_Extension::CRL_Distribution_Points::distribution_points(), and Botan_FFI::invoke_view_callback().
Referenced by botan_x509_cert_view_string_values_count().
| int botan_x509_cert_view_string_values_count | ( | botan_x509_cert_t | cert, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Definition at line 414 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_cert_view_string_values().
| int botan_x509_crl_create | ( | botan_x509_crl_t * | crl_obj, |
| botan_rng_t | rng, | ||
| botan_x509_cert_t | ca_cert, | ||
| botan_privkey_t | ca_key, | ||
| uint64_t | issue_time, | ||
| uint32_t | next_update, | ||
| const char * | hash_fn, | ||
| const char * | padding ) |
Create a new CRL
| crl_obj | The newly created CRL |
| rng | a random number generator object |
| ca_cert | The CA Certificate the CRL belongs to |
| ca_key | The private key of that CA |
| issue_time | The time when the CRL becomes valid |
| next_update | The number of seconds after issue_time until the CRL expires |
| hash_fn | The hash function to use, may be null |
| padding | The padding to use, may be null |
Definition at line 1100 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_crl_destroy | ( | botan_x509_crl_t | crl | ) |
Definition at line 1190 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_crl_entries | ( | botan_x509_crl_t | crl, |
| size_t | index, | ||
| botan_x509_crl_entry_t * | entry ) |
Allows iterating all entries of the CRL.
| crl | the CRL whose entries should be listed |
| index | the index of the CRL entry to return |
| entry | an object handle containing the CRL entry data |
index is out of range of the CRL entry list. Definition at line 1320 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), and Botan::X509_CRL::get_revoked().
| int botan_x509_crl_entries_count | ( | botan_x509_crl_t | crl, |
| size_t * | count ) |
Definition at line 1340 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::X509_CRL::get_revoked().
| int botan_x509_crl_entry_create | ( | botan_x509_crl_entry_t * | entry, |
| botan_x509_cert_t | cert, | ||
| int | reason_code ) |
Create a new CRL entry that marks cert as revoked
| entry | The newly created CRL entry |
| cert | The certificate to mark as revoked |
| reason_code | The reason code for revocation |
Definition at line 1126 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_crl_entry_destroy | ( | botan_x509_crl_entry_t | entry | ) |
Definition at line 1353 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_crl_entry_reason | ( | botan_x509_crl_entry_t | entry, |
| int * | reason_code ) |
Return the revocation reason code for the given CRL entry. See botan_x509_crl_reason_code and RFC 5280 - 5.3.1 for possible reason codes.
Definition at line 1362 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan::CRL_Entry::reason_code().
| int botan_x509_crl_entry_revocation_date | ( | botan_x509_crl_entry_t | entry, |
| uint64_t * | time_since_epoch ) |
Return the revocation date for the given CRL entry as time since epoch in seconds.
Definition at line 1404 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan::CRL_Entry::expire_time(), and Botan::ASN1_Time::time_since_epoch().
| int botan_x509_crl_entry_serial_number | ( | botan_x509_crl_entry_t | entry, |
| botan_mp_t * | serial_number ) |
Return the serial number associated with the given CRL entry.
Definition at line 1378 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::ffi_new_object(), Botan::BigInt::from_bytes(), and Botan::CRL_Entry::serial_number().
| int botan_x509_crl_entry_view_serial_number | ( | botan_x509_crl_entry_t | entry, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
View the serial number associated with the given CRL entry.
Definition at line 1394 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, Botan_FFI::invoke_view_callback(), and Botan::CRL_Entry::serial_number().
| int botan_x509_crl_load | ( | botan_x509_crl_t * | crl_obj, |
| const uint8_t | crl_bits[], | ||
| size_t | crl_bits_len ) |
Definition at line 1047 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_crl_load_file | ( | botan_x509_crl_t * | crl_obj, |
| const char * | crl_path ) |
Definition at line 1030 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, Botan_FFI::ffi_guard_thunk(), and Botan_FFI::ffi_new_object().
| int botan_x509_crl_next_update | ( | botan_x509_crl_t | crl, |
| uint64_t * | time_since_epoch ) |
Definition at line 1079 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_crl_this_update | ( | botan_x509_crl_t | crl, |
| uint64_t * | time_since_epoch ) |
Definition at line 1064 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, and BOTAN_UNUSED.
| int botan_x509_crl_update | ( | botan_x509_crl_t * | crl_obj, |
| botan_x509_crl_t | last_crl, | ||
| botan_rng_t | rng, | ||
| botan_x509_cert_t | ca_cert, | ||
| botan_privkey_t | ca_key, | ||
| uint64_t | issue_time, | ||
| uint32_t | next_update, | ||
| const botan_x509_crl_entry_t * | new_entries, | ||
| size_t | new_entries_len, | ||
| const char * | hash_fn, | ||
| const char * | padding ) |
Update a CRL with new revoked entries. This does not modify the old crl, and instead creates a new one.
| crl_obj | The newly created CRL |
| last_crl | The CRL to update |
| rng | a random number generator object |
| ca_cert | The CA Certificate the CRL belongs to |
| ca_key | The private key of that CA |
| issue_time | The time when the CRL becomes valid |
| next_update | The number of seconds after issue_time until the CRL expires |
| new_entries | The entries to add to the CRL |
| new_entries_len | The number of entries |
| hash_fn | The hash function to use, may be null |
| padding | The padding to use, may be null |
Definition at line 1141 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_UNUSED, Botan_FFI::ffi_guard_thunk(), Botan_FFI::ffi_new_object(), and Botan_FFI::safe_get().
| int botan_x509_crl_verify_signature | ( | botan_x509_crl_t | crl, |
| botan_pubkey_t | key ) |
Definition at line 1181 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().
| int botan_x509_crl_view_binary_values | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Retrieve a specific binary value from an X.509 certificate revocation list.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
crl_obj does not provide the requested value_type at all or not in binary format. Definition at line 1199 of file ffi_cert.cpp.
References Botan::X509_CRL::authority_key_id(), BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_OUT_OF_RANGE, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, BOTAN_X509_TBS_DATA_BITS, Botan::X509_CRL::crl_number(), Botan::X509_DN::get_bits(), Botan_FFI::invoke_view_callback(), Botan::X509_CRL::issuer_dn(), Botan::ASN1::put_in_sequence(), and Botan::store_be().
Referenced by botan_x509_crl_view_binary_values_count().
| int botan_x509_crl_view_binary_values_count | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Definition at line 1251 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_crl_view_binary_values().
| int botan_x509_crl_view_string_values | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t | index, | ||
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
Retrieve a specific string value from an X.509 certificate revocation list.
For multi-values index allows enumerating the available entries, until BOTAN_FFI_ERROR_OUT_OF_RANGE is returned. For singleton values, an index of value "0" is expected.
crl_obj does not provide the requested value_type at all or not in string format. Definition at line 1263 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_BAD_PARAMETER, BOTAN_FFI_ERROR_NO_VALUE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_AUTHORITY_KEY_IDENTIFIER, BOTAN_X509_CA_ISSUERS_URLS, BOTAN_X509_CRL_DISTRIBUTION_URLS, BOTAN_X509_DER_ENCODING, BOTAN_X509_ISSUER_DN_BITS, BOTAN_X509_OCSP_RESPONDER_URLS, BOTAN_X509_PEM_ENCODING, BOTAN_X509_PUBLIC_KEY_PKCS8_BITS, BOTAN_X509_SERIAL_NUMBER, BOTAN_X509_SIGNATURE_BITS, BOTAN_X509_SIGNATURE_SCHEME_BITS, BOTAN_X509_SUBJECT_DN_BITS, BOTAN_X509_SUBJECT_KEY_IDENTIFIER, and BOTAN_X509_TBS_DATA_BITS.
Referenced by botan_x509_crl_view_string_values_count().
| int botan_x509_crl_view_string_values_count | ( | botan_x509_crl_t | crl_obj, |
| botan_x509_value_type | value_type, | ||
| size_t * | count ) |
Definition at line 1298 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_SUCCESS, BOTAN_UNUSED, and botan_x509_crl_view_string_values().
| int botan_x509_general_name_destroy | ( | botan_x509_general_name_t | name | ) |
Definition at line 780 of file ffi_cert.cpp.
References BOTAN_FFI_CHECKED_DELETE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, and BOTAN_UNUSED.
| int botan_x509_general_name_get_type | ( | botan_x509_general_name_t | name, |
| unsigned int * | type ) |
Provides the contained type of the name and returns BOTAN_FFI_SUCCESS if that type is supported and may be retrieved via the view functions below. Otherwise BOTAN_FFI_ERROR_INVALID_OBJECT_STATE is returned.
Definition at line 710 of file ffi_cert.cpp.
References Botan::any_null_pointers(), BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_ERROR_NULL_POINTER, BOTAN_FFI_SUCCESS, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_OTHER_NAME, and Botan::GeneralName::type_code().
| int botan_x509_general_name_view_binary_value | ( | botan_x509_general_name_t | name, |
| botan_view_ctx | ctx, | ||
| botan_view_bin_fn | view ) |
Views the name as a bit string or returns BOTAN_FFI_ERROR_INVALID_OBJECT_STATE if the contained GeneralName value cannot be represented as a binary string.
The types BOTAN_X509_DIRECTORY_NAME, BOTAN_X509_IP_ADDRESS may be viewed as "binary".
Definition at line 758 of file ffi_cert.cpp.
References Botan::GeneralName::binary_name(), BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_DIRECTORY_NAME, BOTAN_X509_IP_ADDRESS, Botan_FFI::invoke_view_callback(), and Botan::GeneralName::type_code().
| int botan_x509_general_name_view_string_value | ( | botan_x509_general_name_t | name, |
| botan_view_ctx | ctx, | ||
| botan_view_str_fn | view ) |
Views the name as a string or returns BOTAN_FFI_ERROR_INVALID_OBJECT_STATE if the contained GeneralName value cannot be represented as a string.
The types BOTAN_X509_EMAIL_ADDRESS, BOTAN_X509_DNS_NAME, BOTAN_X509_URI, BOTAN_X509_IP_ADDRESS may be viewed as "string".
Definition at line 735 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_INVALID_OBJECT_STATE, BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, BOTAN_X509_DNS_NAME, BOTAN_X509_EMAIL_ADDRESS, BOTAN_X509_IP_ADDRESS, BOTAN_X509_URI, Botan_FFI::invoke_view_callback(), Botan::GeneralName::name(), and Botan::GeneralName::type_code().
| int botan_x509_is_revoked | ( | botan_x509_crl_t | crl, |
| botan_x509_cert_t | cert ) |
Given a CRL and a certificate, check if the certificate is revoked on that particular CRL
Definition at line 1310 of file ffi_cert.cpp.
References BOTAN_FFI_ERROR_NOT_IMPLEMENTED, BOTAN_FFI_VISIT, BOTAN_UNUSED, and Botan_FFI::safe_get().