xmltooling::Credential Class Referenceabstract

Wraps keys and related functionality. More...

`#include <xmltooling/security/Credential.h>`

Inheritance diagram for xmltooling::Credential:

## Public Types

enum | ResolveTypes { RESOLVE_KEYS = 1 , RESOLVE_NAMES = 2 }
| Bitmask constants for limiting resolution process inside a CredentialResolver.
enum | UsageTypes { UNSPECIFIED_CREDENTIAL = 0 , SIGNING_CREDENTIAL = 1 , TLS_CREDENTIAL = 2 , ENCRYPTION_CREDENTIAL = 4 }
| Bitmask of use cases for credentials.
enum | KeyInfoTypes { KEYINFO_KEY_VALUE = 1 , KEYINFO_KEY_NAME = 2 }
| Bitmask of supported KeyInfo content to generate.

## Public Member Functions

virtual unsigned int | getUsage () const =0
| Get credential usage types.
virtual const char * | getAlgorithm () const =0
| Returns an algorithm identifier for the Credential.
virtual unsigned int | getKeySize () const =0
| Returns the size of the key in bits.
virtual const XSECCryptoKey * | getPrivateKey () const =0
| Returns a secret or private key to use for signing or decryption operations.
virtual const XSECCryptoKey * | getPublicKey () const =0
| Returns a secret or public key to use for verification or encryption operations.
virtual const std::set< std::string > & | getKeyNames () const =0
| Returns names representing the Credential.
virtual xmlsignature::KeyInfo * | getKeyInfo (bool compact=false) const =0
| Returns a ds:KeyInfo object representing the Credential for use in communicating with other entities.
virtual const CredentialContext * | getCredentialContext () const
| Get the credential context information, which provides additional information specific to the context in which the credential was resolved.

## Detailed Description

Wraps keys and related functionality.

Shared credential implementations should implement reference counting and honor any locking parameters to ensure appropriate synchronization.

## Member Function Documentation

## getAlgorithm()

virtual const char * xmltooling::Credential::getAlgorithm | ( |  | ) | const

pure virtual

Returns an algorithm identifier for the Credential.

Returns
  the Credential algorithm, or nullptr if indeterminate

Implemented in xmltooling::BasicX509Credential.

## getCredentialContext()

virtual const CredentialContext * xmltooling::Credential::getCredentialContext | ( |  | ) | const

virtual

Get the credential context information, which provides additional information specific to the context in which the credential was resolved.

Returns
  resolution context of the credential

## getKeyInfo()

virtual xmlsignature::KeyInfo * xmltooling::Credential::getKeyInfo | ( | bool | compact = false | ) | const

pure virtual

Returns a ds:KeyInfo object representing the Credential for use in communicating with other entities.

Parameters

  compact | true iff the communication medium is such that only compact forms should be included

Returns
  a KeyInfo object, which must be freed by the caller

Implemented in xmltooling::BasicX509Credential.

## getKeyNames()

virtual const std::set< std::string > & xmltooling::Credential::getKeyNames | ( |  | ) | const

pure virtual

Returns names representing the Credential.

Names should be unique in the context of the comparisons against CredentialCriteria that deployments expect to see.

Returns
  a sorted set of names

Implemented in xmltooling::BasicX509Credential.

## getKeySize()

virtual unsigned int xmltooling::Credential::getKeySize | ( |  | ) | const

pure virtual

Returns the size of the key in bits.

Returns
  the key size, or 0 if indeterminate

Implemented in xmltooling::BasicX509Credential.

## getPrivateKey()

virtual const XSECCryptoKey * xmltooling::Credential::getPrivateKey | ( |  | ) | const

pure virtual

Returns a secret or private key to use for signing or decryption operations.

Returns
  a secret or private key

Implemented in xmltooling::BasicX509Credential.

## getPublicKey()

virtual const XSECCryptoKey * xmltooling::Credential::getPublicKey | ( |  | ) | const

pure virtual

Returns a secret or public key to use for verification or encryption operations.

Returns
  a secret or public key

Implemented in xmltooling::BasicX509Credential.

## getUsage()

virtual unsigned int xmltooling::Credential::getUsage | ( |  | ) | const

pure virtual

Get credential usage types.

Returns
  the usage bitmask

Implemented in xmltooling::BasicX509Credential.

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

- xmltooling/security/Credential.h