Implements Signer
interface for ID-Cards, which support PKCS#11 protocol.
More...
#include <PKCS11Signer.h>
Inherits digidoc::Signer.
Implements Signer
interface for ID-Cards, which support PKCS#11 protocol.
Abstract method selectSigningCertificate
is called if the signer needs to choose the correct signing certificate. It is called also if there is only one certificate found on ID-Card. Parameter certificates
provides list of all certificates found in the ID-Card.
Abstract method pin
is called if the selected certificate needs PIN to log in.
- See also
- selectSigningCertificate
-
pin
◆ PKCS11Signer()
PKCS11Signer::PKCS11Signer |
( |
const std::string & |
driver = "" | ) |
|
◆ ~PKCS11Signer()
PKCS11Signer::~PKCS11Signer |
( |
| ) |
|
|
override |
Unload PKCS#11 module and releases acquired memory.
◆ pin()
string PKCS11Signer::pin |
( |
const X509Cert & |
certificate | ) |
const |
|
protectedvirtual |
Abstract method that returns PIN code for the selected signing certificate. If PIN code is not needed this method is never called. To cancel the login this method should throw an exception.
- Parameters
-
certificate | certificate that is used for signing and needs a PIN for login. |
- Returns
- returns the PIN code to login.
- Exceptions
-
Exception | should throw an exception if the login operation should be canceled. |
Referenced by setPin().
◆ selectSigningCertificate()
X509Cert PKCS11Signer::selectSigningCertificate |
( |
const std::vector< X509Cert > & |
certificates | ) |
const |
|
protectedvirtual |
Abstract method for selecting the correct signing certificate. If none of the certificates suit for signing, this method should throw an Exception. This method is always called, when there is at least 1 certificate available.
- Parameters
-
certificates | available certificates to choose from. |
- Returns
- returns the certificate used for signing.
- Exceptions
-
Exception | should throw an exception if no suitable certificate is in the list or the operation should be cancelled. |
◆ setPin()
void PKCS11Signer::setPin |
( |
const std::string & |
pin | ) |
|
If sub class does not want reimplement pin
method then it is possible set default pin
- Parameters
-
References pin().
The documentation for this class was generated from the following files:
- PKCS11Signer.h
- PKCS11Signer.cpp