[java-opensaml] branch main updated: Add some annotations.
Scott Cantor
cantor.2 at osu.edu
Mon Nov 14 16:05:26 UTC 2022
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=4d3ebb53655f0cf6670b9b2a9b4844d119ca8ed8
The following commit(s) were added to refs/heads/main by this push:
new 4d3ebb536 Add some annotations.
4d3ebb536 is described below
commit 4d3ebb53655f0cf6670b9b2a9b4844d119ca8ed8
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Mon Nov 14 11:05:23 2022 -0500
Add some annotations.
---
.../org/opensaml/saml/ext/saml2alg/DigestMethod.java | 13 ++++++++-----
.../org/opensaml/saml/ext/saml2alg/SigningMethod.java | 17 ++++++++++-------
.../saml/ext/saml2mdattr/EntityAttributes.java | 11 +++++++----
.../opensaml/saml/saml2/metadata/IDPSSODescriptor.java | 13 ++++++++-----
.../opensaml/saml/saml2/metadata/SPSSODescriptor.java | 15 +++++++++------
.../opensaml/security/x509/BasicX509Credential.java | 18 +++++++++---------
.../org/opensaml/security/x509/X509Credential.java | 6 ++++--
.../opensaml/core/testing/XMLObjectBaseTestCase.java | 5 +++--
.../xmlsec/encryption/AlgorithmIdentifierType.java | 9 ++++++---
.../main/java/org/opensaml/xmlsec/encryption/MGF.java | 11 +++++++----
.../org/opensaml/xmlsec/signature/DigestMethod.java | 13 ++++++++-----
11 files changed, 79 insertions(+), 52 deletions(-)
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/DigestMethod.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/DigestMethod.java
index 2022e544f..7f522c100 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/DigestMethod.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/DigestMethod.java
@@ -17,6 +17,7 @@
package org.opensaml.saml.ext.saml2alg;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.namespace.QName;
@@ -24,25 +25,27 @@ import org.opensaml.core.xml.ElementExtensibleXMLObject;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/** SAML v2.0 Metadata Profile for Algorithm Support Version 1.0 DigestMethod SAMLObject. */
public interface DigestMethod extends SAMLObject, ElementExtensibleXMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "DigestMethod";
+ @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "DigestMethod";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME =
+ @Nonnull public static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.SAML20ALG_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20ALG_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "DigestMethodType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "DigestMethodType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME =
+ @Nonnull public static final QName TYPE_NAME =
new QName(SAMLConstants.SAML20ALG_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20ALG_PREFIX);
/** Algorithm attribute name. */
- public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
+ @Nonnull @NotEmpty public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
/**
* Get the value of the Algorithm URI attribute.
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/SigningMethod.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/SigningMethod.java
index 261e2de63..d869d3cc6 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/SigningMethod.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2alg/SigningMethod.java
@@ -17,6 +17,7 @@
package org.opensaml.saml.ext.saml2alg;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.namespace.QName;
@@ -24,31 +25,33 @@ import org.opensaml.core.xml.ElementExtensibleXMLObject;
import org.opensaml.saml.common.SAMLObject;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/** SAML v2.0 Metadata Profile for Algorithm Support Version 1.0 SigningMethod SAMLObject. */
public interface SigningMethod extends SAMLObject, ElementExtensibleXMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SigningMethod";
+ @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SigningMethod";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME =
+ @Nonnull public static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.SAML20ALG_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20ALG_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "SigningMethodType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "SigningMethodType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME =
+ @Nonnull public static final QName TYPE_NAME =
new QName(SAMLConstants.SAML20ALG_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20ALG_PREFIX);
/** Algorithm attribute name. */
- public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
+ @Nonnull @NotEmpty public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
/** MinKeySize attribute name. */
- public static final String MIN_KEY_SIZE_ATTRIB_NAME = "MinKeySize";
+ @Nonnull @NotEmpty public static final String MIN_KEY_SIZE_ATTRIB_NAME = "MinKeySize";
/** MaxKeySize attribute name. */
- public static final String MAX_KEY_SIZE_ATTRIB_NAME = "MaxKeySize";
+ @Nonnull @NotEmpty public static final String MAX_KEY_SIZE_ATTRIB_NAME = "MaxKeySize";
/**
* Get the value of the Algorithm URI attribute.
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdattr/EntityAttributes.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdattr/EntityAttributes.java
index 3ae20fe9d..0707cbcf4 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdattr/EntityAttributes.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/ext/saml2mdattr/EntityAttributes.java
@@ -19,6 +19,7 @@ package org.opensaml.saml.ext.saml2mdattr;
import java.util.List;
+import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
import org.opensaml.saml.common.SAMLObject;
@@ -26,21 +27,23 @@ import org.opensaml.saml.common.xml.SAMLConstants;
import org.opensaml.saml.saml2.core.Assertion;
import org.opensaml.saml.saml2.core.Attribute;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/** SAML V2.0 Metadata Extension for Entity Attributes EntityAttributes SAML object. */
public interface EntityAttributes extends SAMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "EntityAttributes";
+ @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "EntityAttributes";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME =
+ @Nonnull public static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.SAML20MDATTR_NS, DEFAULT_ELEMENT_LOCAL_NAME, SAMLConstants.SAML20MDATTR_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "EntityAttributesType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "EntityAttributesType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME =
+ @Nonnull public static final QName TYPE_NAME =
new QName(SAMLConstants.SAML20MDATTR_NS, TYPE_LOCAL_NAME, SAMLConstants.SAML20MDATTR_PREFIX);
/**
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/IDPSSODescriptor.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/IDPSSODescriptor.java
index 0992839e5..94a76020a 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/IDPSSODescriptor.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/IDPSSODescriptor.java
@@ -19,33 +19,36 @@ package org.opensaml.saml.saml2.metadata;
import java.util.List;
+import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.common.xml.SAMLConstants;
import org.opensaml.saml.saml2.core.Attribute;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Metadata IDPSSODescriptorType.
*/
public interface IDPSSODescriptor extends SSODescriptor {
/** Local name, no namespace. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "IDPSSODescriptor";
+ @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "IDPSSODescriptor";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20MD_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ @Nonnull public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20MD_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20MD_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "IDPSSODescriptorType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "IDPSSODescriptorType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MD_NS, TYPE_LOCAL_NAME,
+ @Nonnull public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MD_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20MD_PREFIX);
/** "WantAuthnRequestSigned" attribute name. */
- public static final String WANT_AUTHN_REQ_SIGNED_ATTRIB_NAME = "WantAuthnRequestsSigned";
+ @Nonnull @NotEmpty public static final String WANT_AUTHN_REQ_SIGNED_ATTRIB_NAME = "WantAuthnRequestsSigned";
/**
* Checks if the IDP SSO service wants authentication requests signed.
diff --git a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/SPSSODescriptor.java b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/SPSSODescriptor.java
index f15f694fa..18c703241 100644
--- a/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/SPSSODescriptor.java
+++ b/opensaml-saml-api/src/main/java/org/opensaml/saml/saml2/metadata/SPSSODescriptor.java
@@ -19,34 +19,37 @@ package org.opensaml.saml.saml2.metadata;
import java.util.List;
+import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.schema.XSBooleanValue;
import org.opensaml.saml.common.xml.SAMLConstants;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/**
* SAML 2.0 Metadata SPSSODescriptorType.
*/
public interface SPSSODescriptor extends SSODescriptor {
/** Element name, no namespace. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SPSSODescriptor";
+ @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "SPSSODescriptor";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20MD_NS, DEFAULT_ELEMENT_LOCAL_NAME,
+ @Nonnull public static final QName DEFAULT_ELEMENT_NAME = new QName(SAMLConstants.SAML20MD_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.SAML20MD_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "SPSSODescriptorType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "SPSSODescriptorType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MD_NS, TYPE_LOCAL_NAME,
+ @Nonnull public static final QName TYPE_NAME = new QName(SAMLConstants.SAML20MD_NS, TYPE_LOCAL_NAME,
SAMLConstants.SAML20MD_PREFIX);
/** "AuthnRequestsSigned" attribute's local name. */
- public static final String AUTH_REQUESTS_SIGNED_ATTRIB_NAME = "AuthnRequestsSigned";
+ @Nonnull @NotEmpty public static final String AUTH_REQUESTS_SIGNED_ATTRIB_NAME = "AuthnRequestsSigned";
/** "WantAssertionsSigned" attribute's local name. */
- public static final String WANT_ASSERTIONS_SIGNED_ATTRIB_NAME = "WantAssertionsSigned";
+ @Nonnull @NotEmpty public static final String WANT_ASSERTIONS_SIGNED_ATTRIB_NAME = "WantAssertionsSigned";
/**
* Gets whether this service signs AuthN requests.
diff --git a/opensaml-security-api/src/main/java/org/opensaml/security/x509/BasicX509Credential.java b/opensaml-security-api/src/main/java/org/opensaml/security/x509/BasicX509Credential.java
index 51fc6caf3..f50fe01d8 100644
--- a/opensaml-security-api/src/main/java/org/opensaml/security/x509/BasicX509Credential.java
+++ b/opensaml-security-api/src/main/java/org/opensaml/security/x509/BasicX509Credential.java
@@ -32,6 +32,8 @@ import org.opensaml.security.credential.BasicCredential;
import org.opensaml.security.credential.Credential;
import net.shibboleth.shared.annotation.ParameterName;
+import net.shibboleth.shared.annotation.constraint.NonnullElements;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
import net.shibboleth.shared.collection.LazySet;
import net.shibboleth.shared.logic.Constraint;
@@ -41,13 +43,13 @@ import net.shibboleth.shared.logic.Constraint;
public class BasicX509Credential extends BasicCredential implements X509Credential {
/** Entity certificate. */
- private X509Certificate entityCert;
+ @Nonnull private X509Certificate entityCert;
/** Entity certificate chain, must include entity certificate. */
- private Collection<X509Certificate> entityCertChain;
+ @Nullable @NonnullElements private Collection<X509Certificate> entityCertChain;
/** CRLs for this credential. */
- private Collection<X509CRL> crls;
+ @Nullable @NonnullElements private Collection<X509CRL> crls;
/**
* Constructor.
@@ -56,7 +58,6 @@ public class BasicX509Credential extends BasicCredential implements X509Credenti
*/
public BasicX509Credential(
@Nonnull @ParameterName(name="entityCertificate") final X509Certificate entityCertificate) {
- super();
setEntityCertificate(entityCertificate);
}
@@ -69,7 +70,6 @@ public class BasicX509Credential extends BasicCredential implements X509Credenti
public BasicX509Credential(
@Nonnull @ParameterName(name="entityCertificate") final X509Certificate entityCertificate,
@ParameterName(name="privateKey") @Nonnull final PrivateKey privateKey) {
- super();
setEntityCertificate(entityCertificate);
setPrivateKey(privateKey);
}
@@ -82,7 +82,7 @@ public class BasicX509Credential extends BasicCredential implements X509Credenti
/** {@inheritDoc} */
@Override
- @Nullable public Collection<X509CRL> getCRLs() {
+ @Nullable @NonnullElements public Collection<X509CRL> getCRLs() {
return crls;
}
@@ -91,7 +91,7 @@ public class BasicX509Credential extends BasicCredential implements X509Credenti
*
* @param newCRLs CRLs for this credential
*/
- public void setCRLs(@Nullable final Collection<X509CRL> newCRLs) {
+ public void setCRLs(@Nullable @NonnullElements final Collection<X509CRL> newCRLs) {
crls = newCRLs;
}
@@ -130,7 +130,7 @@ public class BasicX509Credential extends BasicCredential implements X509Credenti
/** {@inheritDoc} */
@Override
- @Nonnull public Collection<X509Certificate> getEntityCertificateChain() {
+ @Nonnull @NonnullElements public Collection<X509Certificate> getEntityCertificateChain() {
if (entityCertChain == null) {
final LazySet<X509Certificate> constructedChain = new LazySet<>();
constructedChain.add(entityCert);
@@ -145,7 +145,7 @@ public class BasicX509Credential extends BasicCredential implements X509Credenti
*
* @param newCertificateChain entity certificate chain for this credential
*/
- public void setEntityCertificateChain(@Nonnull final Collection<X509Certificate> newCertificateChain) {
+ public void setEntityCertificateChain(@Nonnull @NotEmpty @NonnullElements final Collection<X509Certificate> newCertificateChain) {
Constraint.isNotNull(newCertificateChain, "Certificate chain collection cannot be null");
Constraint.isNotEmpty(newCertificateChain, "Certificate chain collection cannot be empty");
entityCertChain = new ArrayList<>(newCertificateChain);
diff --git a/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Credential.java b/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Credential.java
index 8160bde91..2045868c5 100644
--- a/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Credential.java
+++ b/opensaml-security-api/src/main/java/org/opensaml/security/x509/X509Credential.java
@@ -26,6 +26,8 @@ import javax.annotation.Nullable;
import org.opensaml.security.credential.Credential;
+import net.shibboleth.shared.annotation.constraint.NonnullElements;
+
/**
* An entity credential based on key material and other information (e.g. certificates and certificate
* revocation lists) associated with X.509 Public Key Infrastructure.
@@ -49,12 +51,12 @@ public interface X509Credential extends Credential {
*
* @return entities certificate chain
*/
- @Nonnull public Collection<X509Certificate> getEntityCertificateChain();
+ @Nonnull @NonnullElements public Collection<X509Certificate> getEntityCertificateChain();
/**
* Gets a collection of CRLs associated with the credential.
*
* @return CRLs associated with the credential
*/
- @Nullable public Collection<X509CRL> getCRLs();
+ @Nullable @NonnullElements public Collection<X509CRL> getCRLs();
}
\ No newline at end of file
diff --git a/opensaml-testing/src/main/java/org/opensaml/core/testing/XMLObjectBaseTestCase.java b/opensaml-testing/src/main/java/org/opensaml/core/testing/XMLObjectBaseTestCase.java
index c3e8e23b3..659771bb6 100644
--- a/opensaml-testing/src/main/java/org/opensaml/core/testing/XMLObjectBaseTestCase.java
+++ b/opensaml-testing/src/main/java/org/opensaml/core/testing/XMLObjectBaseTestCase.java
@@ -22,6 +22,7 @@ import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.XMLObject;
@@ -153,7 +154,7 @@ public abstract class XMLObjectBaseTestCase extends OpenSAMLInitBaseTestCase {
*
* @return the XMLObject from the file
*/
- protected <T extends XMLObject> T unmarshallElement(String elementFile) {
+ @Nullable protected <T extends XMLObject> T unmarshallElement(String elementFile) {
try {
return unmarshallElement(elementFile, false);
} catch (XMLParserException | UnmarshallingException e) {
@@ -175,7 +176,7 @@ public abstract class XMLObjectBaseTestCase extends OpenSAMLInitBaseTestCase {
* @throws XMLParserException ...
* @throws UnmarshallingException ...
*/
- protected <T extends XMLObject> T unmarshallElement(String elementFile, boolean propagateErrors)
+ @Nullable protected <T extends XMLObject> T unmarshallElement(String elementFile, boolean propagateErrors)
throws XMLParserException, UnmarshallingException {
try {
final Document doc = parseXMLDocument(elementFile);
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/AlgorithmIdentifierType.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/AlgorithmIdentifierType.java
index f950650a1..e9783ec9f 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/AlgorithmIdentifierType.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/AlgorithmIdentifierType.java
@@ -17,26 +17,29 @@
package org.opensaml.xmlsec.encryption;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.namespace.QName;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.xmlsec.encryption.support.EncryptionConstants;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/**
* XMLObject representing XML Encryption, version 1.1, AlgorithmIdentifierType complex type.
*/
public interface AlgorithmIdentifierType extends XMLObject {
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "AlgorithmIdentifierType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "AlgorithmIdentifierType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(EncryptionConstants.XMLENC11_NS, TYPE_LOCAL_NAME,
+ @Nonnull public static final QName TYPE_NAME = new QName(EncryptionConstants.XMLENC11_NS, TYPE_LOCAL_NAME,
EncryptionConstants.XMLENC11_PREFIX);
/** Algorithm attribute name. */
- public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
+ @Nonnull @NotEmpty public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
/**
* Gets the algorithm URI attribute.
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/MGF.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/MGF.java
index ce03d1733..5f20a3bf1 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/MGF.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/encryption/MGF.java
@@ -17,27 +17,30 @@
package org.opensaml.xmlsec.encryption;
+import javax.annotation.Nonnull;
import javax.xml.namespace.QName;
import org.opensaml.xmlsec.encryption.support.EncryptionConstants;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/**
* XMLObject representing XML Encryption, version 1.1, MGF element.
*/
public interface MGF extends AlgorithmIdentifierType {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "MGF";
+ @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "MGF";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(EncryptionConstants.XMLENC11_NS,
+ @Nonnull public static final QName DEFAULT_ELEMENT_NAME = new QName(EncryptionConstants.XMLENC11_NS,
DEFAULT_ELEMENT_LOCAL_NAME, EncryptionConstants.XMLENC11_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "MGFType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "MGFType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(EncryptionConstants.XMLENC11_NS, TYPE_LOCAL_NAME,
+ @Nonnull public static final QName TYPE_NAME = new QName(EncryptionConstants.XMLENC11_NS, TYPE_LOCAL_NAME,
EncryptionConstants.XMLENC11_PREFIX);
}
diff --git a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/signature/DigestMethod.java b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/signature/DigestMethod.java
index f28714afb..cd0f077b2 100644
--- a/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/signature/DigestMethod.java
+++ b/opensaml-xmlsec-api/src/main/java/org/opensaml/xmlsec/signature/DigestMethod.java
@@ -17,6 +17,7 @@
package org.opensaml.xmlsec.signature;
+import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import javax.xml.namespace.QName;
@@ -24,27 +25,29 @@ import org.opensaml.core.xml.ElementExtensibleXMLObject;
import org.opensaml.core.xml.XMLObject;
import org.opensaml.xmlsec.signature.support.SignatureConstants;
+import net.shibboleth.shared.annotation.constraint.NotEmpty;
+
/**
* XMLObject representing XML Digital Signature, version 20020212, DigestMethod element.
*/
public interface DigestMethod extends XMLObject, ElementExtensibleXMLObject {
/** Element local name. */
- public static final String DEFAULT_ELEMENT_LOCAL_NAME = "DigestMethod";
+ @Nonnull @NotEmpty public static final String DEFAULT_ELEMENT_LOCAL_NAME = "DigestMethod";
/** Default element name. */
- public static final QName DEFAULT_ELEMENT_NAME = new QName(SignatureConstants.XMLSIG_NS,
+ @Nonnull public static final QName DEFAULT_ELEMENT_NAME = new QName(SignatureConstants.XMLSIG_NS,
DEFAULT_ELEMENT_LOCAL_NAME, SignatureConstants.XMLSIG_PREFIX);
/** Local name of the XSI type. */
- public static final String TYPE_LOCAL_NAME = "DigestMethodType";
+ @Nonnull @NotEmpty public static final String TYPE_LOCAL_NAME = "DigestMethodType";
/** QName of the XSI type. */
- public static final QName TYPE_NAME = new QName(SignatureConstants.XMLSIG_NS, TYPE_LOCAL_NAME,
+ @Nonnull public static final QName TYPE_NAME = new QName(SignatureConstants.XMLSIG_NS, TYPE_LOCAL_NAME,
SignatureConstants.XMLSIG_PREFIX);
/** Algorithm attribute name. */
- public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
+ @Nonnull @NotEmpty public static final String ALGORITHM_ATTRIB_NAME = "Algorithm";
/**
* Get the Algorithm URI attribute value.
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list