Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

xmltooling::SecurityHelper Class Reference

A helper class for working with keys, certificates, etc. More...

#include <xmltooling/security/SecurityHelper.h>

List of all members.

Static Public Member Functions

const char * guessEncodingFormat (const char *pathname)
 Access a file to try and guess the encoding format used.
XSECCryptoKey * loadKeyFromFile (const char *pathname, const char *format=NULL, const char *password=NULL)
 Loads a private key from a local file.
std::vector< XSECCryptoX509
* >::size_type 
loadCertificatesFromFile (std::vector< XSECCryptoX509 * > &certs, const char *pathname, const char *format=NULL, const char *password=NULL)
 Loads certificate(s) from a local file.
std::vector< XSECCryptoX509CRL
* >::size_type 
loadCRLsFromFile (std::vector< XSECCryptoX509CRL * > &crls, const char *pathname, const char *format=NULL)
 Loads CRL(s) from a local file.
XSECCryptoKey * loadKeyFromURL (SOAPTransport &transport, const char *backing, const char *format=NULL, const char *password=NULL)
 Loads a private key from a URL.
std::vector< XSECCryptoX509
* >::size_type 
loadCertificatesFromURL (std::vector< XSECCryptoX509 * > &certs, SOAPTransport &transport, const char *backing, const char *format=NULL, const char *password=NULL)
 Loads certificate(s) from a URL.
std::vector< XSECCryptoX509CRL
* >::size_type 
loadCRLsFromURL (std::vector< XSECCryptoX509CRL * > &crls, SOAPTransport &transport, const char *backing, const char *format=NULL)
 Loads CRL(s) from a URL.
bool matches (const XSECCryptoKey &key1, const XSECCryptoKey &key2)
 Compares two keys for equality.
std::string getDEREncoding (const Credential &cred, bool hash=false, bool nowrap=true)
 Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format.
std::string getDEREncoding (const XSECCryptoKey &key, bool hash=false, bool nowrap=true)
 Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format.
std::string getDEREncoding (const XSECCryptoX509 &cert, bool hash=false, bool nowrap=true)
 Returns the base64-encoded DER encoding of a certifiate's public key in SubjectPublicKeyInfo format.


Detailed Description

A helper class for working with keys, certificates, etc.


Member Function Documentation

std::string xmltooling::SecurityHelper::getDEREncoding (  const XSECCryptoX509 &  cert,
bool  hash = false,
bool  nowrap = true
)  [static]
 

Returns the base64-encoded DER encoding of a certifiate's public key in SubjectPublicKeyInfo format.

Parameters:
cert the certificate's key to encode
hash if true, the DER encoded data is hashed with SHA-1 before base64 encoding
nowrap if true, any linefeeds will be stripped from the result
Returns:
the base64 encoded key value

std::string xmltooling::SecurityHelper::getDEREncoding (  const XSECCryptoKey &  key,
bool  hash = false,
bool  nowrap = true
)  [static]
 

Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format.

Parameters:
key the key to encode
hash if true, the DER encoded data is hashed with SHA-1 before base64 encoding
nowrap if true, any linefeeds will be stripped from the result
Returns:
the base64 encoded key value

std::string xmltooling::SecurityHelper::getDEREncoding (  const Credential &  cred,
bool  hash = false,
bool  nowrap = true
)  [static]
 

Returns the base64-encoded DER encoding of a public key in SubjectPublicKeyInfo format.

Parameters:
cred the credential containing the key to encode
hash if true, the DER encoded data is hashed with SHA-1 before base64 encoding
nowrap if true, any linefeeds will be stripped from the result
Returns:
the base64 encoded key value

const char* xmltooling::SecurityHelper::guessEncodingFormat (  const char *  pathname  )  [static]
 

Access a file to try and guess the encoding format used.

Parameters:
pathname path to file
Returns:
constant identifying encoding format

std::vector<XSECCryptoX509*>::size_type xmltooling::SecurityHelper::loadCertificatesFromFile (  std::vector< XSECCryptoX509 * > &  certs,
const char *  pathname,
const char *  format = NULL,
const char *  password = NULL
)  [static]
 

Loads certificate(s) from a local file.

Parameters:
certs array to populate with certificate(s)
pathname path to file containing certificate(s)
format optional constant identifying certificate encoding format
Returns:
size of the resulting array

std::vector<XSECCryptoX509*>::size_type xmltooling::SecurityHelper::loadCertificatesFromURL (  std::vector< XSECCryptoX509 * > &  certs,
SOAPTransport &  transport,
const char *  backing,
const char *  format = NULL,
const char *  password = NULL
)  [static]
 

Loads certificate(s) from a URL.

Parameters:
certs array to populate with certificate(s)
transport object to use to acquire certificate(s)
backing backing file for certificate(s) (written to or read from if download fails)
format optional constant identifying certificate encoding format
Returns:
size of the resulting array

std::vector<XSECCryptoX509CRL*>::size_type xmltooling::SecurityHelper::loadCRLsFromFile (  std::vector< XSECCryptoX509CRL * > &  crls,
const char *  pathname,
const char *  format = NULL
)  [static]
 

Loads CRL(s) from a local file.

Parameters:
crls array to populate with CRL(s)
pathname path to file containing CRL(s)
format optional constant identifying CRL encoding format
Returns:
size of the resulting array

std::vector<XSECCryptoX509CRL*>::size_type xmltooling::SecurityHelper::loadCRLsFromURL (  std::vector< XSECCryptoX509CRL * > &  crls,
SOAPTransport &  transport,
const char *  backing,
const char *  format = NULL
)  [static]
 

Loads CRL(s) from a URL.

Parameters:
crls array to populate with CRL(s)
transport object to use to acquire CRL(s)
backing backing file for CRL(s) (written to or read from if download fails)
format optional constant identifying CRL encoding format
Returns:
size of the resulting array

XSECCryptoKey* xmltooling::SecurityHelper::loadKeyFromFile (  const char *  pathname,
const char *  format = NULL,
const char *  password = NULL
)  [static]
 

Loads a private key from a local file.

Parameters:
pathname path to file containing key
format optional constant identifying key encoding format
password optional password to decrypt key
Returns:
a populated key object

XSECCryptoKey* xmltooling::SecurityHelper::loadKeyFromURL (  SOAPTransport &  transport,
const char *  backing,
const char *  format = NULL,
const char *  password = NULL
)  [static]
 

Loads a private key from a URL.

Parameters:
transport object to use to acquire key
backing backing file for key (written to or read from if download fails)
format optional constant identifying key encoding format
password optional password to decrypt key
Returns:
a populated key object

bool xmltooling::SecurityHelper::matches (  const XSECCryptoKey &  key1,
const XSECCryptoKey &  key2
)  [static]
 

Compares two keys for equality.

Parameters:
key1 first key to compare
key2 second key to compare
Returns:
true iff the keys match


The documentation for this class was generated from the following file:
Generated on Wed Jun 17 16:50:44 2009 for xmltooling by  doxygen 1.3.9.1