Botan 2.19.3
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 {
14namespace PKCS11 {
15
16X509_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
23PKCS11_X509_Certificate::PKCS11_X509_Certificate(Session& session, ObjectHandle handle)
24 : Object(session, handle), X509_Certificate(unlock(get_attribute_value(AttributeType::Value)))
25 {
26 }
27
28PKCS11_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
AttributeType
Definition p11.h:66
CertificateType
Definition p11.h:178
std::vector< T > unlock(const secure_vector< T > &in)
Definition secmem.h:72