Package org.opensaml.xmlsec.keyinfo.impl

# Class KeyAgreementKeyInfoGeneratorFactory.KeyAgreementKeyInfoGenerator

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

All Implemented Interfaces:
  `KeyInfoGenerator`

Enclosing class:
  KeyAgreementKeyInfoGeneratorFactory

public class KeyAgreementKeyInfoGeneratorFactory.KeyAgreementKeyInfoGenerator extends BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator
An implementation of `KeyInfoGenerator` capable of handling the information contained within a `KeyAgreementCredential`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final XMLObjectBuilder<AgreementMethod>`
`agreementMethodBuilder`
Builder for AgreementMethod objects.
`private final org.slf4j.Logger`
`log`
Class logger.
`private final KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions`
`options`
The set of options to be used by the generator.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`KeyAgreementKeyInfoGenerator(KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions newOptions, Class<? extends KeyInfo> type)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`KeyInfo`
`generate(Credential credential)`
Generate a new KeyInfo object based on keying material and other information within a credential.
`private void`
`processAgreementParameters(KeyInfo keyInfo, AgreementMethod agreementMethod, KeyAgreementCredential credential)`
Process `KeyAgreementCredential.getParameters()`.
`private void`
`processOriginatorKeyInfo(KeyInfo keyInfo, AgreementMethod agreementMethod, KeyAgreementCredential credential)`
Process the `KeyAgreementCredential.getOriginatorCredential()`.
`private void`
`processRecipientKeyInfo(KeyInfo keyInfo, AgreementMethod agreementMethod, KeyAgreementCredential credential)`
Process `KeyAgreementCredential.getRecipientCredential()`.

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

`buildKeyInfo, classToElementName, processEntityID, processKeyNames, processPublicKey`

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

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

## Field Details

### log

@Nonnull private final org.slf4j.Logger log
Class logger.

### options

@Nonnull private final KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions options
The set of options to be used by the generator.

### agreementMethodBuilder

@Nonnull private final XMLObjectBuilder<AgreementMethod> agreementMethodBuilder
Builder for AgreementMethod objects.

## Constructor Details

### KeyAgreementKeyInfoGenerator

protected KeyAgreementKeyInfoGenerator(@Nonnull KeyAgreementKeyInfoGeneratorFactory.KeyAgreementOptions newOptions, Class<? extends KeyInfo> type)
Constructor.

Parameters:
  `newOptions` - the options to be used by the generator
  `type` - the KeyInfo element type

## Method Details

### generate

@Nullable public KeyInfo generate(@Nullable Credential credential) throws SecurityException
Generate a new KeyInfo object based on keying material and other information within a credential.

Specified by:
  `generate` in interface `KeyInfoGenerator`
Overrides:
  `generate` in class `BasicKeyInfoGeneratorFactory.BasicKeyInfoGenerator`
Parameters:
  `credential` - the credential containing keying material and possibly other information
Returns:
  a new KeyInfo object or null if nothing was generated
Throws:
  `SecurityException` - thrown if there is any error generating the new KeyInfo from the credential

### processAgreementParameters

private void processAgreementParameters(@Nonnull KeyInfo keyInfo, @Nonnull AgreementMethod agreementMethod, @Nonnull KeyAgreementCredential credential) throws SecurityException
Process `KeyAgreementCredential.getParameters()`.

Parameters:
  `keyInfo` - the KeyInfo that is being built
  `agreementMethod` - the AgreementMethod that is being built
  `credential` - the Credential that is being processed
Throws:
  `SecurityException` - if there is a fatal error processing any agreement parameters

### processOriginatorKeyInfo

private void processOriginatorKeyInfo(@Nonnull KeyInfo keyInfo, @Nonnull AgreementMethod agreementMethod, @Nonnull KeyAgreementCredential credential) throws SecurityException
Process the `KeyAgreementCredential.getOriginatorCredential()`.

Parameters:
  `keyInfo` - the KeyInfo that is being built
  `agreementMethod` - the AgreementMethod that is being built
  `credential` - the Credential that is being processed
Throws:
  `SecurityException` - if there is a fatal error processing the originator KeyInfo

### processRecipientKeyInfo

private void processRecipientKeyInfo(@Nonnull KeyInfo keyInfo, @Nonnull AgreementMethod agreementMethod, @Nonnull KeyAgreementCredential credential) throws SecurityException
Process `KeyAgreementCredential.getRecipientCredential()`.

Parameters:
  `keyInfo` - the KeyInfo that is being built
  `agreementMethod` - the AgreementMethod that is being built
  `credential` - the Credential that is being processed
Throws:
  `SecurityException` - if there is a fatal error processing the recipient KeyInfo