Class DHWithLegacyKDFKeyAgreementProcessor
- java.lang.Object
-
- org.opensaml.xmlsec.agreement.impl.AbstractKeyAgreementProcessor
-
- org.opensaml.xmlsec.agreement.impl.DHWithLegacyKDFKeyAgreementProcessor
-
- All Implemented Interfaces:
KeyAgreementProcessor
public class DHWithLegacyKDFKeyAgreementProcessor extends AbstractKeyAgreementProcessor
Implementation ofKeyAgreementProcessorwhich performs Diffie-Hellman Ephemeral-Static Mode key agreement with Legacy Key Derivation Function as defined in XML Encryption 1.1.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_DIGEST_METHODDefault digest method.private org.slf4j.LoggerlogLogger.
-
Constructor Summary
Constructors Constructor Description DHWithLegacyKDFKeyAgreementProcessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected SecretKeyderiveSecretKey(byte[] secret, String keyAlgorithm, KeyAgreementParameters parameters)Derive aSecretKeyfrom a given secret.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.StringgetAlgorithm()protected CredentialobtainPrivateCredential(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.AbstractKeyAgreementProcessor
buildKeyAgreementCredential, execute
-
-
-
-
Field Detail
-
DEFAULT_DIGEST_METHOD
public static final String DEFAULT_DIGEST_METHOD
Default digest method.- See Also:
- Constant Field Values
-
log
private final org.slf4j.Logger log
Logger.
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
-
obtainPrivateCredential
protected Credential obtainPrivateCredential(@Nonnull Credential publicCredential, @Nonnull KeyAgreementParameters parameters) throws KeyAgreementException
Obtain the private credential which is compatible with the given public credential.- Overrides:
obtainPrivateCredentialin classAbstractKeyAgreementProcessor- Parameters:
publicCredential- the public credentialparameters- the key agreement parameters- Returns:
- the obtained private credential
- Throws:
KeyAgreementException- if private credential can not be obtained
-
generateAgreementSecret
protected byte[] generateAgreementSecret(@Nonnull Credential publicCredential, @Nonnull Credential privateCredential, @Nonnull KeyAgreementParameters parameters) throws KeyAgreementExceptionGenerate the agreement secret according to the key algorithm and using the supplied public and private credentials.- Specified by:
generateAgreementSecretin classAbstractKeyAgreementProcessor- Parameters:
publicCredential- the public credentialprivateCredential- the private credentialparameters- the key agreement parameters- Returns:
- the secret produced by the key agreement operation
- Throws:
KeyAgreementException- if secret generation fails
-
deriveSecretKey
protected SecretKey deriveSecretKey(byte[] secret, @Nonnull String keyAlgorithm, @Nonnull KeyAgreementParameters parameters) throws KeyAgreementException
Derive aSecretKeyfrom a given secret.- Specified by:
deriveSecretKeyin classAbstractKeyAgreementProcessor- Parameters:
secret- the input secretkeyAlgorithm- the JCA key algorithm for the derived keyparameters- the key agreement parameters- Returns:
- the derived secret key
- Throws:
KeyAgreementException- if key derivation operation does not complete successfully
-
-