9#ifndef BOTAN_P11_X509_H_
10#define BOTAN_P11_X509_H_
12#include <botan/p11_object.h>
14#if defined(BOTAN_HAS_X509_CERTIFICATES)
16 #include <botan/x509cert.h>
30 X509_CertificateProperties(
const std::vector<uint8_t>& subject,
const std::vector<uint8_t>& value);
32 X509_CertificateProperties(
const X509_Certificate& cert) :
33 X509_CertificateProperties(cert.raw_subject_dn(), cert.
BER_encode()) {}
36 inline void set_id(
const std::vector<uint8_t>&
id) { add_binary(AttributeType::Id,
id); }
39 inline void set_issuer(
const std::vector<uint8_t>& issuer) { add_binary(AttributeType::Issuer, issuer); }
42 inline void set_serial(
const std::vector<uint8_t>& serial) { add_binary(AttributeType::SerialNumber, serial); }
45 inline void set_subject_pubkey_hash(
const std::vector<uint8_t>& hash) {
46 add_binary(AttributeType::HashOfSubjectPublicKey, hash);
50 inline void set_issuer_pubkey_hash(
const std::vector<uint8_t>& hash) {
51 add_binary(AttributeType::HashOfIssuerPublicKey, hash);
55 inline void set_hash_alg(MechanismType alg) {
56 add_numeric(AttributeType::NameHashAlgorithm,
static_cast<Ulong>(alg));
60 inline const std::vector<uint8_t>& subject()
const {
return m_subject; }
63 inline const std::vector<uint8_t>& value()
const {
return m_value; }
66 const std::vector<uint8_t> m_subject;
67 const std::vector<uint8_t> m_value;
72 public X509_Certificate {
81 PKCS11_X509_Certificate(Session& session, ObjectHandle handle);
88 PKCS11_X509_Certificate(Session& session,
const X509_CertificateProperties& props);
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
std::vector< uint8_t > BER_encode(const Private_Key &key, RandomNumberGenerator &rng, std::string_view pass, std::chrono::milliseconds msec, std::string_view pbe_algo)