libdigidocpp
digidoc::PKCS11SignerPrivate Class Reference
Collaboration diagram for digidoc::PKCS11SignerPrivate:
Collaboration graph

Public Member Functions

 PKCS11SignerPrivate ()
PKCS11Signer::PKCS11Cert createPKCS11Cert (CK_TOKEN_INFO *slot, const X509Cert &cert) const
bool attribute (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE obj, CK_ATTRIBUTE_TYPE type, CK_VOID_PTR value, CK_ULONG &size) const
std::vector< CK_OBJECT_HANDLE > findObject (CK_SESSION_HANDLE session, CK_OBJECT_CLASS cls) const
bool load (const std::string &driver)
void * resolve (const char *symbol)
void unload ()

Public Attributes

CK_FUNCTION_LISTf
void * h
SignSlot sign
CK_SLOT_ID_PTR slots
CK_ULONG numberOfSlots

Static Public Attributes

static const unsigned char sha1 []
static const unsigned char sha224 []
static const unsigned char sha256 []
static const unsigned char sha384 []
static const unsigned char sha512 []

Detailed Description

Definition at line 47 of file PKCS11Signer.cpp.

Constructor & Destructor Documentation

digidoc::PKCS11SignerPrivate::PKCS11SignerPrivate ( )
inline

Definition at line 50 of file PKCS11Signer.cpp.

References digidoc::SignSlot::cert, sign, and digidoc::SignSlot::slot.

Member Function Documentation

bool PKCS11SignerPrivate::attribute ( CK_SESSION_HANDLE  session,
CK_OBJECT_HANDLE  obj,
CK_ATTRIBUTE_TYPE  type,
CK_VOID_PTR  value,
CK_ULONG size 
) const

Definition at line 126 of file PKCS11Signer.cpp.

References ck_function_list::C_GetAttributeValue, CKR_OK, f, and value.

PKCS11Signer::PKCS11Cert PKCS11SignerPrivate::createPKCS11Cert ( CK_TOKEN_INFO token,
const X509Cert cert 
) const

Helper method, creates PKCS11Cert struct. NB! token should not be NULL.

Parameters
slotslot to be used to init PKCS11Cert.
certcert to be used to init PKCS11Cert.
Returns
returns created PKCS11Cert struct.

Definition at line 442 of file PKCS11Signer.cpp.

References digidoc::PKCS11Signer::PKCS11Cert::cert, digidoc::X509Cert::getSubjectName(), digidoc::PKCS11Signer::PKCS11Token::label, digidoc::PKCS11Signer::PKCS11Cert::label, ck_token_info::label, digidoc::PKCS11Signer::PKCS11Token::manufacturer, digidoc::PKCS11Signer::PKCS11Token::model, ck_token_info::model, digidoc::PKCS11Signer::PKCS11Token::serialNr, and digidoc::PKCS11Signer::PKCS11Cert::token.

Here is the call graph for this function:

std::vector< CK_OBJECT_HANDLE > PKCS11SignerPrivate::findObject ( CK_SESSION_HANDLE  session,
CK_OBJECT_CLASS  cls 
) const
bool digidoc::PKCS11SignerPrivate::load ( const std::string &  driver)
inline

Definition at line 77 of file PKCS11Signer.cpp.

References h.

void* digidoc::PKCS11SignerPrivate::resolve ( const char *  symbol)
inline

Definition at line 80 of file PKCS11Signer.cpp.

References h.

void digidoc::PKCS11SignerPrivate::unload ( )
inline

Definition at line 83 of file PKCS11Signer.cpp.

References h.

Member Data Documentation

CK_FUNCTION_LIST* digidoc::PKCS11SignerPrivate::f

Definition at line 87 of file PKCS11Signer.cpp.

Referenced by attribute(), and findObject().

void* digidoc::PKCS11SignerPrivate::h

Definition at line 91 of file PKCS11Signer.cpp.

Referenced by load(), resolve(), and unload().

CK_ULONG digidoc::PKCS11SignerPrivate::numberOfSlots

Definition at line 96 of file PKCS11Signer.cpp.

const unsigned char PKCS11SignerPrivate::sha1
static
Initial value:
{ 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14 }

Definition at line 98 of file PKCS11Signer.cpp.

Referenced by digidoc::PKCS11Signer::sign().

const unsigned char PKCS11SignerPrivate::sha224
static
Initial value:
{ 0x30, 0x2d, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x04, 0x05, 0x00, 0x04, 0x1c }

Definition at line 99 of file PKCS11Signer.cpp.

Referenced by digidoc::PKCS11Signer::sign().

const unsigned char PKCS11SignerPrivate::sha256
static
Initial value:
{ 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05, 0x00, 0x04, 0x20 }

Definition at line 100 of file PKCS11Signer.cpp.

Referenced by digidoc::PKCS11Signer::sign().

const unsigned char PKCS11SignerPrivate::sha384
static
Initial value:
{ 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05, 0x00, 0x04, 0x30 }

Definition at line 101 of file PKCS11Signer.cpp.

Referenced by digidoc::PKCS11Signer::sign().

const unsigned char PKCS11SignerPrivate::sha512
static
Initial value:
{ 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86, 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05, 0x00, 0x04, 0x40 }

Definition at line 102 of file PKCS11Signer.cpp.

Referenced by digidoc::PKCS11Signer::sign().

SignSlot digidoc::PKCS11SignerPrivate::sign

Definition at line 94 of file PKCS11Signer.cpp.

Referenced by PKCS11SignerPrivate().

CK_SLOT_ID_PTR digidoc::PKCS11SignerPrivate::slots

Definition at line 95 of file PKCS11Signer.cpp.


The documentation for this class was generated from the following file: