public class ExtendedEncryptionParametersResolver extends BasicEncryptionParametersResolver
BasicEncryptionParametersResolver with support for key agreement.| Constructor and Description |
|---|
ExtendedEncryptionParametersResolver()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Credential |
generateKeyAgreementCredential(Credential credential,
String keyWrappingAlgorithm,
List<String> keyAgreementMethods,
List<String> keyDerivationAlgorithms,
ConcatKDFParameters concatKDFParameters)
Generates a key agreement credential based on the resolved algorithms.
|
protected ConcatKDFParameters |
getConcatKDFParameters(CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Obtains the
ConcatKDFParameters to use for ConcatKDF key derivation. |
protected List<String> |
getEffectiveKeyAgreementMethods(CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Get the effective list of key agreement method URIs to consider, including application of whitelist/blacklist
policy.
|
protected List<String> |
getEffectiveKeyDerivationAlgorithms(CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Get the effective list of key derivation algorithm URIs to consider, including application of whitelist/blacklist
policy.
|
protected List<Credential> |
getEffectivePeerKeyAgreementCredentials(CriteriaSet criteria)
Get the effective list of peer key agreement credentials to consider.
|
protected void |
logResult(EncryptionParameters params) |
protected void |
resolveAndPopulateCredentialsAndAlgorithms(EncryptionParameters params,
CriteriaSet criteria,
com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
Extends the default implementation with support for encrypting the data encrypting key using a key wrapping key
that is created using a key agreement protocol.
|
protected KeyInfoGenerator |
resolveKeyTransportKeyInfoGenerator(CriteriaSet criteria,
Credential keyTransportEncryptionCredential) |
void |
setUseKeyAgreementDefaults(boolean flag)
Tells whether we should rely on that we received an
ExtendedEncryptionConfiguration object among the
criteria. |
credentialSupportsAlgorithm, generateDataEncryptionCredential, getAlgorithmRegistry, getAlgorithmRuntimeSupportedPredicate, getEffectiveDataEncryptionAlgorithms, getEffectiveDataEncryptionCredentials, getEffectiveKeyTransportAlgorithms, getEffectiveKeyTransportCredentials, getWhitelistBlacklistPredicate, isAutoGenerateDataEncryptionCredential, isDataEncryptionAlgorithm, isKeyTransportAlgorithm, populateRSAOAEPParams, processDataEncryptionCredentialAutoGeneration, resolve, resolveAndPopulateRSAOAEPParams, resolveDataEncryptionAlgorithm, resolveDataEncryptionAlgorithm, resolveDataKeyInfoGenerator, resolveKeyTransportAlgorithm, resolveKeyTransportAlgorithm, resolveKeyTransportAlgorithmPredicate, resolveSingle, setAlgorithmRegistry, setAutoGenerateDataEncryptionCredential, validate, validatelookupKeyInfoGenerator, resolveAndPopulateWhiteAndBlacklists, resolveEffectiveBlacklist, resolveEffectiveWhitelist, resolveWhitelistBlacklistPrecedence, resolveWhitelistBlacklistPredicatepublic ExtendedEncryptionParametersResolver()
protected void resolveAndPopulateCredentialsAndAlgorithms(@Nonnull EncryptionParameters params, @Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
resolveAndPopulateCredentialsAndAlgorithms in class BasicEncryptionParametersResolverprotected Credential generateKeyAgreementCredential(@Nonnull Credential credential, @Nonnull String keyWrappingAlgorithm, @Nonnull List<String> keyAgreementMethods, @Nonnull List<String> keyDerivationAlgorithms, ConcatKDFParameters concatKDFParameters) throws SecurityException
credential - the peer credentialkeyWrappingAlgorithm - key wrapping algorithmkeyAgreementMethods - key agreement methodskeyDerivationAlgorithms - key derivation algorithmsconcatKDFParameters - concat KDF parametersnullSecurityException - for key generation errors@Nonnull protected List<String> getEffectiveKeyAgreementMethods(@Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
criteria - the input criteria being evaluatedwhitelistBlacklistPredicate - the whitelist/blacklist predicate to use@Nonnull protected List<String> getEffectiveKeyDerivationAlgorithms(@Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
criteria - the input criteria being evaluatedwhitelistBlacklistPredicate - the whitelist/blacklist predicate to use@Nonnull protected ConcatKDFParameters getConcatKDFParameters(@Nonnull CriteriaSet criteria, @Nonnull com.google.common.base.Predicate<String> whitelistBlacklistPredicate)
ConcatKDFParameters to use for ConcatKDF key derivation.criteria - the criteriawhitelistBlacklistPredicate - the whitelist/blacklist predicate to useConcatKDFParameters object or null@Nonnull protected List<Credential> getEffectivePeerKeyAgreementCredentials(@Nonnull CriteriaSet criteria)
criteria - the input criteria being evaluated@Nullable protected KeyInfoGenerator resolveKeyTransportKeyInfoGenerator(@Nonnull CriteriaSet criteria, @Nullable Credential keyTransportEncryptionCredential)
resolveKeyTransportKeyInfoGenerator in class BasicEncryptionParametersResolverpublic void setUseKeyAgreementDefaults(boolean flag)
ExtendedEncryptionConfiguration object among the
criteria. If we want to function in an environment where the caller doesn't know anything about
ExtendedEncryptionConfiguration we can set this property to true. In that case, our resolving will
assume that default key agreement methods are available if no ExtendedEncryptionConfiguration is passed
among the criteria.flag - whether we should assume a set of key agreement methods (if no ExtendedEncryptionConfiguration is
passed)protected void logResult(EncryptionParameters params)
logResult in class BasicEncryptionParametersResolverCopyright © 2020 Sweden Connect. All rights reserved.