[java-opensaml] branch main updated: Add some annotations, yank extraneous public keywords.
Scott Cantor
cantor.2 at osu.edu
Tue Apr 18 18:16:02 UTC 2023
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch main
in repository java-opensaml.
View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=21898df0e738e34df3f8ebd3bf6dfddc3f6b1435
The following commit(s) were added to refs/heads/main by this push:
new 21898df0e Add some annotations, yank extraneous public keywords.
21898df0e is described below
commit 21898df0e738e34df3f8ebd3bf6dfddc3f6b1435
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Tue Apr 18 14:15:59 2023 -0400
Add some annotations, yank extraneous public keywords.
---
.../xmlsec/AlgorithmPolicyConfiguration.java | 12 ++---
.../opensaml/xmlsec/DecryptionConfiguration.java | 6 +--
.../opensaml/xmlsec/EncryptionConfiguration.java | 20 ++++----
.../xmlsec/KeyTransportAlgorithmPredicate.java | 4 +-
.../xmlsec/SignatureSigningConfiguration.java | 14 +++---
.../xmlsec/SignatureSigningParameters.java | 14 +++---
.../xmlsec/SignatureValidationConfiguration.java | 2 +-
.../agreement/CloneableKeyAgreementParameter.java | 2 +-
.../xmlsec/agreement/KeyAgreementCredential.java | 10 ++--
.../xmlsec/agreement/KeyAgreementProcessor.java | 6 +--
.../XMLExpressableKeyAgreementParameter.java | 4 +-
.../xmlsec/algorithm/AlgorithmDescriptor.java | 10 ++--
.../xmlsec/algorithm/AlgorithmRegistry.java | 56 ++++++++++------------
.../xmlsec/algorithm/BlockEncryptionAlgorithm.java | 6 +--
.../algorithm/KeyLengthSpecifiedAlgorithm.java | 4 +-
.../xmlsec/algorithm/KeySpecifiedAlgorithm.java | 4 +-
.../xmlsec/algorithm/KeyTransportAlgorithm.java | 6 +--
.../opensaml/xmlsec/algorithm/MACAlgorithm.java | 5 +-
.../xmlsec/algorithm/SignatureAlgorithm.java | 4 +-
.../config/BasicXMLSecurityConfiguration.java | 7 ---
.../xmlsec/config/DecryptionParserPool.java | 2 +-
.../config/GlobalAlgorithmRegistryInitializer.java | 9 ++--
...alKeyAgreementProcessorRegistryInitializer.java | 9 ++--
.../DecryptionConfigurationCriterion.java | 9 ++--
.../EncryptionConfigurationCriterion.java | 7 ++-
.../criterion/EncryptionOptionalCriterion.java | 6 ++-
.../SignatureSigningConfigurationCriterion.java | 7 ++-
.../SignatureValidationConfigurationCriterion.java | 7 ++-
.../opensaml/xmlsec/derivation/KeyDerivation.java | 6 +--
.../opensaml/xmlsec/keyinfo/KeyInfoSupport.java | 4 +-
30 files changed, 135 insertions(+), 127 deletions(-)
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/AlgorithmPolicyConfiguration.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/AlgorithmPolicyConfiguration.java
index 0f46d9464..7fbe08b1c 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/AlgorithmPolicyConfiguration.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/AlgorithmPolicyConfiguration.java
@@ -31,7 +31,7 @@ import net.shibboleth.shared.annotation.constraint.Unmodifiable;
public interface AlgorithmPolicyConfiguration {
/** Rule precedence values. */
- public enum Precedence {
+ enum Precedence {
/** Include takes precedence over exclude. */
INCLUDE,
@@ -44,7 +44,7 @@ public interface AlgorithmPolicyConfiguration {
*
* @return the collection of algorithms
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public Collection<String> getIncludedAlgorithms();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive Collection<String> getIncludedAlgorithms();
/**
* Flag indicating whether to merge this configuration's includes with one of a lower order of precedence,
@@ -52,14 +52,14 @@ public interface AlgorithmPolicyConfiguration {
*
* @return true if should merge, false otherwise
*/
- public boolean isIncludeMerge();
+ boolean isIncludeMerge();
/**
* Get the collection of excluded algorithm URIs.
*
* @return the collection of algorithms
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public Collection<String> getExcludedAlgorithms();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive Collection<String> getExcludedAlgorithms();
/**
* Flag indicating whether to merge this configuration's excludes with one of a lower order of precedence,
@@ -67,7 +67,7 @@ public interface AlgorithmPolicyConfiguration {
*
* @return true if should merge, false otherwise
*/
- public boolean isExcludeMerge();
+ boolean isExcludeMerge();
/**
* Get preference value indicating which should take precedence when both include and exclude collections
@@ -75,6 +75,6 @@ public interface AlgorithmPolicyConfiguration {
*
* @return the configured precedence value.
*/
- @Nonnull public Precedence getIncludeExcludePrecedence();
+ @Nonnull Precedence getIncludeExcludePrecedence();
}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/DecryptionConfiguration.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/DecryptionConfiguration.java
index ffe3fed4e..fdbf48cea 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/DecryptionConfiguration.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/DecryptionConfiguration.java
@@ -32,7 +32,7 @@ public interface DecryptionConfiguration extends AlgorithmPolicyConfiguration {
*
* @return the KeyInfoCredentialResolver instance
*/
- @Nullable public KeyInfoCredentialResolver getDataKeyInfoCredentialResolver();
+ @Nullable KeyInfoCredentialResolver getDataKeyInfoCredentialResolver();
/**
* The KeyInfoCredentialResolver to use when processing the EncryptedKey/KeyInfo (the
@@ -40,13 +40,13 @@ public interface DecryptionConfiguration extends AlgorithmPolicyConfiguration {
*
* @return the KeyInfoCredentialResolver instance
*/
- @Nullable public KeyInfoCredentialResolver getKEKKeyInfoCredentialResolver();
+ @Nullable KeyInfoCredentialResolver getKEKKeyInfoCredentialResolver();
/**
* Get the EncryptedKeyResolver to use when resolving the EncryptedKey(s) to process.
*
* @return the EncryptedKeyResolver instance
*/
- @Nullable public EncryptedKeyResolver getEncryptedKeyResolver();
+ @Nullable EncryptedKeyResolver getEncryptedKeyResolver();
}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/EncryptionConfiguration.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/EncryptionConfiguration.java
index c09815746..2a082924a 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/EncryptionConfiguration.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/EncryptionConfiguration.java
@@ -43,49 +43,49 @@ public interface EncryptionConfiguration extends AlgorithmPolicyConfiguration {
*
* @return the list of encryption credentials, may be empty
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<Credential> getDataEncryptionCredentials();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive List<Credential> getDataEncryptionCredentials();
/**
* Get the list of preferred data encryption algorithm URIs, in preference order.
*
* @return the list of algorithm URIs, may be empty
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<String> getDataEncryptionAlgorithms();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive List<String> getDataEncryptionAlgorithms();
/**
* Get the list of key transport encryption credentials to use, in preference order.
*
* @return the list of encryption credentials, may be empty
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<Credential> getKeyTransportEncryptionCredentials();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive List<Credential> getKeyTransportEncryptionCredentials();
/**
* Get the list of preferred key transport encryption algorithm URIs, in preference order.
*
* @return the list of algorithm URIs, may be empty
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<String> getKeyTransportEncryptionAlgorithms();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive List<String> getKeyTransportEncryptionAlgorithms();
/**
* Get the KeyInfoGenerator manager to use when generating the EncryptedData/KeyInfo.
*
* @return the KeyInfoGenerator manager instance
*/
- @Nullable public NamedKeyInfoGeneratorManager getDataKeyInfoGeneratorManager();
+ @Nullable NamedKeyInfoGeneratorManager getDataKeyInfoGeneratorManager();
/**
* Get the KeyInfoGenerator manager to use when generating the EncryptedKey/KeyInfo.
*
* @return the KeyInfoGenerator manager instance
*/
- @Nullable public NamedKeyInfoGeneratorManager getKeyTransportKeyInfoGeneratorManager();
+ @Nullable NamedKeyInfoGeneratorManager getKeyTransportKeyInfoGeneratorManager();
/**
* Get the instance of {@link RSAOAEPParameters}.
*
* @return the parameters instance
*/
- @Nullable public RSAOAEPParameters getRSAOAEPParameters();
+ @Nullable RSAOAEPParameters getRSAOAEPParameters();
/**
* Flag indicating whether to merge this configuration's {@link RSAOAEPParameters} values with those of
@@ -93,14 +93,14 @@ public interface EncryptionConfiguration extends AlgorithmPolicyConfiguration {
*
* @return true if should merge, false otherwise
*/
- public boolean isRSAOAEPParametersMerge();
+ boolean isRSAOAEPParametersMerge();
/**
* Get the instance of {@link KeyTransportAlgorithmPredicate}.
*
* @return the predicate instance
*/
- @Nullable public KeyTransportAlgorithmPredicate getKeyTransportAlgorithmPredicate();
+ @Nullable KeyTransportAlgorithmPredicate getKeyTransportAlgorithmPredicate();
/**
* Get the map of {@link KeyAgreementEncryptionConfiguration} instances.
@@ -108,6 +108,6 @@ public interface EncryptionConfiguration extends AlgorithmPolicyConfiguration {
* @return the
*/
@Nonnull @Unmodifiable @NotLive
- public Map<String, KeyAgreementEncryptionConfiguration> getKeyAgreementConfigurations();
+ Map<String, KeyAgreementEncryptionConfiguration> getKeyAgreementConfigurations();
}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/KeyTransportAlgorithmPredicate.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/KeyTransportAlgorithmPredicate.java
index 3824b97da..83695f8c9 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/KeyTransportAlgorithmPredicate.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/KeyTransportAlgorithmPredicate.java
@@ -35,7 +35,7 @@ public interface KeyTransportAlgorithmPredicate extends Predicate<KeyTransportAl
/**
* Input class for instances of {@link KeyTransportAlgorithmPredicate}.
*/
- public static final class SelectionInput {
+ static final class SelectionInput {
/** The candidate key transport algorithm. */
@Nonnull private final String keyTransportAlgorithm;
@@ -92,4 +92,4 @@ public interface KeyTransportAlgorithmPredicate extends Predicate<KeyTransportAl
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningConfiguration.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningConfiguration.java
index 0f93b9cb9..14fa77b09 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningConfiguration.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningConfiguration.java
@@ -40,14 +40,14 @@ public interface SignatureSigningConfiguration extends AlgorithmPolicyConfigurat
*
* @return the list of signing credentials, may be empty
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<Credential> getSigningCredentials();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive List<Credential> getSigningCredentials();
/**
* Get the list of preferred signature algorithm URIs, in preference order.
*
* @return the list of algorithm URIs, may be empty
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<String> getSignatureAlgorithms();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive List<String> getSignatureAlgorithms();
/**
* Get the list of digest method algorithm URIs suitable for use as a Signature Reference DigestMethod value,
@@ -55,21 +55,21 @@ public interface SignatureSigningConfiguration extends AlgorithmPolicyConfigurat
*
* @return a digest method algorithm URI
*/
- @Nonnull @NonnullElements @Unmodifiable @NotLive public List<String> getSignatureReferenceDigestMethods();
+ @Nonnull @NonnullElements @Unmodifiable @NotLive List<String> getSignatureReferenceDigestMethods();
/**
* Get a canonicalization algorithm URI suitable for use as a Signature Reference Transform value.
*
* @return a digest method algorithm URI
*/
- @Nullable public String getSignatureReferenceCanonicalizationAlgorithm();
+ @Nullable String getSignatureReferenceCanonicalizationAlgorithm();
/**
* Get a canonicalization algorithm URI suitable for use as a Signature CanonicalizationMethod value.
*
* @return a canonicalization algorithm URI
*/
- @Nullable public String getSignatureCanonicalizationAlgorithm();
+ @Nullable String getSignatureCanonicalizationAlgorithm();
/**
* Get the value to be used as the Signature SignatureMethod HMACOutputLength value, used
@@ -77,13 +77,13 @@ public interface SignatureSigningConfiguration extends AlgorithmPolicyConfigurat
*
* @return the configured HMAC output length value
*/
- @Nullable public Integer getSignatureHMACOutputLength();
+ @Nullable Integer getSignatureHMACOutputLength();
/**
* Get the manager for named KeyInfoGenerator instances.
*
* @return the KeyInfoGenerator manager, or null if none is configured
*/
- @Nullable public NamedKeyInfoGeneratorManager getKeyInfoGeneratorManager();
+ @Nullable NamedKeyInfoGeneratorManager getKeyInfoGeneratorManager();
}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningParameters.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningParameters.java
index b97bf5e93..45ecbf361 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningParameters.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureSigningParameters.java
@@ -29,25 +29,25 @@ import org.opensaml.xmlsec.keyinfo.KeyInfoGenerator;
public class SignatureSigningParameters {
/** The signing credential. */
- private Credential signingCredential;
+ @Nullable private Credential signingCredential;
/** The signature algorithm URI. */
- private String signatureAlgorithmURI;
+ @Nullable private String signatureAlgorithmURI;
/** The signature reference digest method URI. */
- private String signatureReferenceDigestMethod;
+ @Nullable private String signatureReferenceDigestMethod;
/** The signature reference canonicalization transform algorithm. */
- private String signatureReferenceCanonicalizationAlgorithm;
+ @Nullable private String signatureReferenceCanonicalizationAlgorithm;
/** The signature canonicalization algorithm URI. */
- private String signatureCanonicalizationAlgorithm;
+ @Nullable private String signatureCanonicalizationAlgorithm;
/** The signature HMAC output length value. */
- private Integer signatureHMACOutputLength;
+ @Nullable private Integer signatureHMACOutputLength;
/** The KeyInfo generator. */
- private KeyInfoGenerator keyInfoGenerator;
+ @Nullable private KeyInfoGenerator keyInfoGenerator;
/**
* Get the signing credential to use when signing.
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureValidationConfiguration.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureValidationConfiguration.java
index 4b5261091..256cdd1be 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureValidationConfiguration.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/SignatureValidationConfiguration.java
@@ -31,6 +31,6 @@ public interface SignatureValidationConfiguration extends AlgorithmPolicyConfigu
*
* @return the signature trust engine
*/
- @Nullable public SignatureTrustEngine getSignatureTrustEngine();
+ @Nullable SignatureTrustEngine getSignatureTrustEngine();
}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/CloneableKeyAgreementParameter.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/CloneableKeyAgreementParameter.java
index d11ede381..8128a651d 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/CloneableKeyAgreementParameter.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/CloneableKeyAgreementParameter.java
@@ -29,4 +29,4 @@ public interface CloneableKeyAgreementParameter extends KeyAgreementParameter, C
*/
KeyAgreementParameter clone();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementCredential.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementCredential.java
index b81928a7f..bedba806e 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementCredential.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementCredential.java
@@ -36,27 +36,27 @@ public interface KeyAgreementCredential extends Credential {
*
* @return the algorithm
*/
- @Nonnull public String getAlgorithm();
+ @Nonnull String getAlgorithm();
/**
* The credential holding the originator key material.
*
* @return the originator credential
*/
- @Nonnull public Credential getOriginatorCredential();
+ @Nonnull Credential getOriginatorCredential();
/**
* The credential holding the recipient key material.
*
* @return the recipient credential
*/
- @Nonnull public Credential getRecipientCredential();
+ @Nonnull Credential getRecipientCredential();
/**
* The parameters to the key agreement operation.
*
* @return the parameters
*/
- @Nonnull public KeyAgreementParameters getParameters();
+ @Nonnull KeyAgreementParameters getParameters();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementProcessor.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementProcessor.java
index 1c4afbf9d..5bb90ac6a 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementProcessor.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/KeyAgreementProcessor.java
@@ -31,7 +31,7 @@ public interface KeyAgreementProcessor {
*
* @return the algorithm
*/
- @Nonnull public String getAlgorithm();
+ @Nonnull String getAlgorithm();
/**
* Perform the key agreement operation and return a new credential representing the results.
@@ -46,8 +46,8 @@ public interface KeyAgreementProcessor {
*
* @throws KeyAgreementException if the key agreement operation is not completed successfully
*/
- @Nonnull public KeyAgreementCredential execute(@Nonnull final Credential publicCredential,
+ @Nonnull KeyAgreementCredential execute(@Nonnull final Credential publicCredential,
@Nonnull final String keyAlgorithm, @Nonnull final KeyAgreementParameters parameters)
throws KeyAgreementException;
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/XMLExpressableKeyAgreementParameter.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/XMLExpressableKeyAgreementParameter.java
index 632c4599c..1596a4a52 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/XMLExpressableKeyAgreementParameter.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/agreement/XMLExpressableKeyAgreementParameter.java
@@ -38,6 +38,6 @@ public interface XMLExpressableKeyAgreementParameter extends KeyAgreementParamet
*
* @return the XML object instance
*/
- @Nonnull public XMLObject buildXMLObject();
+ @Nonnull XMLObject buildXMLObject();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmDescriptor.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmDescriptor.java
index f00598a6a..7bcf607a5 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmDescriptor.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmDescriptor.java
@@ -27,7 +27,7 @@ import net.shibboleth.shared.annotation.constraint.NotEmpty;
public interface AlgorithmDescriptor {
/** Algorithm descriptor types. */
- public enum AlgorithmType {
+ enum AlgorithmType {
/** Block Encryption. */
BlockEncryption,
/** Message Authentication Code (MAC). */
@@ -49,20 +49,20 @@ public interface AlgorithmDescriptor {
*
* @return the algorithm URI
*/
- @Nonnull @NotEmpty public String getURI();
+ @Nonnull @NotEmpty String getURI();
/**
* Get the algorithm URI's fundamental type.
*
* @return a type specified with {@link AlgorithmType}
*/
- @Nonnull public AlgorithmType getType();
+ @Nonnull AlgorithmType getType();
/**
* Get the algorithm's JCA algorithm ID.
*
* @return the JCA algorithm ID
*/
- @Nonnull @NotEmpty public String getJCAAlgorithmID();
+ @Nonnull @NotEmpty String getJCAAlgorithmID();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmRegistry.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmRegistry.java
index 243d9e214..ab08e7ac1 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmRegistry.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/AlgorithmRegistry.java
@@ -20,7 +20,6 @@ package org.opensaml.xmlsec.algorithm;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.Signature;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
@@ -38,13 +37,14 @@ import javax.crypto.NoSuchPaddingException;
import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
+import net.shibboleth.shared.primitive.LoggerFactory;
import net.shibboleth.shared.primitive.StringSupport;
import org.opensaml.xmlsec.algorithm.AlgorithmDescriptor.AlgorithmType;
import org.opensaml.xmlsec.encryption.support.EncryptionConstants;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
import com.google.common.base.MoreObjects;
@@ -54,22 +54,22 @@ import com.google.common.base.MoreObjects;
public class AlgorithmRegistry {
/** Logger. */
- private Logger log = LoggerFactory.getLogger(AlgorithmRegistry.class);
+ @Nonnull private Logger log = LoggerFactory.getLogger(AlgorithmRegistry.class);
/** Map of registered algorithm descriptors. */
- private Map<String, AlgorithmDescriptor> descriptors;
+ @Nonnull private Map<String, AlgorithmDescriptor> descriptors;
/** Index of registered AlgorithmType to algorithm URI. */
- private Map<AlgorithmType, Set<String>> types;
+ @Nonnull private Map<AlgorithmType, Set<String>> types;
/** Set containing algorithms which are supported by the runtime environment. */
- private Set<String> runtimeSupported;
+ @Nonnull private Set<String> runtimeSupported;
/** Index of digest type to AlgorithmDescriptor. */
- private Map<String, DigestAlgorithm> digestAlgorithms;
+ @Nonnull private Map<String, DigestAlgorithm> digestAlgorithms;
/** Index of (KeyType,DigestType) to AlgorithmDescriptor. */
- private Map<SignatureAlgorithmIndex, SignatureAlgorithm> signatureAlgorithms;
+ @Nonnull private Map<SignatureAlgorithmIndex, SignatureAlgorithm> signatureAlgorithms;
/** Constructor. */
public AlgorithmRegistry() {
@@ -216,9 +216,9 @@ public class AlgorithmRegistry {
Constraint.isNotNull(type, "AlgorithmType was null");
final Set<String> byType = types.get(type);
if (byType != null) {
- return Set.copyOf(byType);
+ return CollectionSupport.copyToSet(byType);
}
- return Collections.emptySet();
+ return CollectionSupport.emptySet();
}
/**
@@ -233,7 +233,7 @@ public class AlgorithmRegistry {
return getRegisteredURIsByType(type).stream()
.map(this::get)
.filter(Objects::nonNull)
- .collect(Collectors.toUnmodifiableSet());
+ .collect(CollectionSupport.nonnullCollector(Collectors.toUnmodifiableSet())).get();
}
/**
@@ -242,7 +242,7 @@ public class AlgorithmRegistry {
*
* @param descriptor the algorithm
*/
- private void index(final AlgorithmDescriptor descriptor) {
+ private void index(@Nonnull final AlgorithmDescriptor descriptor) {
Set<String> byType = types.get(descriptor.getType());
if (byType == null) {
byType = new HashSet<>();
@@ -259,12 +259,10 @@ public class AlgorithmRegistry {
runtimeSupported.remove(descriptor.getURI());
}
- if (descriptor instanceof DigestAlgorithm) {
- final DigestAlgorithm digestAlgorithm = (DigestAlgorithm) descriptor;
- digestAlgorithms.put(digestAlgorithm.getJCAAlgorithmID(), digestAlgorithm);
+ if (descriptor instanceof DigestAlgorithm digest) {
+ digestAlgorithms.put(digest.getJCAAlgorithmID(), digest);
}
- if (descriptor instanceof SignatureAlgorithm) {
- final SignatureAlgorithm sigAlg = (SignatureAlgorithm) descriptor;
+ if (descriptor instanceof SignatureAlgorithm sigAlg) {
signatureAlgorithms.put(new SignatureAlgorithmIndex(sigAlg.getKey(), sigAlg.getDigest()), sigAlg);
}
}
@@ -275,7 +273,7 @@ public class AlgorithmRegistry {
*
* @param descriptor the algorithm
*/
- private void deindex(final AlgorithmDescriptor descriptor) {
+ private void deindex(@Nonnull final AlgorithmDescriptor descriptor) {
final Set<String> byType = types.get(descriptor.getType());
if (byType != null) {
byType.remove(descriptor.getURI());
@@ -283,12 +281,10 @@ public class AlgorithmRegistry {
runtimeSupported.remove(descriptor.getURI());
- if (descriptor instanceof DigestAlgorithm) {
- final DigestAlgorithm digestAlgorithm = (DigestAlgorithm) descriptor;
- digestAlgorithms.remove(digestAlgorithm.getJCAAlgorithmID());
+ if (descriptor instanceof DigestAlgorithm digest) {
+ digestAlgorithms.remove(digest.getJCAAlgorithmID());
}
- if (descriptor instanceof SignatureAlgorithm) {
- final SignatureAlgorithm sigAlg = (SignatureAlgorithm) descriptor;
+ if (descriptor instanceof SignatureAlgorithm sigAlg) {
signatureAlgorithms.remove(new SignatureAlgorithmIndex(sigAlg.getKey(), sigAlg.getDigest()));
}
}
@@ -301,7 +297,7 @@ public class AlgorithmRegistry {
* @return true if runtime supports the algorithm, false otherwise
*/
// Checkstyle: CyclomaticComplexity OFF
- private boolean checkRuntimeSupports(final AlgorithmDescriptor descriptor) {
+ private boolean checkRuntimeSupports(@Nonnull final AlgorithmDescriptor descriptor) {
try {
switch(descriptor.getType()) {
@@ -359,7 +355,7 @@ public class AlgorithmRegistry {
* @return true if key length supported, false otherwise
* @throws NoSuchAlgorithmException if the associated JCA algorithm is not supported by the runtime
*/
- private boolean checkCipherSupportedKeyLength(final AlgorithmDescriptor descriptor)
+ private boolean checkCipherSupportedKeyLength(@Nonnull final AlgorithmDescriptor descriptor)
throws NoSuchAlgorithmException {
if (descriptor instanceof KeyLengthSpecifiedAlgorithm) {
final int algoLength = ((KeyLengthSpecifiedAlgorithm)descriptor).getKeyLength();
@@ -380,7 +376,7 @@ public class AlgorithmRegistry {
*
* @return true if algorithm is supported by the runtime environment, false otherwise
*/
- private boolean checkSpecialCasesRuntimeSupport(final AlgorithmDescriptor descriptor) {
+ private boolean checkSpecialCasesRuntimeSupport(@Nonnull final AlgorithmDescriptor descriptor) {
log.trace("Checking runtime support failure for special cases: {}", descriptor.getURI());
try {
// Per Santuario XMLCipher: Some JDKs don't support RSA/ECB/OAEPPadding.
@@ -405,10 +401,10 @@ public class AlgorithmRegistry {
protected class SignatureAlgorithmIndex {
/** Key type. */
- private String key;
+ @Nonnull private String key;
/** Digest type. */
- private String digest;
+ @Nonnull private String digest;
/**
* Constructor.
@@ -417,8 +413,8 @@ public class AlgorithmRegistry {
* @param digestType the digest type
*/
public SignatureAlgorithmIndex(@Nonnull final String keyType, @Nonnull final String digestType) {
- key = StringSupport.trim(keyType);
- digest = StringSupport.trim(digestType);
+ key = Constraint.isNotNull(StringSupport.trim(keyType), "Key type was null");
+ digest = Constraint.isNotNull(StringSupport.trim(digestType), "Digest type was null");
}
/** {@inheritDoc} */
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/BlockEncryptionAlgorithm.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/BlockEncryptionAlgorithm.java
index a4f62fb14..ad6908412 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/BlockEncryptionAlgorithm.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/BlockEncryptionAlgorithm.java
@@ -31,13 +31,13 @@ public interface BlockEncryptionAlgorithm extends KeySpecifiedAlgorithm, KeyLeng
*
* @return the cipher mode
*/
- @Nonnull @NotEmpty public String getCipherMode();
+ @Nonnull @NotEmpty String getCipherMode();
/**
* Get the JCA padding algorithm specified by this algorithm.
*
* @return the padding algorithm
*/
- @Nonnull @NotEmpty public String getPadding();
+ @Nonnull @NotEmpty String getPadding();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyLengthSpecifiedAlgorithm.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyLengthSpecifiedAlgorithm.java
index 89a37f116..246774b46 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyLengthSpecifiedAlgorithm.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyLengthSpecifiedAlgorithm.java
@@ -29,6 +29,6 @@ public interface KeyLengthSpecifiedAlgorithm extends AlgorithmDescriptor {
*
* @return the specified key length
*/
- @Nonnull public Integer getKeyLength();
+ @Nonnull Integer getKeyLength();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeySpecifiedAlgorithm.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeySpecifiedAlgorithm.java
index 06b4dc52b..5d6eeac87 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeySpecifiedAlgorithm.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeySpecifiedAlgorithm.java
@@ -31,6 +31,6 @@ public interface KeySpecifiedAlgorithm extends AlgorithmDescriptor {
*
* @return the key type
*/
- @Nonnull @NotEmpty public String getKey();
+ @Nonnull @NotEmpty String getKey();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyTransportAlgorithm.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyTransportAlgorithm.java
index 66945f33c..cd59ded58 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyTransportAlgorithm.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/KeyTransportAlgorithm.java
@@ -31,13 +31,13 @@ public interface KeyTransportAlgorithm extends KeySpecifiedAlgorithm {
*
* @return the cipher mode
*/
- @Nonnull @NotEmpty public String getCipherMode();
+ @Nonnull @NotEmpty String getCipherMode();
/**
* Get the JCA padding algorithm specified by this algorithm.
*
* @return the padding algorithm
*/
- @Nonnull @NotEmpty public String getPadding();
+ @Nonnull @NotEmpty String getPadding();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/MACAlgorithm.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/MACAlgorithm.java
index f45028d1c..2be3cf72a 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/MACAlgorithm.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/MACAlgorithm.java
@@ -31,7 +31,6 @@ public interface MACAlgorithm extends AlgorithmDescriptor {
*
* @return the digest algorithm
*/
- @Nonnull @NotEmpty public String getDigest();
+ @Nonnull @NotEmpty String getDigest();
-
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/SignatureAlgorithm.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/SignatureAlgorithm.java
index c93ebdd6a..1e1035f84 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/SignatureAlgorithm.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/algorithm/SignatureAlgorithm.java
@@ -32,6 +32,6 @@ public interface SignatureAlgorithm extends KeySpecifiedAlgorithm {
*
* @return the digest algorithm
*/
- @Nonnull @NotEmpty public String getDigest();
+ @Nonnull @NotEmpty String getDigest();
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/BasicXMLSecurityConfiguration.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/BasicXMLSecurityConfiguration.java
index e54a59d59..39afc9a6f 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/BasicXMLSecurityConfiguration.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/BasicXMLSecurityConfiguration.java
@@ -49,13 +49,6 @@ public class BasicXMLSecurityConfiguration extends BasicSecurityConfiguration im
/** Configuration used when encrypting protocol message information. */
@Nullable private EncryptionConfiguration encryptConfig;
- /**
- * Default constructor.
- */
- public BasicXMLSecurityConfiguration() {
-
- }
-
/**
* Constructor.
*
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/DecryptionParserPool.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/DecryptionParserPool.java
index 40357a509..385b77a46 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/DecryptionParserPool.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/DecryptionParserPool.java
@@ -31,7 +31,7 @@ import net.shibboleth.shared.xml.ParserPool;
public class DecryptionParserPool {
/** The wrapped parser pool instance. */
- private ParserPool parserPool;
+ @Nonnull private ParserPool parserPool;
/**
* Constructor.
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalAlgorithmRegistryInitializer.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalAlgorithmRegistryInitializer.java
index c93109463..d5ca26af7 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalAlgorithmRegistryInitializer.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalAlgorithmRegistryInitializer.java
@@ -20,13 +20,16 @@ package org.opensaml.xmlsec.config;
import java.util.Iterator;
import java.util.ServiceLoader;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.config.InitializationException;
import org.opensaml.core.config.Initializer;
import org.opensaml.xmlsec.algorithm.AlgorithmDescriptor;
import org.opensaml.xmlsec.algorithm.AlgorithmRegistry;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import net.shibboleth.shared.primitive.LoggerFactory;
/**
* OpenSAML {@link Initializer} implementation for algorithms.
@@ -34,7 +37,7 @@ import org.slf4j.LoggerFactory;
public class GlobalAlgorithmRegistryInitializer implements Initializer {
/** Logger. */
- private Logger log = LoggerFactory.getLogger(GlobalAlgorithmRegistryInitializer.class);
+ @Nonnull private Logger log = LoggerFactory.getLogger(GlobalAlgorithmRegistryInitializer.class);
/** {@inheritDoc} */
public void init() throws InitializationException {
@@ -52,4 +55,4 @@ public class GlobalAlgorithmRegistryInitializer implements Initializer {
ConfigurationService.register(AlgorithmRegistry.class, algorithmRegistry);
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalKeyAgreementProcessorRegistryInitializer.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalKeyAgreementProcessorRegistryInitializer.java
index 295fa1f5d..21768c0d8 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalKeyAgreementProcessorRegistryInitializer.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/config/GlobalKeyAgreementProcessorRegistryInitializer.java
@@ -20,13 +20,16 @@ package org.opensaml.xmlsec.config;
import java.util.Iterator;
import java.util.ServiceLoader;
+import javax.annotation.Nonnull;
+
import org.opensaml.core.config.ConfigurationService;
import org.opensaml.core.config.InitializationException;
import org.opensaml.core.config.Initializer;
import org.opensaml.xmlsec.agreement.KeyAgreementProcessor;
import org.opensaml.xmlsec.agreement.KeyAgreementProcessorRegistry;
import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+
+import net.shibboleth.shared.primitive.LoggerFactory;
/**
* OpenSAML {@link Initializer} implementation for key agreement processors.
@@ -34,7 +37,7 @@ import org.slf4j.LoggerFactory;
public class GlobalKeyAgreementProcessorRegistryInitializer implements Initializer {
/** Logger. */
- private Logger log = LoggerFactory.getLogger(GlobalKeyAgreementProcessorRegistryInitializer.class);
+ @Nonnull private Logger log = LoggerFactory.getLogger(GlobalKeyAgreementProcessorRegistryInitializer.class);
/** {@inheritDoc} */
public void init() throws InitializationException {
@@ -52,4 +55,4 @@ public class GlobalKeyAgreementProcessorRegistryInitializer implements Initializ
ConfigurationService.register(KeyAgreementProcessorRegistry.class, registry);
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/DecryptionConfigurationCriterion.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/DecryptionConfigurationCriterion.java
index 388231dc1..03ecef98e 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/DecryptionConfigurationCriterion.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/DecryptionConfigurationCriterion.java
@@ -25,6 +25,7 @@ import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.resolver.Criterion;
@@ -45,7 +46,8 @@ public class DecryptionConfigurationCriterion implements Criterion {
*/
public DecryptionConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
List<DecryptionConfiguration> configurations) {
- configs = List.copyOf(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.copyToList(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
@@ -57,7 +59,8 @@ public class DecryptionConfigurationCriterion implements Criterion {
*/
public DecryptionConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
DecryptionConfiguration... configurations) {
- configs = List.of(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.listOf(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
@@ -105,4 +108,4 @@ public class DecryptionConfigurationCriterion implements Criterion {
return false;
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionConfigurationCriterion.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionConfigurationCriterion.java
index 2109005fa..7d3913ab0 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionConfigurationCriterion.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionConfigurationCriterion.java
@@ -25,6 +25,7 @@ import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.resolver.Criterion;
@@ -45,7 +46,8 @@ public class EncryptionConfigurationCriterion implements Criterion {
*/
public EncryptionConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
List<EncryptionConfiguration> configurations) {
- configs = List.copyOf(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.copyToList(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
@@ -57,7 +59,8 @@ public class EncryptionConfigurationCriterion implements Criterion {
*/
public EncryptionConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
EncryptionConfiguration... configurations) {
- configs = List.of(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.listOf(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionOptionalCriterion.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionOptionalCriterion.java
index f3d4768b8..b35402be7 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionOptionalCriterion.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/EncryptionOptionalCriterion.java
@@ -19,6 +19,8 @@ package org.opensaml.xmlsec.criterion;
import java.util.Objects;
+import javax.annotation.Nonnull;
+
import com.google.common.base.MoreObjects;
import net.shibboleth.shared.resolver.Criterion;
@@ -31,7 +33,7 @@ import net.shibboleth.shared.resolver.Criterion;
public class EncryptionOptionalCriterion implements Criterion {
/** The encryptionOptional criterion value. */
- private Boolean encryptionOptional;
+ @Nonnull private Boolean encryptionOptional;
/**
* Constructor.
@@ -82,4 +84,4 @@ public class EncryptionOptionalCriterion implements Criterion {
.addValue(encryptionOptional).toString();
}
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureSigningConfigurationCriterion.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureSigningConfigurationCriterion.java
index a063062d6..2815c9058 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureSigningConfigurationCriterion.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureSigningConfigurationCriterion.java
@@ -25,6 +25,7 @@ import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.resolver.Criterion;
@@ -45,7 +46,8 @@ public class SignatureSigningConfigurationCriterion implements Criterion {
*/
public SignatureSigningConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
List<SignatureSigningConfiguration> configurations) {
- configs = List.copyOf(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.copyToList(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
@@ -57,7 +59,8 @@ public class SignatureSigningConfigurationCriterion implements Criterion {
*/
public SignatureSigningConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
SignatureSigningConfiguration... configurations) {
- configs = List.of(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.listOf(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureValidationConfigurationCriterion.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureValidationConfigurationCriterion.java
index 17986f7c5..084a4c04c 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureValidationConfigurationCriterion.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/criterion/SignatureValidationConfigurationCriterion.java
@@ -25,6 +25,7 @@ import net.shibboleth.shared.annotation.constraint.NonnullElements;
import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.annotation.constraint.NotLive;
import net.shibboleth.shared.annotation.constraint.Unmodifiable;
+import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.logic.Constraint;
import net.shibboleth.shared.resolver.Criterion;
@@ -45,7 +46,8 @@ public class SignatureValidationConfigurationCriterion implements Criterion {
*/
public SignatureValidationConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
List<SignatureValidationConfiguration> configurations) {
- configs = List.copyOf(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.copyToList(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
@@ -57,7 +59,8 @@ public class SignatureValidationConfigurationCriterion implements Criterion {
*/
public SignatureValidationConfigurationCriterion(@Nonnull @NonnullElements @NotEmpty final
SignatureValidationConfiguration... configurations) {
- configs = List.of(Constraint.isNotNull(configurations, "List of configurations cannot be null"));
+ configs = CollectionSupport.listOf(
+ Constraint.isNotNull(configurations, "List of configurations cannot be null"));
Constraint.isNotEmpty(configs, "At least one configuration is required");
}
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/derivation/KeyDerivation.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/derivation/KeyDerivation.java
index b868eb5f7..b2e2f59a3 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/derivation/KeyDerivation.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/derivation/KeyDerivation.java
@@ -39,7 +39,7 @@ public interface KeyDerivation extends KeyAgreementParameter {
*
* @return the algorithm
*/
- @Nonnull public String getAlgorithm();
+ @Nonnull String getAlgorithm();
/**
* Derive a {@link SecretKey} from the specified secret.
@@ -55,7 +55,7 @@ public interface KeyDerivation extends KeyAgreementParameter {
*
* @throws KeyDerivationException if the key derivation operation is not completed successfully
*/
- @Nonnull public SecretKey derive(@Nonnull final byte[] secret, @Nonnull final String keyAlgorithm,
+ @Nonnull SecretKey derive(@Nonnull final byte[] secret, @Nonnull final String keyAlgorithm,
@Nullable final Integer keyLength) throws KeyDerivationException;
-}
+}
\ No newline at end of file
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java
index 29c33bbf9..6b44d601e 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/keyinfo/KeyInfoSupport.java
@@ -104,7 +104,7 @@ import net.shibboleth.shared.primitive.LoggerFactory;
* Methods are provided for converting the representation stored in the XMLTooling KeyInfo to Java java.security native
* types, and for storing these Java native types inside a KeyInfo.
*/
-public class KeyInfoSupport {
+public final class KeyInfoSupport {
/** Logger. */
@Nonnull private static final Logger LOG = LoggerFactory.getLogger(KeyInfoSupport.class);
@@ -115,7 +115,7 @@ public class KeyInfoSupport {
private static CertificateFactory x509CertFactory;
/** Constructor. */
- protected KeyInfoSupport() {
+ private KeyInfoSupport() {
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list