You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by co...@apache.org on 2015/12/15 18:13:22 UTC
svn commit: r1720201 [7/24] - in /santuario/xml-security-java/trunk:
samples/javax/xml/crypto/dsig/samples/
samples/org/apache/xml/security/samples/
samples/org/apache/xml/security/samples/algorithms/
samples/org/apache/xml/security/samples/canonicaliz...
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Manifest.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Manifest.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Manifest.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Manifest.java Tue Dec 15 17:13:17 2015
@@ -50,7 +50,7 @@ import org.xml.sax.SAXException;
* <p> This element holds the <code>Reference</code> elements</p>
*/
public class Manifest extends SignatureElementProxy {
-
+
/**
* The maximum number of references per Manifest, if secure validation is enabled.
*/
@@ -71,7 +71,7 @@ public class Manifest extends SignatureE
/** Field perManifestResolvers */
private List<ResourceResolver> perManifestResolvers = null;
-
+
private boolean secureValidation;
/**
@@ -96,7 +96,7 @@ public class Manifest extends SignatureE
*/
public Manifest(Element element, String baseURI) throws XMLSecurityException {
this(element, baseURI, false);
-
+
}
/**
* Constructor Manifest
@@ -110,7 +110,7 @@ public class Manifest extends SignatureE
Element element, String baseURI, boolean secureValidation
) throws XMLSecurityException {
super(element, baseURI);
-
+
Attr attr = element.getAttributeNodeNS(null, "Id");
if (attr != null) {
element.setIdAttributeNode(attr, true);
@@ -118,7 +118,7 @@ public class Manifest extends SignatureE
this.secureValidation = secureValidation;
// check out Reference children
- this.referencesEl =
+ this.referencesEl =
XMLUtils.selectDsNodes(
getFirstChild(), Constants._TAG_REFERENCE
);
@@ -130,10 +130,10 @@ public class Manifest extends SignatureE
throw new DOMException(DOMException.WRONG_DOCUMENT_ERR,
I18n.translate("xml.WrongContent", exArgs));
}
-
+
if (secureValidation && le > MAXIMUM_REFERENCE_COUNT) {
Object exArgs[] = { le, MAXIMUM_REFERENCE_COUNT };
-
+
throw new XMLSecurityException("signature.tooManyReferences", exArgs);
}
@@ -156,9 +156,9 @@ public class Manifest extends SignatureE
* from the supplied values.
*
* @param baseURI the URI of the resource where the XML instance was stored
- * @param referenceURI <code>URI</code> attribute in <code>Reference</code> for specifying
+ * @param referenceURI <code>URI</code> attribute in <code>Reference</code> for specifying
* where data is
- * @param transforms org.apache.xml.security.signature.Transforms object with an ordered
+ * @param transforms org.apache.xml.security.signature.Transforms object with an ordered
* list of transformations to be performed.
* @param digestURI The digest algorithm URI to be used.
* @param referenceId
@@ -166,11 +166,11 @@ public class Manifest extends SignatureE
* @throws XMLSignatureException
*/
public void addDocument(
- String baseURI, String referenceURI, Transforms transforms,
+ String baseURI, String referenceURI, Transforms transforms,
String digestURI, String referenceId, String referenceType
) throws XMLSignatureException {
// the this.doc is handed implicitly by the this.getOwnerDocument()
- Reference ref =
+ Reference ref =
new Reference(getDocument(), baseURI, referenceURI, this, transforms, digestURI);
if (referenceId != null) {
@@ -225,8 +225,8 @@ public class Manifest extends SignatureE
*/
public Reference item(int i) throws XMLSecurityException {
if (this.references.get(i) == null) {
- // not yet constructed, so _we_ have to
- Reference ref =
+ // not yet constructed, so _we_ have to
+ Reference ref =
new Reference(referencesEl[i], this.baseURI, this, secureValidation);
this.references.set(i, ref);
@@ -266,8 +266,8 @@ public class Manifest extends SignatureE
* validations are available by using the {@link #getVerificationResult(int)} method
*
* @return true if all References verify, false if one or more do not verify.
- * @throws MissingResourceFailureException if a {@link Reference} does not verify
- * (throws a {@link org.apache.xml.security.signature.ReferenceNotInitializedException}
+ * @throws MissingResourceFailureException if a {@link Reference} does not verify
+ * (throws a {@link org.apache.xml.security.signature.ReferenceNotInitializedException}
* because of an uninitialized {@link XMLSignatureInput}
* @see org.apache.xml.security.signature.Reference#verify
* @see org.apache.xml.security.signature.SignedInfo#verify()
@@ -291,8 +291,8 @@ public class Manifest extends SignatureE
*
* @param followManifests
* @return true if all References verify, false if one or more do not verify.
- * @throws MissingResourceFailureException if a {@link Reference} does not verify
- * (throws a {@link org.apache.xml.security.signature.ReferenceNotInitializedException}
+ * @throws MissingResourceFailureException if a {@link Reference} does not verify
+ * (throws a {@link org.apache.xml.security.signature.ReferenceNotInitializedException}
* because of an uninitialized {@link XMLSignatureInput}
* @see org.apache.xml.security.signature.Reference#verify
* @see org.apache.xml.security.signature.SignedInfo#verify(boolean)
@@ -302,7 +302,7 @@ public class Manifest extends SignatureE
public boolean verifyReferences(boolean followManifests)
throws MissingResourceFailureException, XMLSecurityException {
if (referencesEl == null) {
- this.referencesEl =
+ this.referencesEl =
XMLUtils.selectDsNodes(
getFirstChild(), Constants._TAG_REFERENCE
);
@@ -317,7 +317,7 @@ public class Manifest extends SignatureE
}
if (secureValidation && referencesEl.length > MAXIMUM_REFERENCE_COUNT) {
Object exArgs[] = { referencesEl.length, MAXIMUM_REFERENCE_COUNT };
-
+
throw new XMLSecurityException("signature.tooManyReferences", exArgs);
}
@@ -359,7 +359,7 @@ public class Manifest extends SignatureE
Node n = nlIterator.next();
if (n.getNodeType() == Node.ELEMENT_NODE
- && ((Element) n).getNamespaceURI().equals(Constants.SignatureSpecNS)
+ && ((Element) n).getNamespaceURI().equals(Constants.SignatureSpecNS)
&& ((Element) n).getLocalName().equals(Constants._TAG_MANIFEST)
) {
try {
@@ -465,10 +465,10 @@ public class Manifest extends SignatureE
}
/**
- * Adds Resource Resolver for retrieving resources at specified <code>URI</code> attribute
+ * Adds Resource Resolver for retrieving resources at specified <code>URI</code> attribute
* in <code>reference</code> element
*
- * @param resolver {@link ResourceResolver} can provide the implemenatin subclass of
+ * @param resolver {@link ResourceResolver} can provide the implemenatin subclass of
* {@link ResourceResolverSpi} for retrieving resource.
*/
public void addResourceResolver(ResourceResolver resolver) {
@@ -482,10 +482,10 @@ public class Manifest extends SignatureE
}
/**
- * Adds Resource Resolver for retrieving resources at specified <code>URI</code> attribute
+ * Adds Resource Resolver for retrieving resources at specified <code>URI</code> attribute
* in <code>reference</code> element
*
- * @param resolverSpi the implementation subclass of {@link ResourceResolverSpi} for
+ * @param resolverSpi the implementation subclass of {@link ResourceResolverSpi} for
* retrieving the resource.
*/
public void addResourceResolver(ResourceResolverSpi resolverSpi) {
@@ -505,7 +505,7 @@ public class Manifest extends SignatureE
public List<ResourceResolver> getPerManifestResolvers() {
return perManifestResolvers;
}
-
+
/**
* Get the resolver property map
* @return the resolver property map
@@ -513,7 +513,7 @@ public class Manifest extends SignatureE
public Map<String, String> getResolverProperties() {
return resolverProperties;
}
-
+
/**
* Used to pass parameters like proxy servers etc to the ResourceResolver
* implementation.
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/MissingResourceFailureException.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/MissingResourceFailureException.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/MissingResourceFailureException.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/MissingResourceFailureException.java Tue Dec 15 17:13:17 2015
@@ -29,10 +29,10 @@ package org.apache.xml.security.signatur
public class MissingResourceFailureException extends XMLSignatureException {
/**
- *
+ *
*/
private static final long serialVersionUID = 1L;
-
+
/** Field uninitializedReference */
private Reference uninitializedReference = null;
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/NodeFilter.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/NodeFilter.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/NodeFilter.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/NodeFilter.java Tue Dec 15 17:13:17 2015
@@ -24,26 +24,26 @@ import org.w3c.dom.Node;
* An interface to tell to the c14n if a node is included or not in the output
*/
public interface NodeFilter {
-
+
/**
* Tells if a node must be output in c14n.
* @param n
* @return 1 if the node should be output.
- * 0 if node must not be output,
+ * 0 if node must not be output,
* -1 if the node and all it's child must not be output.
*
*/
int isNodeInclude(Node n);
-
+
/**
* Tells if a node must be output in a c14n.
* The caller must assured that this method is always call
- * in document order. The implementations can use this
+ * in document order. The implementations can use this
* restriction to optimize the transformation.
* @param n
* @param level the relative level in the tree
* @return 1 if the node should be output.
- * 0 if node must not be output,
+ * 0 if node must not be output,
* -1 if the node and all it's child must not be output.
*/
int isNodeIncludeDO(Node n, int level);
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Reference.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Reference.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Reference.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/Reference.java Tue Dec 15 17:13:17 2015
@@ -102,18 +102,18 @@ import org.w3c.dom.Text;
* @see Manifest
*/
public class Reference extends SignatureElementProxy {
-
+
/** Field OBJECT_URI */
public static final String OBJECT_URI = Constants.SignatureSpecNS + Constants._TAG_OBJECT;
/** Field MANIFEST_URI */
public static final String MANIFEST_URI = Constants.SignatureSpecNS + Constants._TAG_MANIFEST;
-
+
/**
* The maximum number of transforms per reference, if secure validation is enabled.
*/
public static final int MAXIMUM_TRANSFORM_COUNT = 5;
-
+
private boolean secureValidation;
/**
@@ -139,7 +139,7 @@ public class Reference extends Signature
private Element digestMethodElem;
private Element digestValueElement;
-
+
private ReferenceData referenceData;
/**
@@ -150,13 +150,13 @@ public class Reference extends Signature
* @param referenceURI URI indicate where is data which will digested
* @param manifest
* @param transforms {@link Transforms} applied to data
- * @param messageDigestAlgorithm {@link MessageDigestAlgorithm Digest algorithm} which is
+ * @param messageDigestAlgorithm {@link MessageDigestAlgorithm Digest algorithm} which is
* applied to the data
* TODO should we throw XMLSignatureException if MessageDigestAlgoURI is wrong?
* @throws XMLSignatureException
*/
protected Reference(
- Document doc, String baseURI, String referenceURI, Manifest manifest,
+ Document doc, String baseURI, String referenceURI, Manifest manifest,
Transforms transforms, String messageDigestAlgorithm
) throws XMLSignatureException {
super(doc);
@@ -178,7 +178,7 @@ public class Reference extends Signature
appendSelf(transforms);
addReturnToSelf();
}
-
+
// Create DigestMethod Element without actually instantiating a MessageDigest Object
Algorithm digestAlgorithm = new Algorithm(getDocument(), messageDigestAlgorithm) {
public String getBaseNamespace() {
@@ -191,7 +191,7 @@ public class Reference extends Signature
};
digestMethodElem = digestAlgorithm.getElement();
-
+
appendSelf(digestMethodElem);
addReturnToSelf();
@@ -202,14 +202,14 @@ public class Reference extends Signature
addReturnToSelf();
}
-
+
/**
* Build a {@link Reference} from an {@link Element}
*
* @param element <code>Reference</code> element
* @param baseURI the URI of the resource where the XML instance was stored
* @param manifest is the {@link Manifest} of {@link SignedInfo} in which the Reference occurs.
- * We need this because the Manifest has the individual {@link ResourceResolver}s which have
+ * We need this because the Manifest has the individual {@link ResourceResolver}s which have
* been set by the user
* @throws XMLSecurityException
*/
@@ -224,7 +224,7 @@ public class Reference extends Signature
* @param baseURI the URI of the resource where the XML instance was stored
* @param manifest is the {@link Manifest} of {@link SignedInfo} in which the Reference occurs.
* @param secureValidation whether secure validation is enabled or not
- * We need this because the Manifest has the individual {@link ResourceResolver}s which have
+ * We need this because the Manifest has the individual {@link ResourceResolver}s which have
* been set by the user
* @throws XMLSecurityException
*/
@@ -234,13 +234,13 @@ public class Reference extends Signature
this.secureValidation = secureValidation;
this.baseURI = baseURI;
Element el = XMLUtils.getNextElement(element.getFirstChild());
- if (Constants._TAG_TRANSFORMS.equals(el.getLocalName())
+ if (Constants._TAG_TRANSFORMS.equals(el.getLocalName())
&& Constants.SignatureSpecNS.equals(el.getNamespaceURI())) {
transforms = new Transforms(el, this.baseURI);
transforms.setSecureValidation(secureValidation);
if (secureValidation && transforms.getLength() > MAXIMUM_TRANSFORM_COUNT) {
Object exArgs[] = { transforms.getLength(), MAXIMUM_TRANSFORM_COUNT };
-
+
throw new XMLSecurityException("signature.tooManyTransforms", exArgs);
}
el = XMLUtils.getNextElement(el.getNextSibling());
@@ -268,7 +268,7 @@ public class Reference extends Signature
if ("".equals(uri)) {
return null;
}
-
+
if (secureValidation && MessageDigestAlgorithm.ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5.equals(uri)) {
Object exArgs[] = { uri };
@@ -319,8 +319,8 @@ public class Reference extends Signature
}
/**
- * Sets the <code>type</code> atttibute of the Reference indicate whether an
- * <code>ds:Object</code>, <code>ds:SignatureProperty</code>, or <code>ds:Manifest</code>
+ * Sets the <code>type</code> atttibute of the Reference indicate whether an
+ * <code>ds:Object</code>, <code>ds:SignatureProperty</code>, or <code>ds:Manifest</code>
* element.
*
* @param type the <code>type</code> attribute of the Reference
@@ -332,8 +332,8 @@ public class Reference extends Signature
}
/**
- * Return the <code>type</code> atttibute of the Reference indicate whether an
- * <code>ds:Object</code>, <code>ds:SignatureProperty</code>, or <code>ds:Manifest</code>
+ * Return the <code>type</code> atttibute of the Reference indicate whether an
+ * <code>ds:Object</code>, <code>ds:SignatureProperty</code>, or <code>ds:Manifest</code>
* element
*
* @return the <code>type</code> attribute of the Reference
@@ -348,7 +348,7 @@ public class Reference extends Signature
* This returns true if the <CODE>Type</CODE> attribute of the
* <CODE>Reference</CODE> element points to a <CODE>#Object</CODE> element
*
- * @return true if the Reference type indicates that this Reference points to an
+ * @return true if the Reference type indicates that this Reference points to an
* <code>Object</code>
*/
public boolean typeIsReferenceToObject() {
@@ -365,7 +365,7 @@ public class Reference extends Signature
* This returns true if the <CODE>Type</CODE> attribute of the
* <CODE>Reference</CODE> element points to a <CODE>#Manifest</CODE> element
*
- * @return true if the Reference type indicates that this Reference points to a
+ * @return true if the Reference type indicates that this Reference points to a
* {@link Manifest}
*/
public boolean typeIsReferenceToManifest() {
@@ -414,10 +414,10 @@ public class Reference extends Signature
public XMLSignatureInput getContentsBeforeTransformation()
throws ReferenceNotInitializedException {
try {
- Attr uriAttr =
+ Attr uriAttr =
getElement().getAttributeNodeNS(null, Constants._ATT_URI);
- ResourceResolver resolver =
+ ResourceResolver resolver =
ResourceResolver.getInstance(
uriAttr, this.baseURI, this.manifest.getPerManifestResolvers(), secureValidation
);
@@ -492,9 +492,9 @@ public class Reference extends Signature
Transform t = transforms.item(i);
String uri = t.getURI();
- if (uri.equals(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS)
- || uri.equals(Transforms.TRANSFORM_C14N_EXCL_WITH_COMMENTS)
- || uri.equals(Transforms.TRANSFORM_C14N_OMIT_COMMENTS)
+ if (uri.equals(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS)
+ || uri.equals(Transforms.TRANSFORM_C14N_EXCL_WITH_COMMENTS)
+ || uri.equals(Transforms.TRANSFORM_C14N_OMIT_COMMENTS)
|| uri.equals(Transforms.TRANSFORM_C14N_WITH_COMMENTS)) {
break;
}
@@ -548,20 +548,20 @@ public class Reference extends Signature
Set<String> inclusiveNamespaces = new HashSet<String>();
if (c14nTransform != null
&& c14nTransform.length(
- InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
+ InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES) == 1) {
// there is one InclusiveNamespaces element
- InclusiveNamespaces in =
+ InclusiveNamespaces in =
new InclusiveNamespaces(
XMLUtils.selectNode(
c14nTransform.getElement().getFirstChild(),
- InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
- InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
+ InclusiveNamespaces.ExclusiveCanonicalizationNamespace,
+ InclusiveNamespaces._TAG_EC_INCLUSIVENAMESPACES,
0
), this.getBaseURI());
- inclusiveNamespaces =
+ inclusiveNamespaces =
InclusiveNamespaces.prefixStr2Set(in.getInclusiveNamespaces());
}
@@ -582,7 +582,7 @@ public class Reference extends Signature
public XMLSignatureInput getTransformsOutput() {
return this.transformsOutput;
}
-
+
/**
* Get the ReferenceData that corresponds to the cached representation of the dereferenced
* object before transformation.
@@ -605,7 +605,7 @@ public class Reference extends Signature
try {
XMLSignatureInput input = this.getContentsBeforeTransformation();
cacheDereferencedElement(input);
-
+
XMLSignatureInput output = this.getContentsAfterTransformation(input, os);
this.transformsOutput = output;
return output;
@@ -613,7 +613,7 @@ public class Reference extends Signature
throw new ReferenceNotInitializedException(ex);
}
}
-
+
/**
* Store the dereferenced Element(s) so that it/they can be retrieved later.
*/
@@ -622,11 +622,11 @@ public class Reference extends Signature
try {
final Set<Node> s = input.getNodeSet();
referenceData = new ReferenceNodeSetData() {
- public Iterator<Node> iterator() {
+ public Iterator<Node> iterator() {
return new Iterator<Node>() {
-
+
Iterator<Node> sIterator = s.iterator();
-
+
@Override
public boolean hasNext() {
return sIterator.hasNext();
@@ -675,12 +675,12 @@ public class Reference extends Signature
public Transforms getTransforms()
throws XMLSignatureException, InvalidTransformException,
TransformationException, XMLSecurityException {
- return transforms;
+ return transforms;
}
/**
* Method getReferencedBytes
- *
+ *
* @return the bytes that will be used to generated digest.
* @throws ReferenceNotInitializedException
* @throws XMLSignatureException
@@ -694,7 +694,7 @@ public class Reference extends Signature
throw new ReferenceNotInitializedException(ex);
} catch (CanonicalizationException ex) {
throw new ReferenceNotInitializedException(ex);
- }
+ }
}
@@ -715,10 +715,10 @@ public class Reference extends Signature
mda.reset();
DigesterOutputStream diOs = new DigesterOutputStream(mda);
os = new UnsyncBufferedOutputStream(diOs);
- XMLSignatureInput output = this.dereferenceURIandPerformTransforms(os);
+ XMLSignatureInput output = this.dereferenceURIandPerformTransforms(os);
// if signing and c14n11 property == true explicitly add
// C14N11 transform if needed
- if (Reference.useC14N11 && !validating && !output.isOutputStreamSet()
+ if (Reference.useC14N11 && !validating && !output.isOutputStreamSet()
&& !output.isOctetStream()) {
if (transforms == null) {
transforms = new Transforms(getDocument());
@@ -731,11 +731,11 @@ public class Reference extends Signature
output.updateOutputStream(os);
}
os.flush();
-
+
if (output.getOctetStreamReal() != null) {
output.getOctetStreamReal().close();
}
-
+
//this.getReferencedBytes(diOs);
//mda.update(data);
@@ -750,7 +750,7 @@ public class Reference extends Signature
os.close();
} catch (IOException ex) {
throw new ReferenceNotInitializedException(ex);
- }
+ }
}
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/ReferenceNotInitializedException.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/ReferenceNotInitializedException.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/ReferenceNotInitializedException.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/ReferenceNotInitializedException.java Tue Dec 15 17:13:17 2015
@@ -27,7 +27,7 @@ package org.apache.xml.security.signatur
public class ReferenceNotInitializedException extends XMLSignatureException {
/**
- *
+ *
*/
private static final long serialVersionUID = 1L;
@@ -38,7 +38,7 @@ public class ReferenceNotInitializedExce
public ReferenceNotInitializedException() {
super();
}
-
+
public ReferenceNotInitializedException(Exception ex) {
super(ex);
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperties.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperties.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperties.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperties.java Tue Dec 15 17:13:17 2015
@@ -55,12 +55,12 @@ public class SignatureProperties extends
*/
public SignatureProperties(Element element, String baseURI) throws XMLSecurityException {
super(element, baseURI);
-
+
Attr attr = element.getAttributeNodeNS(null, "Id");
if (attr != null) {
element.setIdAttributeNode(attr, true);
}
-
+
int length = getLength();
for (int i = 0; i < length; i++) {
Element propertyElem =
@@ -99,8 +99,8 @@ public class SignatureProperties extends
if (propertyElem == null) {
return null;
- }
- return new SignatureProperty(propertyElem, this.baseURI);
+ }
+ return new SignatureProperty(propertyElem, this.baseURI);
} catch (XMLSecurityException ex) {
throw new XMLSignatureException(ex);
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperty.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperty.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperty.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignatureProperty.java Tue Dec 15 17:13:17 2015
@@ -38,7 +38,7 @@ public class SignatureProperty extends S
* Constructs{@link SignatureProperty} using specified <code>target</code> attribute
*
* @param doc the {@link Document} in which <code>XMLsignature</code> is placed
- * @param target the <code>target</code> attribute references the <code>Signature</code>
+ * @param target the <code>target</code> attribute references the <code>Signature</code>
* element to which the property applies SignatureProperty
*/
public SignatureProperty(Document doc, String target) {
@@ -46,7 +46,7 @@ public class SignatureProperty extends S
}
/**
- * Constructs {@link SignatureProperty} using sepcified <code>target</code> attribute and
+ * Constructs {@link SignatureProperty} using sepcified <code>target</code> attribute and
* <code>id</code> attribute
*
* @param doc the {@link Document} in which <code>XMLsignature</code> is placed
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignedInfo.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignedInfo.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignedInfo.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/SignedInfo.java Tue Dec 15 17:13:17 2015
@@ -58,26 +58,26 @@ public class SignedInfo extends Manifest
private Element signatureMethod;
/**
- * Overwrites {@link Manifest#addDocument} because it creates another
+ * Overwrites {@link Manifest#addDocument} because it creates another
* Element.
*
- * @param doc the {@link Document} in which <code>XMLsignature</code> will
+ * @param doc the {@link Document} in which <code>XMLsignature</code> will
* be placed
* @throws XMLSecurityException
*/
public SignedInfo(Document doc) throws XMLSecurityException {
- this(doc, XMLSignature.ALGO_ID_SIGNATURE_DSA,
+ this(doc, XMLSignature.ALGO_ID_SIGNATURE_DSA,
Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
}
/**
- * Constructs {@link SignedInfo} using given Canonicalization algorithm and
+ * Constructs {@link SignedInfo} using given Canonicalization algorithm and
* Signature algorithm.
*
* @param doc <code>SignedInfo</code> is placed in this document
- * @param signatureMethodURI URI representation of the Digest and
+ * @param signatureMethodURI URI representation of the Digest and
* Signature algorithm
- * @param canonicalizationMethodURI URI representation of the
+ * @param canonicalizationMethodURI URI representation of the
* Canonicalization method
* @throws XMLSecurityException
*/
@@ -91,20 +91,20 @@ public class SignedInfo extends Manifest
* Constructor SignedInfo
*
* @param doc <code>SignedInfo</code> is placed in this document
- * @param signatureMethodURI URI representation of the Digest and
+ * @param signatureMethodURI URI representation of the Digest and
* Signature algorithm
* @param hMACOutputLength
- * @param canonicalizationMethodURI URI representation of the
+ * @param canonicalizationMethodURI URI representation of the
* Canonicalization method
* @throws XMLSecurityException
*/
public SignedInfo(
- Document doc, String signatureMethodURI,
+ Document doc, String signatureMethodURI,
int hMACOutputLength, String canonicalizationMethodURI
) throws XMLSecurityException {
super(doc);
- c14nMethod =
+ c14nMethod =
XMLUtils.createElementInSignatureSpace(getDocument(), Constants._TAG_CANONICALIZATIONMETHOD);
c14nMethod.setAttributeNS(null, Constants._ATT_ALGORITHM, canonicalizationMethodURI);
@@ -112,7 +112,7 @@ public class SignedInfo extends Manifest
addReturnToSelf();
if (hMACOutputLength > 0) {
- this.signatureAlgorithm =
+ this.signatureAlgorithm =
new SignatureAlgorithm(getDocument(), signatureMethodURI, hMACOutputLength);
} else {
this.signatureAlgorithm = new SignatureAlgorithm(getDocument(), signatureMethodURI);
@@ -138,7 +138,7 @@ public class SignedInfo extends Manifest
appendSelf(c14nMethod);
addReturnToSelf();
- this.signatureAlgorithm =
+ this.signatureAlgorithm =
new SignatureAlgorithm(signatureMethodElem, null);
signatureMethod = this.signatureAlgorithm.getElement();
@@ -161,7 +161,7 @@ public class SignedInfo extends Manifest
public SignedInfo(Element element, String baseURI) throws XMLSecurityException {
this(element, baseURI, false);
}
-
+
/**
* Build a {@link SignedInfo} from an {@link Element}
*
@@ -188,30 +188,30 @@ public class SignedInfo extends Manifest
private static Element reparseSignedInfoElem(Element element, boolean secureValidation)
throws XMLSecurityException {
- /*
- * If a custom canonicalizationMethod is used, canonicalize
+ /*
+ * If a custom canonicalizationMethod is used, canonicalize
* ds:SignedInfo, reparse it into a new document
* and replace the original not-canonicalized ds:SignedInfo by
* the re-parsed canonicalized one.
*/
Element c14nMethod = XMLUtils.getNextElement(element.getFirstChild());
- String c14nMethodURI =
- c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
+ String c14nMethodURI =
+ c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
if (!(c14nMethodURI.equals(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS) ||
c14nMethodURI.equals(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS) ||
c14nMethodURI.equals(Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS) ||
c14nMethodURI.equals(Canonicalizer.ALGO_ID_C14N_EXCL_WITH_COMMENTS) ||
c14nMethodURI.equals(Canonicalizer.ALGO_ID_C14N11_OMIT_COMMENTS) ||
c14nMethodURI.equals(Canonicalizer.ALGO_ID_C14N11_WITH_COMMENTS))) {
- // the c14n is not a secure one and can rewrite the URIs or like
- // so reparse the SignedInfo to be sure
+ // the c14n is not a secure one and can rewrite the URIs or like
+ // so reparse the SignedInfo to be sure
try {
Canonicalizer c14nizer =
Canonicalizer.getInstance(c14nMethodURI);
c14nizer.setSecureValidation(secureValidation);
byte[] c14nizedBytes = c14nizer.canonicalizeSubtree(element);
- javax.xml.parsers.DocumentBuilder db =
+ javax.xml.parsers.DocumentBuilder db =
XMLUtils.createDocumentBuilder(false, secureValidation);
try {
Document newdoc = db.parse(new ByteArrayInputStream(
@@ -293,7 +293,7 @@ public class SignedInfo extends Manifest
* @throws InvalidCanonicalizerException
* @throws XMLSecurityException
*/
- public void signInOctetStream(OutputStream os)
+ public void signInOctetStream(OutputStream os)
throws CanonicalizationException, InvalidCanonicalizerException, XMLSecurityException {
if (this.c14nizedBytes == null) {
Canonicalizer c14nizer =
@@ -312,8 +312,8 @@ public class SignedInfo extends Manifest
os.write(this.c14nizedBytes);
} catch (IOException e) {
throw new RuntimeException(e);
- }
- }
+ }
+ }
}
/**
@@ -322,7 +322,7 @@ public class SignedInfo extends Manifest
* @return the Canonicalization method URI
*/
public String getCanonicalizationMethodURI() {
- return c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
+ return c14nMethod.getAttributeNS(null, Constants._ATT_ALGORITHM);
}
/**
@@ -342,7 +342,7 @@ public class SignedInfo extends Manifest
/**
* Method getSignatureMethodElement
- * @return returns the SignatureMethod Element
+ * @return returns the SignatureMethod Element
*
*/
public Element getSignatureMethodElement() {
@@ -384,7 +384,7 @@ public class SignedInfo extends Manifest
if (inclusiveElement != null) {
try {
- String inclusiveNamespaces =
+ String inclusiveNamespaces =
new InclusiveNamespaces(
inclusiveElement,
InclusiveNamespaces.ExclusiveCanonicalizationNamespace
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignature.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignature.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignature.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignature.java Tue Dec 15 17:13:17 2015
@@ -73,11 +73,11 @@ import org.w3c.dom.Text;
public final class XMLSignature extends SignatureElementProxy {
/** MAC - Required HMAC-SHA1 */
- public static final String ALGO_ID_MAC_HMAC_SHA1 =
+ public static final String ALGO_ID_MAC_HMAC_SHA1 =
Constants.SignatureSpecNS + "hmac-sha1";
/** Signature - Required DSAwithSHA1 (DSS) */
- public static final String ALGO_ID_SIGNATURE_DSA =
+ public static final String ALGO_ID_SIGNATURE_DSA =
Constants.SignatureSpecNS + "dsa-sha1";
/** Signature - Optional DSAwithSHA256 */
@@ -85,108 +85,108 @@ public final class XMLSignature extends
Constants.SignatureSpec11NS + "dsa-sha256";
/** Signature - Recommended RSAwithSHA1 */
- public static final String ALGO_ID_SIGNATURE_RSA =
+ public static final String ALGO_ID_SIGNATURE_RSA =
Constants.SignatureSpecNS + "rsa-sha1";
-
+
/** Signature - Recommended RSAwithSHA1 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA1 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA1 =
Constants.SignatureSpecNS + "rsa-sha1";
-
+
/** Signature - NOT Recommended RSAwithMD5 */
- public static final String ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5 =
+ public static final String ALGO_ID_SIGNATURE_NOT_RECOMMENDED_RSA_MD5 =
Constants.MoreAlgorithmsSpecNS + "rsa-md5";
-
+
/** Signature - Optional RSAwithRIPEMD160 */
- public static final String ALGO_ID_SIGNATURE_RSA_RIPEMD160 =
+ public static final String ALGO_ID_SIGNATURE_RSA_RIPEMD160 =
Constants.MoreAlgorithmsSpecNS + "rsa-ripemd160";
-
+
/** Signature - Optional RSAwithSHA224 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA224 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA224 =
Constants.MoreAlgorithmsSpecNS + "rsa-sha224";
-
+
/** Signature - Optional RSAwithSHA256 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA256 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA256 =
Constants.MoreAlgorithmsSpecNS + "rsa-sha256";
-
+
/** Signature - Optional RSAwithSHA384 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA384 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA384 =
Constants.MoreAlgorithmsSpecNS + "rsa-sha384";
-
+
/** Signature - Optional RSAwithSHA512 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA512 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA512 =
Constants.MoreAlgorithmsSpecNS + "rsa-sha512";
-
+
/** Signature - Optional RSAwithSHA1andMGF1 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA1_MGF1 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA1_MGF1 =
Constants.XML_DSIG_NS_MORE_07_05 + "sha1-rsa-MGF1";
-
+
/** Signature - Optional RSAwithSHA224andMGF1 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA224_MGF1 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA224_MGF1 =
Constants.XML_DSIG_NS_MORE_07_05 + "sha224-rsa-MGF1";
/** Signature - Optional RSAwithSHA256andMGF1 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA256_MGF1 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA256_MGF1 =
Constants.XML_DSIG_NS_MORE_07_05 + "sha256-rsa-MGF1";
/** Signature - Optional RSAwithSHA384andMGF1 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA384_MGF1 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA384_MGF1 =
Constants.XML_DSIG_NS_MORE_07_05 + "sha384-rsa-MGF1";
/** Signature - Optional RSAwithSHA512andMGF1 */
- public static final String ALGO_ID_SIGNATURE_RSA_SHA512_MGF1 =
+ public static final String ALGO_ID_SIGNATURE_RSA_SHA512_MGF1 =
Constants.XML_DSIG_NS_MORE_07_05 + "sha512-rsa-MGF1";
/** HMAC - NOT Recommended HMAC-MD5 */
- public static final String ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5 =
+ public static final String ALGO_ID_MAC_HMAC_NOT_RECOMMENDED_MD5 =
Constants.MoreAlgorithmsSpecNS + "hmac-md5";
-
+
/** HMAC - Optional HMAC-RIPEMD160 */
- public static final String ALGO_ID_MAC_HMAC_RIPEMD160 =
+ public static final String ALGO_ID_MAC_HMAC_RIPEMD160 =
Constants.MoreAlgorithmsSpecNS + "hmac-ripemd160";
-
+
/** HMAC - Optional HMAC-SHA2224 */
- public static final String ALGO_ID_MAC_HMAC_SHA224 =
+ public static final String ALGO_ID_MAC_HMAC_SHA224 =
Constants.MoreAlgorithmsSpecNS + "hmac-sha224";
-
+
/** HMAC - Optional HMAC-SHA256 */
- public static final String ALGO_ID_MAC_HMAC_SHA256 =
+ public static final String ALGO_ID_MAC_HMAC_SHA256 =
Constants.MoreAlgorithmsSpecNS + "hmac-sha256";
-
+
/** HMAC - Optional HMAC-SHA284 */
- public static final String ALGO_ID_MAC_HMAC_SHA384 =
+ public static final String ALGO_ID_MAC_HMAC_SHA384 =
Constants.MoreAlgorithmsSpecNS + "hmac-sha384";
-
+
/** HMAC - Optional HMAC-SHA512 */
- public static final String ALGO_ID_MAC_HMAC_SHA512 =
+ public static final String ALGO_ID_MAC_HMAC_SHA512 =
Constants.MoreAlgorithmsSpecNS + "hmac-sha512";
-
+
/**Signature - Optional ECDSAwithSHA1 */
- public static final String ALGO_ID_SIGNATURE_ECDSA_SHA1 =
+ public static final String ALGO_ID_SIGNATURE_ECDSA_SHA1 =
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1";
-
+
/**Signature - Optional ECDSAwithSHA224 */
- public static final String ALGO_ID_SIGNATURE_ECDSA_SHA224 =
+ public static final String ALGO_ID_SIGNATURE_ECDSA_SHA224 =
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha224";
-
+
/**Signature - Optional ECDSAwithSHA256 */
- public static final String ALGO_ID_SIGNATURE_ECDSA_SHA256 =
+ public static final String ALGO_ID_SIGNATURE_ECDSA_SHA256 =
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256";
-
+
/**Signature - Optional ECDSAwithSHA384 */
- public static final String ALGO_ID_SIGNATURE_ECDSA_SHA384 =
+ public static final String ALGO_ID_SIGNATURE_ECDSA_SHA384 =
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384";
-
+
/**Signature - Optional ECDSAwithSHA512 */
- public static final String ALGO_ID_SIGNATURE_ECDSA_SHA512 =
+ public static final String ALGO_ID_SIGNATURE_ECDSA_SHA512 =
"http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512";
-
+
/**Signature - Optional ECDSAwithRIPEMD160 */
- public static final String ALGO_ID_SIGNATURE_ECDSA_RIPEMD160 =
+ public static final String ALGO_ID_SIGNATURE_ECDSA_RIPEMD160 =
"http://www.w3.org/2007/05/xmldsig-more#ecdsa-ripemd160";
private static org.slf4j.Logger log =
org.slf4j.LoggerFactory.getLogger(XMLSignature.class);
-
+
/** ds:Signature.ds:SignedInfo element */
private SignedInfo signedInfo;
@@ -235,7 +235,7 @@ public final class XMLSignature extends
public XMLSignature(Document doc, String baseURI, String signatureMethodURI,
int hmacOutputLength) throws XMLSecurityException {
this(
- doc, baseURI, signatureMethodURI, hmacOutputLength,
+ doc, baseURI, signatureMethodURI, hmacOutputLength,
Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS
);
}
@@ -246,13 +246,13 @@ public final class XMLSignature extends
* @param doc
* @param baseURI
* @param signatureMethodURI the Signature method to be used.
- * @param canonicalizationMethodURI the canonicalization algorithm to be
+ * @param canonicalizationMethodURI the canonicalization algorithm to be
* used to c14nize the SignedInfo element.
* @throws XMLSecurityException
*/
public XMLSignature(
- Document doc,
- String baseURI,
+ Document doc,
+ String baseURI,
String signatureMethodURI,
String canonicalizationMethodURI
) throws XMLSecurityException {
@@ -270,10 +270,10 @@ public final class XMLSignature extends
* @throws XMLSecurityException
*/
public XMLSignature(
- Document doc,
- String baseURI,
+ Document doc,
+ String baseURI,
String signatureMethodURI,
- int hmacOutputLength,
+ int hmacOutputLength,
String canonicalizationMethodURI
) throws XMLSecurityException {
super(doc);
@@ -291,7 +291,7 @@ public final class XMLSignature extends
addReturnToSelf();
this.baseURI = baseURI;
- this.signedInfo =
+ this.signedInfo =
new SignedInfo(
getDocument(), signatureMethodURI, hmacOutputLength, canonicalizationMethodURI
);
@@ -300,7 +300,7 @@ public final class XMLSignature extends
addReturnToSelf();
// create an empty SignatureValue; this is filled by setSignatureValueElement
- signatureValueElement =
+ signatureValueElement =
XMLUtils.createElementInSignatureSpace(getDocument(), Constants._TAG_SIGNATUREVALUE);
appendSelf(signatureValueElement);
@@ -316,9 +316,9 @@ public final class XMLSignature extends
* @throws XMLSecurityException
*/
public XMLSignature(
- Document doc,
- String baseURI,
- Element SignatureMethodElem,
+ Document doc,
+ String baseURI,
+ Element SignatureMethodElem,
Element CanonicalizationMethodElem
) throws XMLSecurityException {
super(doc);
@@ -336,20 +336,20 @@ public final class XMLSignature extends
addReturnToSelf();
this.baseURI = baseURI;
- this.signedInfo =
+ this.signedInfo =
new SignedInfo(getDocument(), SignatureMethodElem, CanonicalizationMethodElem);
appendSelf(this.signedInfo);
addReturnToSelf();
// create an empty SignatureValue; this is filled by setSignatureValueElement
- signatureValueElement =
+ signatureValueElement =
XMLUtils.createElementInSignatureSpace(getDocument(), Constants._TAG_SIGNATUREVALUE);
appendSelf(signatureValueElement);
addReturnToSelf();
}
-
+
/**
* This will parse the element and construct the Java Objects.
* That will allow a user to validate the signature.
@@ -393,7 +393,7 @@ public final class XMLSignature extends
signedInfoElem = XMLUtils.getNextElement(element.getFirstChild());
// check out SignatureValue child
- this.signatureValueElement =
+ this.signatureValueElement =
XMLUtils.getNextElement(signedInfoElem.getNextSibling());
// check to see if it exists
@@ -407,17 +407,17 @@ public final class XMLSignature extends
}
// <element ref="ds:KeyInfo" minOccurs="0"/>
- Element keyInfoElem =
+ Element keyInfoElem =
XMLUtils.getNextElement(signatureValueElement.getNextSibling());
// If it exists use it, but it's not mandatory
- if (keyInfoElem != null
- && Constants.SignatureSpecNS.equals(keyInfoElem.getNamespaceURI())
+ if (keyInfoElem != null
+ && Constants.SignatureSpecNS.equals(keyInfoElem.getNamespaceURI())
&& Constants._TAG_KEYINFO.equals(keyInfoElem.getLocalName())) {
this.keyInfo = new KeyInfo(keyInfoElem, baseURI);
this.keyInfo.setSecureValidation(secureValidation);
}
-
+
// <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
Element objectElem =
XMLUtils.getNextElement(signatureValueElement.getNextSibling());
@@ -444,7 +444,7 @@ public final class XMLSignature extends
objectElem = XMLUtils.getNextElement(objectElem.getNextSibling());
}
-
+
this.state = MODE_VERIFY;
}
@@ -531,7 +531,7 @@ public final class XMLSignature extends
// get the Element from KeyInfo
Element keyInfoElement = this.keyInfo.getElement();
- Element firstObject =
+ Element firstObject =
XMLUtils.selectDsNode(
getElement().getFirstChild(), Constants._TAG_OBJECT, 0
);
@@ -544,7 +544,7 @@ public final class XMLSignature extends
// add it as the last element to the signature
appendSelf(keyInfoElement);
addReturnToSelf();
- }
+ }
}
return this.keyInfo;
@@ -581,7 +581,7 @@ public final class XMLSignature extends
* or null if no such <code>ds:Object</code> element exists.
*/
public ObjectContainer getObjectItem(int i) {
- Element objElem =
+ Element objElem =
XMLUtils.selectDsNode(
getFirstChild(), Constants._TAG_OBJECT, i
);
@@ -603,10 +603,10 @@ public final class XMLSignature extends
}
/**
- * Digests all References in the SignedInfo, calculates the signature value
+ * Digests all References in the SignedInfo, calculates the signature value
* and sets it in the SignatureValue Element.
*
- * @param signingKey the {@link java.security.PrivateKey} or
+ * @param signingKey the {@link java.security.PrivateKey} or
* {@link javax.crypto.SecretKey} that is used to sign.
* @throws XMLSignatureException
*/
@@ -625,7 +625,7 @@ public final class XMLSignature extends
OutputStream so = null;
try {
// initialize SignatureAlgorithm for signing
- sa.initSign(signingKey);
+ sa.initSign(signingKey);
// generate digest values for all References in this SignedInfo
si.generateDigestValues();
@@ -683,7 +683,7 @@ public final class XMLSignature extends
* stored DigestValues and then checking to see if the Signatures match on
* the SignedInfo.
*
- * @param cert Certificate that contains the public key part of the keypair
+ * @param cert Certificate that contains the public key part of the keypair
* that was used to sign.
* @return true if the signature is valid, false otherwise
* @throws XMLSignatureException
@@ -694,7 +694,7 @@ public final class XMLSignature extends
if (cert != null) {
// check the values with the public key from the cert
return this.checkSignatureValue(cert.getPublicKey());
- }
+ }
Object exArgs[] = { "Didn't get a certificate" };
throw new XMLSignatureException("empty", exArgs);
@@ -705,7 +705,7 @@ public final class XMLSignature extends
* comparing those against the stored DigestValues and then checking to see
* if the Signatures match on the SignedInfo.
*
- * @param pk {@link java.security.PublicKey} part of the keypair or
+ * @param pk {@link java.security.PublicKey} part of the keypair or
* {@link javax.crypto.SecretKey} that was used to sign
* @return true if the signature is valid, false otherwise
* @throws XMLSignatureException
@@ -726,7 +726,7 @@ public final class XMLSignature extends
SignedInfo si = this.getSignedInfo();
//create a SignatureAlgorithms from the SignatureMethod inside
//SignedInfo. This is used to validate the signature.
- SignatureAlgorithm sa = si.getSignatureAlgorithm();
+ SignatureAlgorithm sa = si.getSignatureAlgorithm();
if (log.isDebugEnabled()) {
log.debug("signatureMethodURI = " + sa.getAlgorithmURI());
log.debug("jceSigAlgorithm = " + sa.getJCEAlgorithmString());
@@ -754,7 +754,7 @@ public final class XMLSignature extends
throw ex;
}
- // have SignatureAlgorithm sign the input bytes and compare them to
+ // have SignatureAlgorithm sign the input bytes and compare them to
// the bytes that were stored in the signature.
if (!sa.verify(sigBytes)) {
log.warn("Signature verification failed.");
@@ -766,15 +766,15 @@ public final class XMLSignature extends
throw ex;
} catch (XMLSecurityException ex) {
throw new XMLSignatureException(ex);
- }
+ }
}
/**
* Add a Reference with full parameters to this Signature
*
- * @param referenceURI URI of the resource to be signed. Can be null in
- * which case the dereferencing is application specific. Can be "" in which
- * it's the parent node (or parent document?). There can only be one "" in
+ * @param referenceURI URI of the resource to be signed. Can be null in
+ * which case the dereferencing is application specific. Can be "" in which
+ * it's the parent node (or parent document?). There can only be one "" in
* each signature.
* @param trans Optional list of transformations to be done before digesting
* @param digestURI Mandatory URI of the digesting algorithm to use.
@@ -783,10 +783,10 @@ public final class XMLSignature extends
* @throws XMLSignatureException
*/
public void addDocument(
- String referenceURI,
- Transforms trans,
- String digestURI,
- String referenceId,
+ String referenceURI,
+ Transforms trans,
+ String digestURI,
+ String referenceId,
String referenceType
) throws XMLSignatureException {
this.signedInfo.addDocument(
@@ -804,8 +804,8 @@ public final class XMLSignature extends
* @throws XMLSignatureException
*/
public void addDocument(
- String referenceURI,
- Transforms trans,
+ String referenceURI,
+ Transforms trans,
String digestURI
) throws XMLSignatureException {
this.signedInfo.addDocument(this.baseURI, referenceURI, trans, digestURI, null, null);
@@ -865,8 +865,8 @@ public final class XMLSignature extends
}
/**
- * Proxy method for {@link SignedInfo#createSecretKey(byte[])}. If you want
- * to create a MAC, this method helps you to obtain the
+ * Proxy method for {@link SignedInfo#createSecretKey(byte[])}. If you want
+ * to create a MAC, this method helps you to obtain the
* {@link javax.crypto.SecretKey} from octets.
*
* @param secretKeyBytes
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureException.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureException.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureException.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureException.java Tue Dec 15 17:13:17 2015
@@ -29,7 +29,7 @@ import org.apache.xml.security.exception
public class XMLSignatureException extends XMLSecurityException {
/**
- *
+ *
*/
private static final long serialVersionUID = 1L;
@@ -40,7 +40,7 @@ public class XMLSignatureException exten
public XMLSignatureException() {
super();
}
-
+
public XMLSignatureException(Exception ex) {
super(ex);
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInput.java Tue Dec 15 17:13:17 2015
@@ -54,7 +54,7 @@ public class XMLSignatureInput {
* A byteArray like with/or without InputStream.
* Or a nodeSet like defined either:
* * as a collection of nodes
- * * or as subnode excluding or not comments and excluding or
+ * * or as subnode excluding or not comments and excluding or
* not other nodes.
*/
@@ -76,10 +76,10 @@ public class XMLSignatureInput {
*/
private Node excludeNode = null;
/**
- *
+ *
*/
private boolean excludeComments = false;
-
+
private boolean isNodeSet = false;
/**
* A cached bytes
@@ -90,16 +90,16 @@ public class XMLSignatureInput {
/**
* Some Transforms may require explicit MIME type, charset (IANA registered
* "character set"), or other such information concerning the data they are
- * receiving from an earlier Transform or the source data, although no
- * Transform algorithm specified in this document needs such explicit
- * information. Such data characteristics are provided as parameters to the
- * Transform algorithm and should be described in the specification for the
+ * receiving from an earlier Transform or the source data, although no
+ * Transform algorithm specified in this document needs such explicit
+ * information. Such data characteristics are provided as parameters to the
+ * Transform algorithm and should be described in the specification for the
* algorithm.
- */
+ */
private String mimeType = null;
/**
- * Field sourceURI
+ * Field sourceURI
*/
private String sourceURI = null;
@@ -107,14 +107,14 @@ public class XMLSignatureInput {
* Node Filter list.
*/
private List<NodeFilter> nodeFilters = new ArrayList<NodeFilter>();
-
+
private boolean needsToBeExpanded = false;
private OutputStream outputStream = null;
-
+
/**
* Construct a XMLSignatureInput from an octet array.
* <p>
- * This is a comfort method, which internally converts the byte[] array into
+ * This is a comfort method, which internally converts the byte[] array into
* an InputStream
* <p>NOTE: no defensive copy</p>
* @param inputOctets an octet array which including XML document or node
@@ -160,7 +160,7 @@ public class XMLSignatureInput {
public boolean isNeedsToBeExpanded() {
return needsToBeExpanded;
}
-
+
/**
* Set if the structure needs to be expanded.
* @param needsToBeExpanded true if so.
@@ -170,7 +170,7 @@ public class XMLSignatureInput {
}
/**
- * Returns the node set from input which was specified as the parameter of
+ * Returns the node set from input which was specified as the parameter of
* {@link XMLSignatureInput} constructor
*
* @return the node set
@@ -179,11 +179,11 @@ public class XMLSignatureInput {
* @throws ParserConfigurationException
* @throws CanonicalizationException
*/
- public Set<Node> getNodeSet() throws CanonicalizationException, ParserConfigurationException,
+ public Set<Node> getNodeSet() throws CanonicalizationException, ParserConfigurationException,
IOException, SAXException {
return getNodeSet(false);
}
-
+
/**
* Get the Input NodeSet.
* @return the Input NodeSet.
@@ -193,7 +193,7 @@ public class XMLSignatureInput {
}
/**
- * Returns the node set from input which was specified as the parameter of
+ * Returns the node set from input which was specified as the parameter of
* {@link XMLSignatureInput} constructor
* @param circumvent
*
@@ -218,7 +218,7 @@ public class XMLSignatureInput {
} else if (isOctetStream()) {
convertToNodes();
Set<Node> result = new LinkedHashSet<Node>();
- XMLUtils.getSet(subNode, result, null, false);
+ XMLUtils.getSet(subNode, result, null, false);
return result;
}
@@ -226,10 +226,10 @@ public class XMLSignatureInput {
}
/**
- * Returns the Octet stream(byte Stream) from input which was specified as
+ * Returns the Octet stream(byte Stream) from input which was specified as
* the parameter of {@link XMLSignatureInput} constructor
*
- * @return the Octet stream(byte Stream) from input which was specified as
+ * @return the Octet stream(byte Stream) from input which was specified as
* the parameter of {@link XMLSignatureInput} constructor
* @throws IOException
*/
@@ -254,10 +254,10 @@ public class XMLSignatureInput {
}
/**
- * Returns the byte array from input which was specified as the parameter of
+ * Returns the byte array from input which was specified as the parameter of
* {@link XMLSignatureInput} constructor
*
- * @return the byte[] from input which was specified as the parameter of
+ * @return the byte[] from input which was specified as the parameter of
* {@link XMLSignatureInput} constructor
*
* @throws CanonicalizationException
@@ -268,8 +268,8 @@ public class XMLSignatureInput {
if (inputBytes != null) {
return inputBytes;
}
- Canonicalizer20010315OmitComments c14nizer = new Canonicalizer20010315OmitComments();
- bytes = c14nizer.engineCanonicalize(this);
+ Canonicalizer20010315OmitComments c14nizer = new Canonicalizer20010315OmitComments();
+ bytes = c14nizer.engineCanonicalize(this);
return bytes;
}
@@ -291,7 +291,7 @@ public class XMLSignatureInput {
return inputOctetStreamProxy == null && subNode != null
&& inputNodeSet == null && !isNodeSet;
}
-
+
/**
* Determines if the object has been set up with an octet stream
*
@@ -303,16 +303,16 @@ public class XMLSignatureInput {
}
/**
- * Determines if {@link #setOutputStream} has been called with a
+ * Determines if {@link #setOutputStream} has been called with a
* non-null OutputStream.
*
- * @return true if {@link #setOutputStream} has been called with a
+ * @return true if {@link #setOutputStream} has been called with a
* non-null OutputStream
*/
public boolean isOutputStreamSet() {
return outputStream != null;
}
-
+
/**
* Determines if the object has been set up with a ByteArray
*
@@ -366,7 +366,7 @@ public class XMLSignatureInput {
public void setSourceURI(String sourceURI) {
this.sourceURI = sourceURI;
}
-
+
/**
* Method toString
* @inheritDoc
@@ -374,11 +374,11 @@ public class XMLSignatureInput {
public String toString() {
if (isNodeSet()) {
return "XMLSignatureInput/NodeSet/" + inputNodeSet.size()
- + " nodes/" + getSourceURI();
- }
+ + " nodes/" + getSourceURI();
+ }
if (isElement()) {
return "XMLSignatureInput/Element/" + subNode
- + " exclude "+ excludeNode + " comments:"
+ + " exclude "+ excludeNode + " comments:"
+ excludeComments +"/" + getSourceURI();
}
try {
@@ -411,7 +411,7 @@ public class XMLSignatureInput {
*/
public String getHTMLRepresentation(Set<String> inclusiveNamespaces)
throws XMLSignatureException {
- XMLSignatureInputDebugger db =
+ XMLSignatureInputDebugger db =
new XMLSignatureInputDebugger(this, inclusiveNamespaces);
return db.getHTMLRepresentation();
}
@@ -423,7 +423,7 @@ public class XMLSignatureInput {
public Node getExcludeNode() {
return excludeNode;
}
-
+
/**
* Sets the exclude node of this XMLSignatureInput
* @param excludeNode The excludeNode to set.
@@ -460,26 +460,26 @@ public class XMLSignatureInput {
* @throws CanonicalizationException
*/
public void updateOutputStream(OutputStream diOs)
- throws CanonicalizationException, IOException {
+ throws CanonicalizationException, IOException {
updateOutputStream(diOs, false);
}
-
- public void updateOutputStream(OutputStream diOs, boolean c14n11)
- throws CanonicalizationException, IOException {
+
+ public void updateOutputStream(OutputStream diOs, boolean c14n11)
+ throws CanonicalizationException, IOException {
if (diOs == outputStream) {
return;
}
if (bytes != null) {
diOs.write(bytes);
- } else if (inputOctetStreamProxy == null) {
+ } else if (inputOctetStreamProxy == null) {
CanonicalizerBase c14nizer = null;
if (c14n11) {
- c14nizer = new Canonicalizer11_OmitComments();
+ c14nizer = new Canonicalizer11_OmitComments();
} else {
- c14nizer = new Canonicalizer20010315OmitComments();
+ c14nizer = new Canonicalizer20010315OmitComments();
}
c14nizer.setWriter(diOs);
- c14nizer.engineCanonicalize(this);
+ c14nizer.engineCanonicalize(this);
} else {
byte[] buffer = new byte[4 * 1024];
int bytesread = 0;
@@ -501,7 +501,7 @@ public class XMLSignatureInput {
outputStream = os;
}
- private byte[] getBytesFromInputStream() throws IOException {
+ private byte[] getBytesFromInputStream() throws IOException {
if (bytes != null) {
return bytes;
}
@@ -515,7 +515,7 @@ public class XMLSignatureInput {
}
return bytes;
}
-
+
/**
* @param filter
*/
@@ -545,11 +545,11 @@ public class XMLSignatureInput {
public void setNodeSet(boolean b) {
isNodeSet = b;
}
-
- void convertToNodes() throws CanonicalizationException,
+
+ void convertToNodes() throws CanonicalizationException,
ParserConfigurationException, IOException, SAXException {
DocumentBuilder db = XMLUtils.createDocumentBuilder(false, secureValidation);
- // select all nodes, also the comments.
+ // select all nodes, also the comments.
try {
db.setErrorHandler(new org.apache.xml.security.utils.IgnoreAllErrorHandler());
@@ -583,5 +583,5 @@ public class XMLSignatureInput {
public void setSecureValidation(boolean secureValidation) {
this.secureValidation = secureValidation;
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInputDebugger.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInputDebugger.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInputDebugger.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/XMLSignatureInputDebugger.java Tue Dec 15 17:13:17 2015
@@ -48,7 +48,7 @@ public class XMLSignatureInputDebugger {
private Writer writer = null;
/** The HTML Prefix* */
- static final String HTMLPrefix =
+ static final String HTMLPrefix =
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
+ "<html>\n"
+ "<head>\n"
@@ -109,7 +109,7 @@ public class XMLSignatureInputDebugger {
/**
* Constructor XMLSignatureInputDebugger
- *
+ *
* @param xmlSignatureInput the signature to pretty print
*/
public XMLSignatureInputDebugger(XMLSignatureInput xmlSignatureInput) {
@@ -122,12 +122,12 @@ public class XMLSignatureInputDebugger {
/**
* Constructor XMLSignatureInputDebugger
- *
+ *
* @param xmlSignatureInput the signatur to pretty print
* @param inclusiveNamespace
*/
public XMLSignatureInputDebugger(
- XMLSignatureInput xmlSignatureInput,
+ XMLSignatureInput xmlSignatureInput,
Set<String> inclusiveNamespace
) {
this(xmlSignatureInput);
@@ -136,7 +136,7 @@ public class XMLSignatureInputDebugger {
/**
* Method getHTMLRepresentation
- *
+ *
* @return The HTML Representation.
* @throws XMLSignatureException
*/
@@ -167,7 +167,7 @@ public class XMLSignatureInputDebugger {
/**
* Method canonicalizeXPathNodeSet
- *
+ *
* @param currentNode
* @throws XMLSignatureException
* @throws IOException
@@ -187,7 +187,7 @@ public class XMLSignatureInputDebugger {
case Node.DOCUMENT_NODE:
this.writer.write(HTMLPrefix);
- for (Node currentChild = currentNode.getFirstChild();
+ for (Node currentChild = currentNode.getFirstChild();
currentChild != null; currentChild = currentChild.getNextSibling()) {
this.canonicalizeXPathNodeSet(currentChild);
}
@@ -249,16 +249,16 @@ public class XMLSignatureInputDebugger {
outputTextToWriter(currentNode.getNodeValue());
- for (Node nextSibling = currentNode.getNextSibling();
+ for (Node nextSibling = currentNode.getNextSibling();
nextSibling != null
&& (nextSibling.getNodeType() == Node.TEXT_NODE
- || nextSibling.getNodeType() == Node.CDATA_SECTION_NODE);
+ || nextSibling.getNodeType() == Node.CDATA_SECTION_NODE);
nextSibling = nextSibling.getNextSibling()) {
/*
* The XPath data model allows to select only the first of a
* sequence of mixed text and CDATA nodes. But we must output
* them all, so we must search:
- *
+ *
* @see http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6329
*/
this.outputTextToWriter(nextSibling.getNodeValue());
@@ -331,8 +331,8 @@ public class XMLSignatureInputDebugger {
this.writer.write(HTMLIncludeOrExcludeSuffix);
// traversal
- for (Node currentChild = currentNode.getFirstChild();
- currentChild != null;
+ for (Node currentChild = currentNode.getFirstChild();
+ currentChild != null;
currentChild = currentChild.getNextSibling()) {
this.canonicalizeXPathNodeSet(currentChild);
}
@@ -349,7 +349,7 @@ public class XMLSignatureInputDebugger {
this.writer.write(HTMLIncludeOrExcludeSuffix);
break;
-
+
case Node.DOCUMENT_TYPE_NODE:
default:
break;
@@ -359,7 +359,7 @@ public class XMLSignatureInputDebugger {
/**
* Checks whether a Comment or ProcessingInstruction is before or after the
* document element. This is needed for prepending or appending "\n"s.
- *
+ *
* @param currentNode
* comment or pi to check
* @return NODE_BEFORE_DOCUMENT_ELEMENT,
@@ -401,7 +401,7 @@ public class XMLSignatureInputDebugger {
/**
* Normalizes an {@link Attr}ibute value
- *
+ *
* The string value of the node is modified by replacing
* <UL>
* <LI>all ampersands (&) with <CODE>&amp;</CODE></LI>
@@ -412,7 +412,7 @@ public class XMLSignatureInputDebugger {
* uppercase hexadecimal with no leading zeroes (for example, <CODE>#xD</CODE>
* is represented by the character reference <CODE>&#xD;</CODE>)</LI>
* </UL>
- *
+ *
* @param name
* @param value
* @throws IOException
@@ -464,7 +464,7 @@ public class XMLSignatureInputDebugger {
/**
* Normalizes a {@link org.w3c.dom.Comment} value
- *
+ *
* @param currentPI
* @throws IOException
*/
@@ -530,7 +530,7 @@ public class XMLSignatureInputDebugger {
/**
* Method outputCommentToWriter
- *
+ *
* @param currentComment
* @throws IOException
*/
@@ -573,7 +573,7 @@ public class XMLSignatureInputDebugger {
/**
* Method outputTextToWriter
- *
+ *
* @param text
* @throws IOException
*/
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceNodeSetData.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceNodeSetData.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceNodeSetData.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceNodeSetData.java Tue Dec 15 17:13:17 2015
@@ -34,16 +34,16 @@ import org.w3c.dom.Node;
public interface ReferenceNodeSetData extends ReferenceData {
/**
- * Returns a read-only iterator over the nodes contained in this
- * <code>NodeSetData</code> in
+ * Returns a read-only iterator over the nodes contained in this
+ * <code>NodeSetData</code> in
* <a href="http://www.w3.org/TR/1999/REC-xpath-19991116#dt-document-order">
* document order</a>. Attempts to modify the returned iterator
- * via the <code>remove</code> method throw
+ * via the <code>remove</code> method throw
* <code>UnsupportedOperationException</code>.
*
- * @return an <code>Iterator</code> over the nodes in this
+ * @return an <code>Iterator</code> over the nodes in this
* <code>NodeSetData</code> in document order
*/
Iterator<Node> iterator();
-
+
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceOctetStreamData.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceOctetStreamData.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceOctetStreamData.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceOctetStreamData.java Tue Dec 15 17:13:17 2015
@@ -38,7 +38,7 @@ public class ReferenceOctetStreamData im
* Creates a new <code>ReferenceOctetStreamData</code>.
*
* @param octetStream the input stream containing the octets
- * @throws NullPointerException if <code>octetStream</code> is
+ * @throws NullPointerException if <code>octetStream</code> is
* <code>null</code>
*/
public ReferenceOctetStreamData(InputStream octetStream) {
@@ -52,14 +52,14 @@ public class ReferenceOctetStreamData im
* Creates a new <code>ReferenceOctetStreamData</code>.
*
* @param octetStream the input stream containing the octets
- * @param uri the URI String identifying the data object (may be
- * <code>null</code>)
- * @param mimeType the MIME type associated with the data object (may be
- * <code>null</code>)
- * @throws NullPointerException if <code>octetStream</code> is
+ * @param uri the URI String identifying the data object (may be
+ * <code>null</code>)
+ * @param mimeType the MIME type associated with the data object (may be
+ * <code>null</code>)
+ * @throws NullPointerException if <code>octetStream</code> is
* <code>null</code>
*/
- public ReferenceOctetStreamData(InputStream octetStream, String uri,
+ public ReferenceOctetStreamData(InputStream octetStream, String uri,
String mimeType) {
if (octetStream == null) {
throw new NullPointerException("octetStream is null");
@@ -97,5 +97,5 @@ public class ReferenceOctetStreamData im
public String getMimeType() {
return mimeType;
}
-
+
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceSubTreeData.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceSubTreeData.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceSubTreeData.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/signature/reference/ReferenceSubTreeData.java Tue Dec 15 17:13:17 2015
@@ -168,7 +168,7 @@ public class ReferenceSubTreeData implem
nodeSet.add(node);
break;
case Node.COMMENT_NODE:
- if (withComments) {
+ if (withComments) {
nodeSet.add(node);
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ConfigurationProperties.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ConfigurationProperties.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ConfigurationProperties.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ConfigurationProperties.java Tue Dec 15 17:13:17 2015
@@ -53,7 +53,7 @@ public class ConfigurationProperties {
public static String getProperty(String key) {
return properties.getProperty(key);
}
-
+
public static Class<?> getCallingClass() {
return callingClass;
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/JCEAlgorithmMapper.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/JCEAlgorithmMapper.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/JCEAlgorithmMapper.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/JCEAlgorithmMapper.java Tue Dec 15 17:13:17 2015
@@ -45,11 +45,11 @@ public class JCEAlgorithmMapper extends
if (algorithmType.getIVLength() != null) {
ivLength = algorithmType.getIVLength();
}
- Algorithm algorithm =
+ Algorithm algorithm =
new Algorithm(algorithmType.getRequiredKey(), algorithmType.getJCEName(),
algorithmType.getAlgorithmClass(), keyLength,
ivLength, algorithmType.getJCEProvider());
-
+
register(algorithmType.getURI(), algorithm);
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ResourceResolverMapper.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ResourceResolverMapper.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ResourceResolverMapper.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/ResourceResolverMapper.java Tue Dec 15 17:13:17 2015
@@ -45,7 +45,7 @@ public class ResourceResolverMapper {
resourceResolvers = new ArrayList<ResourceResolverLookup>(handlerList.size() + 1);
for (int i = 0; i < handlerList.size(); i++) {
ResolverType uriResolverType = handlerList.get(i);
- resourceResolvers.add((ResourceResolverLookup)
+ resourceResolvers.add((ResourceResolverLookup)
ClassLoaderUtils.loadClass(uriResolverType.getJAVACLASS(), callingClass).newInstance());
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/SecurityHeaderHandlerMapper.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/SecurityHeaderHandlerMapper.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/SecurityHeaderHandlerMapper.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/SecurityHeaderHandlerMapper.java Tue Dec 15 17:13:17 2015
@@ -48,7 +48,7 @@ public class SecurityHeaderHandlerMapper
for (int i = 0; i < handlerList.size(); i++) {
HandlerType handlerType = handlerList.get(i);
QName qName = new QName(handlerType.getURI(), handlerType.getNAME());
- handlerClassMap.put(qName,
+ handlerClassMap.put(qName,
ClassLoaderUtils.loadClass(handlerType.getJAVACLASS(), callingClass));
}
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/TransformerAlgorithmMapper.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/TransformerAlgorithmMapper.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/TransformerAlgorithmMapper.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/TransformerAlgorithmMapper.java Tue Dec 15 17:13:17 2015
@@ -53,13 +53,13 @@ public class TransformerAlgorithmMapper
for (int i = 0; i < algorithms.size(); i++) {
TransformAlgorithmType algorithmType = algorithms.get(i);
if (algorithmType.getINOUT() == null) {
- algorithmsClassMapInOut.put(algorithmType.getURI(),
+ algorithmsClassMapInOut.put(algorithmType.getURI(),
ClassLoaderUtils.loadClass(algorithmType.getJAVACLASS(), callingClass));
} else if ("IN".equals(algorithmType.getINOUT().value())) {
- algorithmsClassMapIn.put(algorithmType.getURI(),
+ algorithmsClassMapIn.put(algorithmType.getURI(),
ClassLoaderUtils.loadClass(algorithmType.getJAVACLASS(), callingClass));
} else if ("OUT".equals(algorithmType.getINOUT().value())) {
- algorithmsClassMapOut.put(algorithmType.getURI(),
+ algorithmsClassMapOut.put(algorithmType.getURI(),
ClassLoaderUtils.loadClass(algorithmType.getJAVACLASS(), callingClass));
} else {
throw new IllegalArgumentException("INOUT parameter " + algorithmType.getINOUT().value() + " unsupported");
@@ -83,7 +83,7 @@ public class TransformerAlgorithmMapper
clazz = algorithmsClassMapInOut.get(algoURI);
}
if (clazz == null) {
- throw new XMLSecurityException("signature.Transform.UnknownTransform",
+ throw new XMLSecurityException("signature.Transform.UnknownTransform",
new Object[] {algoURI});
}
return clazz;
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/XIncludeHandler.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/XIncludeHandler.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/XIncludeHandler.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/config/XIncludeHandler.java Tue Dec 15 17:13:17 2015
@@ -148,7 +148,7 @@ public class XIncludeHandler extends Def
} catch (URISyntaxException ex) {
throw new SAXException(ex);
}
-
+
if (document == null) {
DOMResult domResult = new DOMResult();
try {
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/AbstractBufferingOutputProcessor.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/AbstractBufferingOutputProcessor.java?rev=1720201&r1=1720200&r2=1720201&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/AbstractBufferingOutputProcessor.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/stax/ext/AbstractBufferingOutputProcessor.java Tue Dec 15 17:13:17 2015
@@ -66,7 +66,7 @@ public abstract class AbstractBufferingO
throws XMLStreamException, XMLSecurityException {
this.processHeaderEvent(outputProcessorChain);
-
+
//loop through the rest of the document
while (!xmlSecEventDeque.isEmpty()) {
XMLSecEvent xmlSecEvent = xmlSecEventDeque.pop();