[java-metadata-aggregator COMMIT] /trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSi...
noreply at shibboleth.net
noreply at shibboleth.net
Wed Mar 28 15:43:44 BST 2012
Author: lajoie
Date: Wed Mar 28 15:43:44 2012
New Revision: 208
URL: http://svn.shibboleth.net/view/java-metadata-aggregator?rev=208&view=rev
Log:
Add a basic list of ID attribute names
Modified:
trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java
Modified: trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java
URL: http://svn.shibboleth.net/view/java-metadata-aggregator/trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java?rev=208&r1=207&r2=208&view=diff
==============================================================================
--- trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java (original)
+++ trunk/aggregator-pipeline/src/main/java/net/shibboleth/metadata/dom/XMLSignatureSigningStage.java Wed Mar 28 15:43:44 2012
@@ -70,6 +70,7 @@
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
+import com.google.common.collect.Lists;
/**
* A pipeline stage that creates, and adds, an enveloped signature for each element in the given {@link DomElementItem}
@@ -166,10 +167,10 @@
* Certificate chain, with end entity certificate as element 0, to be included with the signature. Default value:
* empty list
*/
- private List<X509Certificate> certificates = Collections.emptyList();
+ private List<X509Certificate> certificates;
/** CRLs to be included with the signature. Default value: empty list */
- private List<X509CRL> crls = Collections.emptyList();
+ private List<X509CRL> crls;
/** Signature algorithm used. */
private String sigAlgo;
@@ -178,7 +179,7 @@
private String digestAlgo;
/** Whether to use exclusive canonicalization. Default value: <code>true</code> */
- private boolean c14nExclusive = true;
+ private boolean c14nExclusive;
/** Whether to include comments in the canonicalized data. Default value: <code>false</code> */
private boolean c14nWithComments;
@@ -190,22 +191,25 @@
private String c14nAlgo;
/** Inclusive prefix list used with exclusive canonicalization. Default value: empty list */
- private List<String> inclusivePrefixList = Collections.emptyList();
-
- /** Names of attributes to treat as ID attributes for signature referencing. Default value: empty list */
- private List<QName> idAttributeNames = Collections.emptyList();
+ private List<String> inclusivePrefixList;
+
+ /**
+ * Names of attributes to treat as ID attributes for signature referencing. Default value: list containing the
+ * non-namespace-qualified attributes 'ID', 'Id', 'id'
+ */
+ private List<QName> idAttributeNames;
/** Explicit names to associate with the given signing key. Default value: empty list */
- private List<String> keyNames = Collections.emptyList();
+ private List<String> keyNames;
/**
* Whether additional key names should be derived from the end-entity certificate, if present. Default value:
* <code>true</code>
*/
- private boolean deriveKeyNames = true;
+ private boolean deriveKeyNames;
/** Whether key names should be included in the signature's KeyInfo. Default value: <code>true</code> */
- private boolean includeKeyNames = true;
+ private boolean includeKeyNames;
/** Whether the public key should be included in the signature's KeyInfo. Default value: <code>false</code> */
private boolean includeKeyValue;
@@ -219,7 +223,7 @@
/**
* Whether the certificates chain should be included in the signature's KeyInfo. Default value: <code>true</code>
*/
- private boolean includeX509Certificates = true;
+ private boolean includeX509Certificates;
/** Whether the CRLs should be included in the signature's KeyInfo. Default value: <code>false</code> */
private boolean includeX509Crls;
@@ -230,6 +234,19 @@
*/
private boolean includeX509IssuerSerial;
+ public XMLSignatureSigningStage() {
+ shaVariant = ShaVariant.SHA256;
+ certificates = Collections.emptyList();
+ crls = Collections.emptyList();
+ c14nExclusive = true;
+ inclusivePrefixList = Collections.emptyList();
+ idAttributeNames = Lists.newArrayList(new QName("ID"), new QName("id"), new QName("Id"));
+ keyNames = Collections.emptyList();
+ deriveKeyNames = true;
+ includeKeyNames = true;
+ includeX509Certificates = true;
+ }
+
/**
* Gets the SHA algorithm variant used when computing the signature and digest.
*
@@ -247,7 +264,7 @@
public synchronized void setShaVariant(@Nonnull final ShaVariant variant) {
ComponentSupport.ifDestroyedThrowDestroyedComponentException(this);
ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
-
+
shaVariant = Assert.isNotNull(variant, "SHA variant can not be null");
}
@@ -268,7 +285,7 @@
[... 204 lines stripped ...]
More information about the commits
mailing list