#include <PKIFXSECCrypto.h>
To use it, load an appropriate mediator set using PKIF's normal facilities, create an instance of PKFIXSECCrypto, and pass a pointer to that instance to XSECPlatformUtils::Initialise()
To gain the full benefits of PKIF's path building and validation capabilities, use PKIFXSECKeyInfoResolver for verification of signatures and encryption with certificates.
TSP-enforcing: No
Definition at line 39 of file PKIFXSECCrypto.h.
Public Member Functions | |
PKIFXSECCrypto () | |
PKIFXSECCrypto (IPKIFMediatorPtr &med) | |
virtual | ~PKIFXSECCrypto () |
virtual XSECCryptoHash * | hashSHA1 () const |
virtual XSECCryptoHash * | hashSHA (int length=160) const |
virtual XSECCryptoHash * | hashHMACSHA1 () const |
virtual XSECCryptoHash * | hashHMACSHA (int length=160) const |
virtual XSECCryptoHash * | hashMD5 () const |
virtual XSECCryptoHash * | hashHMACMD5 () const |
virtual XSECCryptoKeyHMAC * | keyHMAC (void) const |
virtual XSECCryptoBase64 * | base64 () const |
virtual XSECCryptoKeyDSA * | keyDSA () const |
virtual XSECCryptoKeyRSA * | keyRSA () const |
virtual XSECCryptoX509 * | X509 () const |
virtual bool | algorithmSupported (XSECCryptoSymmetricKey::SymmetricKeyType alg) const |
virtual bool | algorithmSupported (XSECCryptoHash::HashType alg) const |
virtual XSECCryptoSymmetricKey * | keySymmetric (XSECCryptoSymmetricKey::SymmetricKeyType alg) const |
virtual unsigned int | getRandom (unsigned char *buffer, unsigned int numOctets) const |
virtual const XMLCh * | getProviderName () const |
Protected Attributes | |
PKIFXSECCryptoImpl * | m_impl |
PKIFXSECCrypto::PKIFXSECCrypto | ( | ) |
Interface: External
Instantiate a PKIFXSECCrypto provider with an empty mediator set.
Most applications will prefer to use the other constructor with a customized mediator set
Definition at line 59 of file PKIFXSECCrypto.cpp.
PKIFXSECCrypto::PKIFXSECCrypto | ( | IPKIFMediatorPtr & | med | ) |
Interface: External
Instantiate a PKIFXSECCrypto provider with an application-supplied mediator set
This is the most common and best way to instantiate the provider
med | [in] smart pointer to the mediator set the application will use |
Definition at line 75 of file PKIFXSECCrypto.cpp.
References m_impl.
PKIFXSECCrypto::~PKIFXSECCrypto | ( | ) | [virtual] |
Interface: External
Free any resources used by the provider
Definition at line 91 of file PKIFXSECCrypto.cpp.
References m_impl.
XSECCryptoHash * PKIFXSECCrypto::hashSHA1 | ( | ) | const [virtual] |
Interface: External
Called by the XML security library to obtain a SHA1 object from the provider.
Definition at line 106 of file PKIFXSECCrypto.cpp.
References hashSHA().
XSECCryptoHash * PKIFXSECCrypto::hashSHA | ( | int | length = 160 |
) | const [virtual] |
Interface: External
Called by the XML security library to obtain a SHA object from the provider. length may be 160 (SHA1), 224, 256, 384, 512. Not all mediator sets support all lengths.
length | [in] lenght of sha digest to produce. Must correspond to SHA1 (160), SHA256 (256), etc |
Definition at line 119 of file PKIFXSECCrypto.cpp.
References m_impl.
Referenced by hashSHA1().
XSECCryptoHash * PKIFXSECCrypto::hashHMACSHA1 | ( | ) | const [virtual] |
Interface: External
Called by the XML security library to obtain an HMAC-SHA1 object from the provider.
Definition at line 158 of file PKIFXSECCrypto.cpp.
References hashHMACSHA().
XSECCryptoHash * PKIFXSECCrypto::hashHMACSHA | ( | int | length = 160 |
) | const [virtual] |
Interface: External
Called by the XML security library to obtain a HMAC-SHA object from the provider. length may be 160 (SHA1), 224, 256, 384, 512. Not all mediator sets support all lengths.
length | [in] lenght of sha digest to produce. Must correspond to SHA1 (160), SHA256 (256), etc |
Definition at line 171 of file PKIFXSECCrypto.cpp.
References m_impl.
Referenced by hashHMACSHA1().
XSECCryptoHash * PKIFXSECCrypto::hashMD5 | ( | ) | const [virtual] |
Interface: External
Called by the XML security library to obtain an MD5 object from the provider.
Definition at line 210 of file PKIFXSECCrypto.cpp.
References m_impl.
XSECCryptoHash * PKIFXSECCrypto::hashHMACMD5 | ( | ) | const [virtual] |
Interface: External
Called by the XML security library to obtain an HMAC-MD5 object from the provider.
Definition at line 233 of file PKIFXSECCrypto.cpp.
References m_impl.
XSECCryptoKeyHMAC * PKIFXSECCrypto::keyHMAC | ( | void | ) | const [virtual] |
Interface: External
Obtain an object that contains an HMAC key
Definition at line 255 of file PKIFXSECCrypto.cpp.
XSECCryptoBase64 * PKIFXSECCrypto::base64 | ( | ) | const [virtual] |
Interface: External
Obtain a Base64 encoder/decoder implementation.
PKIF just uses xmlsec's default Base64 implementation here.
Definition at line 276 of file PKIFXSECCrypto.cpp.
XSECCryptoKeyDSA * PKIFXSECCrypto::keyDSA | ( | ) | const [virtual] |
Interface: External
Obtain a DSA key implementation object.
Definition at line 291 of file PKIFXSECCrypto.cpp.
References m_impl, and PKIFXSECCryptoKeyDSA::SetMediator().
XSECCryptoKeyRSA * PKIFXSECCrypto::keyRSA | ( | ) | const [virtual] |
Interface: External
Obtain an RSA key implementation object.
Definition at line 311 of file PKIFXSECCrypto.cpp.
References m_impl, and PKIFXSECCryptoKeyRSA::SetMediator().
XSECCryptoX509 * PKIFXSECCrypto::X509 | ( | ) | const [virtual] |
Interface: External
Obtain an object that can work with keys from X.509 certificates
Definition at line 331 of file PKIFXSECCrypto.cpp.
References m_impl, and PKIFXSECCryptoX509::SetMediator().
bool PKIFXSECCrypto::algorithmSupported | ( | XSECCryptoSymmetricKey::SymmetricKeyType | alg | ) | const [virtual] |
Interface: External
Determine whether a symmetric algorithm is supported
Note that this only returns whether PKIF supports the algorithm. It does not currently query the active mediator set to make the determination, so applications should be prepared for PKIF exceptions later if an incorrect mediator set is used.
Definition at line 355 of file PKIFXSECCrypto.cpp.
bool PKIFXSECCrypto::algorithmSupported | ( | XSECCryptoHash::HashType | alg | ) | const [virtual] |
Interface: External
Determine whether a hash algorithm is supported
Note that this only returns whether PKIF supports the algorithm. It does not currently query the active mediator set to make the determination, so applications should be prepared for PKIF exceptions later if an incorrect mediator set is used.
Definition at line 378 of file PKIFXSECCrypto.cpp.
XSECCryptoSymmetricKey * PKIFXSECCrypto::keySymmetric | ( | XSECCryptoSymmetricKey::SymmetricKeyType | alg | ) | const [virtual] |
Interface: External
Obtain an object that wraps a symmetric key for the given algorithm
Used by the xml security library for bulk encryption interfaces
alg | [in] type of symmetric key object to instantiate |
Definition at line 401 of file PKIFXSECCrypto.cpp.
References m_impl, and PKIFXSECCryptoSymmetricKey::setSymmetricType().
unsigned int PKIFXSECCrypto::getRandom | ( | unsigned char * | buffer, | |
unsigned int | numOctets | |||
) | const [virtual] |
Interface: External
Generate a caller-specified number of random bytes
buffer | [out] buffer allocated for bytes |
numOctets | [in] number of bytes requested |
Definition at line 426 of file PKIFXSECCrypto.cpp.
References IPKIFCryptoMisc::GenRandom(), and m_impl.
Referenced by PKIFXSECCryptoSymmetricKey::encryptInit().
const XMLCh * PKIFXSECCrypto::getProviderName | ( | ) | const [virtual] |
Interface: External
Get the name of the provider
Definition at line 450 of file PKIFXSECCrypto.cpp.
References m_impl.
Referenced by pkifProvName().
PKIFXSECCryptoImpl* PKIFXSECCrypto::m_impl [protected] |
Definition at line 62 of file PKIFXSECCrypto.h.
Referenced by getProviderName(), getRandom(), hashHMACMD5(), hashHMACSHA(), hashMD5(), hashSHA(), keyDSA(), keyRSA(), keySymmetric(), PKIFXSECCrypto(), X509(), and ~PKIFXSECCrypto().