Botan 3.4.0
Crypto and TLS for C&
p11_x509.cpp
Go to the documentation of this file.
1/*
2* PKCS#11 X.509
3* (C) 2016 Daniel Neus, Sirrix AG
4* (C) 2016 Philipp Weber, Sirrix AG
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#include <botan/p11_x509.h>
10
11#if defined(BOTAN_HAS_X509_CERTIFICATES)
12
13namespace Botan::PKCS11 {
14
15X509_CertificateProperties::X509_CertificateProperties(const std::vector<uint8_t>& subject,
16 const std::vector<uint8_t>& value) :
17 CertificateProperties(CertificateType::X509), m_subject(subject), m_value(value) {
18 add_binary(AttributeType::Subject, m_subject);
19 add_binary(AttributeType::Value, m_value);
20}
21
22PKCS11_X509_Certificate::PKCS11_X509_Certificate(Session& session, ObjectHandle handle) :
23 Object(session, handle), X509_Certificate(unlock(get_attribute_value(AttributeType::Value))) {}
24
25PKCS11_X509_Certificate::PKCS11_X509_Certificate(Session& session, const X509_CertificateProperties& props) :
26 Object(session, props), X509_Certificate(props.value()) {}
27
28} // namespace Botan::PKCS11
29
30#endif
AttributeType
Definition p11.h:61
CertificateType
Definition p11.h:172
std::vector< T > unlock(const secure_vector< T > &in)
Definition secmem.h:75