Botan  2.8.0
Crypto and TLS for C++11
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 
13 namespace Botan {
14 namespace PKCS11 {
15 
16 X509_CertificateProperties::X509_CertificateProperties(const std::vector<uint8_t>& subject, const std::vector<uint8_t>& value)
17  : CertificateProperties(CertificateType::X509), m_subject(subject), m_value(value)
18  {
19  add_binary(AttributeType::Subject, m_subject);
20  add_binary(AttributeType::Value, m_value);
21  }
22 
23 PKCS11_X509_Certificate::PKCS11_X509_Certificate(Session& session, ObjectHandle handle)
24  : Object(session, handle), X509_Certificate(unlock(get_attribute_value(AttributeType::Value)))
25  {
26  }
27 
28 PKCS11_X509_Certificate::PKCS11_X509_Certificate(Session& session, const X509_CertificateProperties& props)
29  : Object(session, props), X509_Certificate(props.value())
30  {
31  }
32 
33 }
34 
35 }
36 
37 #endif
CertificateType
Definition: p11.h:175
AttributeType
Definition: p11.h:63
Definition: alg_id.cpp:13
CK_OBJECT_HANDLE ObjectHandle
Definition: p11.h:846
std::vector< T > unlock(const secure_vector< T > &in)
Definition: secmem.h:95