|
|
@ -240,21 +240,24 @@ namespace cryptoki { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
Object Session::create(const openssl::X509& cert) { |
|
|
|
Object Session::create(const std::string& label, const openssl::X509& cert) { |
|
|
|
AttributeList attrs; |
|
|
|
AttributeList attrs; |
|
|
|
attrs.push_back(Attribute(CKA_CLASS) |
|
|
|
attrs.push_back(Attribute(CKA_CLASS) |
|
|
|
.from<CK_OBJECT_CLASS>(CKO_CERTIFICATE)); |
|
|
|
.from<CK_OBJECT_CLASS>(CKO_CERTIFICATE)); |
|
|
|
attrs.push_back(Attribute(CKA_CERTIFICATE_TYPE) |
|
|
|
attrs.push_back(Attribute(CKA_CERTIFICATE_TYPE) |
|
|
|
.from<CK_CERTIFICATE_TYPE>(CKC_X_509)); |
|
|
|
.from<CK_CERTIFICATE_TYPE>(CKC_X_509)); |
|
|
|
|
|
|
|
attrs.push_back(Attribute(CKA_LABEL, label)); |
|
|
|
attrs.push_back(Attribute(CKA_SUBJECT, cert.subjectDER())); |
|
|
|
attrs.push_back(Attribute(CKA_SUBJECT, cert.subjectDER())); |
|
|
|
attrs.push_back(Attribute(CKA_VALUE, cert.valueDER())); |
|
|
|
attrs.push_back(Attribute(CKA_VALUE, cert.valueDER())); |
|
|
|
return create(attrs); |
|
|
|
return create(attrs); |
|
|
|
} |
|
|
|
} |
|
|
|
Object Session::create(const openssl::PrivateKey& key) { |
|
|
|
Object Session::create(const std::string& label, |
|
|
|
|
|
|
|
const openssl::PrivateKey& key) { |
|
|
|
AttributeList attrs; |
|
|
|
AttributeList attrs; |
|
|
|
return create(attrs); |
|
|
|
return create(attrs); |
|
|
|
} |
|
|
|
} |
|
|
|
Object Session::create(const openssl::PKCS12& p12) { |
|
|
|
Object Session::create(const std::string& label, |
|
|
|
|
|
|
|
const openssl::PKCS12& p12) { |
|
|
|
AttributeList attrs; |
|
|
|
AttributeList attrs; |
|
|
|
return create(attrs); |
|
|
|
return create(attrs); |
|
|
|
} |
|
|
|
} |
|
|
|