PKIFXSECCrypto Class Reference

#include <PKIFXSECCrypto.h>

Inheritance diagram for PKIFXSECCrypto:

Inheritance graph
[legend]
Collaboration diagram for PKIFXSECCrypto:

Collaboration graph
[legend]

List of all members.


Detailed Description

This is the class that glues PKIF to the xml security library.

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 XSECCryptoHashhashSHA1 () const
virtual XSECCryptoHashhashSHA (int length=160) const
virtual XSECCryptoHashhashHMACSHA1 () const
virtual XSECCryptoHashhashHMACSHA (int length=160) const
virtual XSECCryptoHashhashMD5 () const
virtual XSECCryptoHashhashHMACMD5 () const
virtual XSECCryptoKeyHMACkeyHMAC (void) const
virtual XSECCryptoBase64 * base64 () const
virtual XSECCryptoKeyDSAkeyDSA () const
virtual XSECCryptoKeyRSAkeyRSA () const
virtual XSECCryptoX509X509 () const
virtual bool algorithmSupported (XSECCryptoSymmetricKey::SymmetricKeyType alg) const
virtual bool algorithmSupported (XSECCryptoHash::HashType alg) const
virtual XSECCryptoSymmetricKeykeySymmetric (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

Constructor & Destructor Documentation

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

Returns:
None

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

Returns:
None
Parameters:
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

Returns:
None

Definition at line 91 of file PKIFXSECCrypto.cpp.

References m_impl.


Member Function Documentation

XSECCryptoHash * PKIFXSECCrypto::hashSHA1 (  )  const [virtual]

Interface: External

Called by the XML security library to obtain a SHA1 object from the provider.

Returns:
a pointer to a hash object that implements SHA1

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.

Returns:
a pointer to a hash object that implements SHA1
Parameters:
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.

Returns:
a pointer to a hash object that implements HMAC-SHA1

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.

Returns:
a pointer to a hash object that implements HMAC-SHA1
Parameters:
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.

Returns:
a pointer to a hash object that implements MD5

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.

Returns:
a pointer to a hash object that implements HMAC-MD5

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

Returns:
a key object the library can set a value within. Mainly used for XKMS.

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.

Returns:
Pointer to the new Base64 encoder.

Definition at line 276 of file PKIFXSECCrypto.cpp.

XSECCryptoKeyDSA * PKIFXSECCrypto::keyDSA (  )  const [virtual]

Interface: External

Obtain a DSA key implementation object.

Returns:
Pointer to the new DSA key 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.

Returns:
Pointer to the new RSA key 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

Returns:
Pointer to the new X509 key object

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.

Returns:
true if it's an algorithm that PKIF supports, false otherwise

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.

Returns:
true if it's an algorithm that PKIF supports, false otherwise

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

Returns:
pointer to a new XSECCryptoSymmetric key object
Parameters:
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

Returns:
number of bytes written to buffer
Parameters:
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

Returns:
Name of the PKIF XML provider

Definition at line 450 of file PKIFXSECCrypto.cpp.

References m_impl.

Referenced by pkifProvName().


Member Data Documentation

PKIFXSECCryptoImpl* PKIFXSECCrypto::m_impl [protected]


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

Generated on Mon Nov 15 11:21:05 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6