Package org.opensaml.xmlsec.agreement.impl

# Class DHWithExplicitKDFKeyAgreementProcessor

java.lang.Object
org.opensaml.xmlsec.agreement.impl.AbstractKeyAgreementProcessor
org.opensaml.xmlsec.agreement.impl.AbstractDerivationKeyAgreementProcessor
org.opensaml.xmlsec.agreement.impl.DHWithExplicitKDFKeyAgreementProcessor

All Implemented Interfaces:
  `KeyAgreementProcessor`

public class DHWithExplicitKDFKeyAgreementProcessor extends AbstractDerivationKeyAgreementProcessor
Implementation of `KeyAgreementProcessor` which performs Diffie-Hellman Ephemeral-Static Mode key agreement with Explicit Key Derivation Function as defined in XML Encryption 1.1.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final org.slf4j.Logger`
`log`
Logger.

## Constructor Summary

Constructors
Constructor
Description
`DHWithExplicitKDFKeyAgreementProcessor()`

## Method Summary

Modifier and Type
Method
Description
`protected byte[]`
`generateAgreementSecret(Credential publicCredential, Credential privateCredential, KeyAgreementParameters parameters)`
Generate the agreement secret according to the key algorithm and using the supplied public and private credentials.
`String`
`getAlgorithm()`
The key agreement algorithm URI.
`protected Credential`
`obtainPrivateCredential(Credential publicCredential, KeyAgreementParameters parameters)`
Obtain the private credential which is compatible with the given public credential.

### Methods inherited from class org.opensaml.xmlsec.agreement.impl.AbstractDerivationKeyAgreementProcessor

`deriveSecretKey`

### Methods inherited from class org.opensaml.xmlsec.agreement.impl.AbstractKeyAgreementProcessor

`buildKeyAgreementCredential, execute`

### 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
Logger.

## Constructor Details

### DHWithExplicitKDFKeyAgreementProcessor

public DHWithExplicitKDFKeyAgreementProcessor()

## Method Details

### getAlgorithm

@Nonnull public String getAlgorithm()
The key agreement algorithm URI.

Returns:
  the algorithm

### obtainPrivateCredential

@Nullable protected Credential obtainPrivateCredential(@Nonnull Credential publicCredential, @Nonnull KeyAgreementParameters parameters) throws KeyAgreementException
Obtain the private credential which is compatible with the given public credential.

Overrides:
  `obtainPrivateCredential` in class `AbstractKeyAgreementProcessor`
Parameters:
  `publicCredential` - the public credential
  `parameters` - the key agreement parameters
Returns:
  the obtained private credential
Throws:
  `KeyAgreementException` - if private credential can not be obtained

### generateAgreementSecret

@Nonnull protected byte[] generateAgreementSecret(@Nonnull Credential publicCredential, @Nonnull Credential privateCredential, @Nonnull KeyAgreementParameters parameters) throws KeyAgreementException
Generate the agreement secret according to the key algorithm and using the supplied public and private credentials.

Specified by:
  `generateAgreementSecret` in class `AbstractKeyAgreementProcessor`
Parameters:
  `publicCredential` - the public credential
  `privateCredential` - the private credential
  `parameters` - the key agreement parameters
Returns:
  the secret produced by the key agreement operation
Throws:
  `KeyAgreementException` - if secret generation fails