Package org.opensaml.xmlsec.agreement.impl

# Class BasicKeyAgreementCredential

java.lang.Object
org.opensaml.security.credential.AbstractCredential
org.opensaml.security.credential.BasicCredential
org.opensaml.xmlsec.agreement.impl.BasicKeyAgreementCredential

All Implemented Interfaces:
  `Credential`, `MutableCredential`, `KeyAgreementCredential`

public class BasicKeyAgreementCredential extends BasicCredential implements KeyAgreementCredential
Basic implementation of `KeyAgreementCredential`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`algorithm`
Algorithm URI.
`private Credential`
`originatorCredential`
Originator credential.
`private KeyAgreementParameters`
`parameters`
Parameters.
`private Credential`
`recipientCredential`
Recipient credential.

## Constructor Summary

Constructors
Constructor
Description
`BasicKeyAgreementCredential(SecretKey derivedKey, String agreementAlgorithm, Credential originator, Credential recipient)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getAlgorithm()`
The key agreement algorithm URI used.
`Class<? extends Credential>`
`getCredentialType()`
Get the primary type of the credential instance.
`Credential`
`getOriginatorCredential()`
The credential holding the originator key material.
`KeyAgreementParameters`
`getParameters()`
The parameters to the key agreement operation.
`Credential`
`getRecipientCredential()`
The credential holding the recipient key material.

### Methods inherited from class org.opensaml.security.credential.BasicCredential

`setEntityId, setPrivateKey, setPublicKey, setSecretKey, setUsageType`

### Methods inherited from class org.opensaml.security.credential.AbstractCredential

`getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getPublicKey, getSecretKey, getUsageType`

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

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

### Methods inherited from interface org.opensaml.security.credential.Credential

`getCredentialContextSet, getEntityId, getKeyNames, getPrivateKey, getPublicKey, getSecretKey, getUsageType`

## Field Details

### algorithm

@Nonnull private String algorithm
Algorithm URI.

### originatorCredential

@Nonnull private Credential originatorCredential
Originator credential.

### recipientCredential

@Nonnull private Credential recipientCredential
Recipient credential.

### parameters

@Nonnull private KeyAgreementParameters parameters
Parameters.

## Constructor Details

### BasicKeyAgreementCredential

public BasicKeyAgreementCredential(@Nonnull SecretKey derivedKey, @Nonnull String agreementAlgorithm, @Nonnull Credential originator, @Nonnull Credential recipient)
Constructor.

Parameters:
  `derivedKey` - the derived secret key
  `agreementAlgorithm` - the key agreement algorithm
  `originator` - the originator credential
  `recipient` - the recipient credential

## Method Details

### getCredentialType

@Nonnull public Class<? extends Credential> getCredentialType()
Get the primary type of the credential instance. This will usually be the primary sub-interface of `Credential` implemented by an implementation.

Specified by:
  `getCredentialType` in interface `Credential`
Overrides:
  `getCredentialType` in class `BasicCredential`
Returns:
  the credential type

### getAlgorithm

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

Specified by:
  `getAlgorithm` in interface `KeyAgreementCredential`
Returns:
  the algorithm

### getOriginatorCredential

@Nonnull public Credential getOriginatorCredential()
The credential holding the originator key material.

Specified by:
  `getOriginatorCredential` in interface `KeyAgreementCredential`
Returns:
  the originator credential

### getRecipientCredential

@Nonnull public Credential getRecipientCredential()
The credential holding the recipient key material.

Specified by:
  `getRecipientCredential` in interface `KeyAgreementCredential`
Returns:
  the recipient credential

### getParameters

@Nonnull public KeyAgreementParameters getParameters()
The parameters to the key agreement operation.

Specified by:
  `getParameters` in interface `KeyAgreementCredential`
Returns:
  the parameters