Package org.opensaml.xmlsec.keyinfo.impl

# Class KeyAgreementKeyInfoGeneratorFactory

java.lang.Object
org.opensaml.xmlsec.keyinfo.impl.BasicKeyInfoGeneratorFactory
org.opensaml.xmlsec.keyinfo.impl.KeyAgreementKeyInfoGeneratorFactory

All Implemented Interfaces:
  `KeyInfoGeneratorFactory`

public class KeyAgreementKeyInfoGeneratorFactory extends BasicKeyInfoGeneratorFactory
A factory implementation which produces instances of `KeyInfoGenerator` capable of handling the information contained within an `KeyAgreementCredential`.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`class`
`KeyAgreementKeyInfoGeneratorFactory.KeyAgreementKeyInfoGenerator`
An implementation of `KeyInfoGenerator` capable of handling the information contained within a `KeyAgreementCredential`.
`protected class`
`KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions`
Options to be used in the production of a `KeyInfo` from an `KeyAgreementCredential`.

## Nested classes/interfaces inherited from class org.opensaml.xmlsec.keyinfo.impl.BasicKeyInfoGeneratorFactory

`BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator, BasicKeyInfoGeneratorFactory.BasicOptions`

## Field Summary

Fields
Modifier and Type
Field
Description
`private final KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions`
`options`
The set of options configured for the factory.

## Constructor Summary

