libdigidocpp 4.1.0
|
Signer
interface. Provides interface for signing documents.
More...
#include <Signer.h>
Inherited by digidoc::PKCS11Signer, digidoc::PKCS12Signer, and digidoc::WinSigner.
Public Member Functions | |
virtual | ~Signer () |
virtual X509Cert | cert () const =0 |
virtual std::vector< unsigned char > | sign (const std::string &method, const std::vector< unsigned char > &digest) const =0 |
virtual std::string | method () const |
std::string | profile () const |
std::string | userAgent () const |
bool | usingENProfile () const |
std::string | city () const |
std::string | streetAddress () const |
std::string | stateOrProvince () const |
std::string | postalCode () const |
std::string | countryName () const |
std::vector< std::string > | signerRoles () const |
void | setMethod (const std::string &method) |
void | setProfile (const std::string &profile) |
void | setUserAgent (const std::string &userAgent) |
void | setENProfile (bool enable) |
void | setSignatureProductionPlace (const std::string &city, const std::string &stateOrProvince, const std::string &postalCode, const std::string &countryName) |
void | setSignatureProductionPlaceV2 (const std::string &city, const std::string &streetAddress, const std::string &stateOrProvince, const std::string &postalCode, const std::string &countryName) |
void | setSignerRoles (const std::vector< std::string > &signerRoles) |
Protected Member Functions | |
Signer () | |
Signer
interface. Provides interface for signing documents.
Digidoc LIB implements PKCS11, PKCS12, Windows Crypto signer class that allows signing with various tokens. Other implementations may provide signing implementation with other public-key cryptography systems.
|
virtualdefault |
Destructor
|
protected |
Constructor
Referenced by sign().
|
pure virtual |
Returns signer certificate. Must be reimplemented when subclassing
Implemented in digidoc::PKCS11Signer, and digidoc::PKCS12Signer.
Referenced by method().
string Signer::city | ( | ) | const |
Returns city from signature production place
Referenced by setSignatureProductionPlace(), setSignatureProductionPlaceV2(), and sign().
string Signer::countryName | ( | ) | const |
Returns country from signature production place
Referenced by setSignatureProductionPlace(), setSignatureProductionPlaceV2(), and sign().
|
virtual |
Gets signature method
Reimplemented in digidoc::PKCS11Signer.
References cert(), and digidoc::X509Cert::handle().
Referenced by digidoc::PKCS11Signer::method(), setMethod(), digidoc::PKCS12Signer::sign(), and sign().
string Signer::postalCode | ( | ) | const |
Returns postal code from signature production place
Referenced by setSignatureProductionPlace(), setSignatureProductionPlaceV2(), and sign().
string Signer::profile | ( | ) | const |
Returns signing profile
Referenced by setProfile(), and sign().
void Signer::setENProfile | ( | bool | enable | ) |
Toggle XAdES EN profile usage on signing
Referenced by setSignatureProductionPlaceV2(), and sign().
void Signer::setMethod | ( | const std::string & | method | ) |
void Signer::setProfile | ( | const std::string & | profile | ) |
void Signer::setSignatureProductionPlace | ( | const std::string & | city, |
const std::string & | stateOrProvince, | ||
const std::string & | postalCode, | ||
const std::string & | countryName ) |
Sets signature production place according XAdES standard. Note that setting the signature production place is optional.
city | |
stateOrProvince | |
postalCode | |
countryName |
References city(), countryName(), postalCode(), and stateOrProvince().
Referenced by sign().
void Signer::setSignatureProductionPlaceV2 | ( | const std::string & | city, |
const std::string & | streetAddress, | ||
const std::string & | stateOrProvince, | ||
const std::string & | postalCode, | ||
const std::string & | countryName ) |
Sets signature production place according XAdES EN standard. Note that setting the signature production place is optional.
city | |
streetAddress | |
stateOrProvince | |
postalCode | |
countryName |
References city(), countryName(), postalCode(), setENProfile(), stateOrProvince(), and streetAddress().
Referenced by sign().
void Signer::setSignerRoles | ( | const std::vector< std::string > & | signerRoles | ) |
Sets signature roles according XAdES standard. The parameter may contain the signer’s role and optionally the signer’s resolution. Note that only one signer role value (i.e. one <ClaimedRole> XML element) should be used. If the signer role contains both role and resolution then they must be separated with a slash mark, e.g. “role / resolution”.
References signerRoles().
Referenced by sign().
void Signer::setUserAgent | ( | const std::string & | userAgent | ) |
Sets additional User-Agent info that is sent to TSA or OCSP service
userAgent |
References userAgent().
Referenced by sign().
|
pure virtual |
Signs message digest. Must be reimplemented when subclassing
method | digest method to be used |
digest | digest to sign |
Exception | throws exception on error |
Implemented in digidoc::PKCS11Signer, and digidoc::PKCS12Signer.
References city(), countryName(), method(), postalCode(), profile(), setENProfile(), setMethod(), setProfile(), setSignatureProductionPlace(), setSignatureProductionPlaceV2(), setSignerRoles(), setUserAgent(), Signer(), signerRoles(), stateOrProvince(), streetAddress(), userAgent(), and usingENProfile().
vector< string > Signer::signerRoles | ( | ) | const |
Returns signer roles
Referenced by setSignerRoles(), and sign().
string Signer::stateOrProvince | ( | ) | const |
Returns state from signature production place
Referenced by setSignatureProductionPlace(), setSignatureProductionPlaceV2(), and sign().
string Signer::streetAddress | ( | ) | const |
Returns streetAddress from signature production place
Referenced by setSignatureProductionPlaceV2(), and sign().
string Signer::userAgent | ( | ) | const |
Additional User-Agent info that is sent to TSA or OCSP service
Referenced by setUserAgent(), and sign().
bool Signer::usingENProfile | ( | ) | const |
Use XAdES EN profile
Referenced by sign().