Constructors
Constructor
Description
`KeyAgreementKeyInfoGeneratorFactory()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`emitOriginatorKeyInfo()`
Get the option to emit the OriginatorKeyInfo element within the AgreementMethod element.
`boolean`
`emitRecipientKeyInfo()`
Get the option to emit the RecipientKeyInfo element within the AgreementMethod element.
`Class<? extends Credential>`
`getCredentialType()`
Get the type (interface) of the specific type of credential handled by generators produced by this factory.
`protected KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions`
`getOptions()`
Get the options of this instance.
`KeyInfoGeneratorManager`
`getOriginatorKeyInfoGeneratorManager()`
Get the `KeyInfoGeneratorManager` instance to use to emit `OriginatorKeyInfo`.
`KeyInfoGeneratorManager`
`getRecipientKeyInfoGeneratorManager()`
Get the `KeyInfoGeneratorManager` instance to use to emit `RecipientKeyInfo`.
`boolean`
`handles(Credential credential)`
Check whether the generators produced by this factory can handle the specified credential.
`KeyInfoGenerator`
`newInstance()`
Get a new instance of the generator type produced by the factory.
`KeyInfoGenerator`
`newInstance(Class<? extends KeyInfo> type)`
Get a new instance of the generator type produced by the factory, and which generates `KeyInfo` instances of the specified type, for example `OriginatorKeyInfo` or `RecipientKeyInfo`.
`protected KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions`
`newOptions()`
Get a new instance to hold options.
`void`
`setEmitOriginatorKeyInfo(boolean newValue)`
Set the option to emit the OriginatorKeyInfo element within the AgreementMethod element.
`void`
`setEmitRecipientKeyInfo(boolean newValue)`
Set the option to emit the RecipientKeyInfo element within the AgreementMethod element.
`void`
`setOriginatorKeyInfoGeneratorManager(KeyInfoGeneratorManager manager)`
Set the `KeyInfoGeneratorManager` instance to use to emit `OriginatorKeyInfo`.
`void`
`setRecipientKeyInfoGeneratorManager(KeyInfoGeneratorManager manager)`
Set the `KeyInfoGeneratorManager` instance to use to emit `RecipientKeyInfo`.

### Methods inherited from class org.opensaml.xmlsec.keyinfo.impl.BasicKeyInfoGeneratorFactory

`emitEntityIDAsKeyName, emitKeyNames, emitPublicDEREncodedKeyValue, emitPublicKeyValue, setEmitEntityIDAsKeyName, setEmitKeyNames, setEmitPublicDEREncodedKeyValue, setEmitPublicKeyValue`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### options

@Nonnull private final KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions options
The set of options configured for the factory.

## Constructor Details

### KeyAgreementKeyInfoGeneratorFactory

public KeyAgreementKeyInfoGeneratorFactory()
Constructor.

## Method Details

### getCredentialType

@Nonnull public Class<? extends Credential> getCredentialType()
Get the type (interface) of the specific type of credential handled by generators produced by this factory. Primarily used as an index by manager implementions such as `KeyInfoGeneratorManager`.

Specified by:
  `getCredentialType` in interface `KeyInfoGeneratorFactory`
Overrides:
  `getCredentialType` in class `BasicKeyInfoGeneratorFactory`
Returns:
  the specifc type of credential handled by the generators produced by this factory

### handles

public boolean handles(@Nonnull Credential credential)
Check whether the generators produced by this factory can handle the specified credential.

Specified by:
  `handles` in interface `KeyInfoGeneratorFactory`
Overrides:
  `handles` in class `BasicKeyInfoGeneratorFactory`
Parameters:
  `credential` - the credential to evaluate
Returns:
  true if the generators produced by this factory can handle the type of the specified credential, false otherwise

### newInstance

@Nonnull public KeyInfoGenerator newInstance()
Get a new instance of the generator type produced by the factory.

Specified by:
  `newInstance` in interface `KeyInfoGeneratorFactory`
Overrides:
  `newInstance` in class `BasicKeyInfoGeneratorFactory`
Returns:
  a new KeyInfoGenerator instance

### newInstance

@Nonnull public KeyInfoGenerator newInstance(@Nullable Class<? extends KeyInfo> type)
Get a new instance of the generator type produced by the factory, and which generates `KeyInfo` instances of the specified type, for example `OriginatorKeyInfo` or `RecipientKeyInfo`.

Specified by:
  `newInstance` in interface `KeyInfoGeneratorFactory`
Overrides:
  `newInstance` in class `BasicKeyInfoGeneratorFactory`
Parameters:
  `type` - the type of element to produce. Null is interpreted as a standard `KeyInfo`.
Returns:
  a new KeyInfoGenerator instance

### emitOriginatorKeyInfo

public boolean emitOriginatorKeyInfo()
Get the option to emit the OriginatorKeyInfo element within the AgreementMethod element.

Returns:
  the option value

### setEmitOriginatorKeyInfo

public void setEmitOriginatorKeyInfo(boolean newValue)
Set the option to emit the OriginatorKeyInfo element within the AgreementMethod element.

Parameters:
  `newValue` - the new option value

### emitRecipientKeyInfo

public boolean emitRecipientKeyInfo()
Get the option to emit the RecipientKeyInfo element within the AgreementMethod element.

Returns:
  the option value

### setEmitRecipientKeyInfo

public void setEmitRecipientKeyInfo(boolean newValue)
Set the option to emit the RecipientKeyInfo element within the AgreementMethod element.

Parameters:
  `newValue` - the new option value

### getOriginatorKeyInfoGeneratorManager

public KeyInfoGeneratorManager getOriginatorKeyInfoGeneratorManager()
Get the `KeyInfoGeneratorManager` instance to use to emit `OriginatorKeyInfo`.

Returns:
  the manager

### setOriginatorKeyInfoGeneratorManager

public void setOriginatorKeyInfoGeneratorManager(@Nullable KeyInfoGeneratorManager manager)
Set the `KeyInfoGeneratorManager` instance to use to emit `OriginatorKeyInfo`.

Parameters:
  `manager` - the manager instance

### getRecipientKeyInfoGeneratorManager

public KeyInfoGeneratorManager getRecipientKeyInfoGeneratorManager()
Get the `KeyInfoGeneratorManager` instance to use to emit `RecipientKeyInfo`.

Returns:
  the manager

### setRecipientKeyInfoGeneratorManager

public void setRecipientKeyInfoGeneratorManager(@Nullable KeyInfoGeneratorManager manager)
Set the `KeyInfoGeneratorManager` instance to use to emit `RecipientKeyInfo`.

Parameters:
  `manager` - the manager instance

### getOptions

@Nonnull protected KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions getOptions()
Get the options of this instance. Used by subclass constructors to get the options built by the top-level class constructor with `BasicKeyInfoGeneratorFactory.newOptions()`.

Overrides:
  `getOptions` in class `BasicKeyInfoGeneratorFactory`
Returns:
  the options instance

### newOptions

@Nonnull protected KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions newOptions()
Get a new instance to hold options. Used by the top-level superclass constructor. Subclasses MUST override to produce an instance of the appropriate subclass of `BasicKeyInfoGeneratorFactory.BasicOptions`.

Overrides:
  `newOptions` in class `BasicKeyInfoGeneratorFactory`
Returns:
  a new instance of factory/generator options