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 2011/02/24 11:25:27 UTC
svn commit: r1074098 - in
/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security:
c14n/implementations/ encryption/
Author: coheigea
Date: Thu Feb 24 10:25:27 2011
New Revision: 1074098
URL: http://svn.apache.org/viewvc?rev=1074098&view=rev
Log:
[SANTUARIO-259] - Finished first pass at c14n, and on to Encryption.
Modified:
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/c14n/implementations/Canonicalizer11.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/AgreementMethod.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherData.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherReference.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherValue.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedData.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedKey.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedType.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionMethod.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperties.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperty.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Reference.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/ReferenceList.java
santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Transforms.java
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/c14n/implementations/Canonicalizer11.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/c14n/implementations/Canonicalizer11.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/c14n/implementations/Canonicalizer11.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/c14n/implementations/Canonicalizer11.java Thu Feb 24 10:25:27 2011
@@ -51,30 +51,31 @@ import org.apache.xml.security.utils.XML
*
* @author Sean Mullan
* @author Raul Benito
- * @version $Revision: 429012 $
*/
public abstract class Canonicalizer11 extends CanonicalizerBase {
- boolean firstCall = true;
- final SortedSet result = new TreeSet(COMPARE);
+
static final String XMLNS_URI = Constants.NamespaceSpecNS;
static final String XML_LANG_URI = Constants.XML_LANG_SPACE_SpecNS;
static Log log = LogFactory.getLog(Canonicalizer11.class.getName());
static class XmlAttrStack {
- int currentLevel = 0;
- int lastlevel = 0;
- XmlsStackElement cur;
static class XmlsStackElement {
int level;
boolean rendered = false;
- List nodes = new ArrayList();
+ List<Attr> nodes = new ArrayList<Attr>();
};
- List levels = new ArrayList();
+
+ int currentLevel = 0;
+ int lastlevel = 0;
+ XmlsStackElement cur;
+ List<XmlsStackElement> levels = new ArrayList<XmlsStackElement>();
+
void push(int level) {
currentLevel = level;
- if (currentLevel == -1)
+ if (currentLevel == -1) {
return;
+ }
cur = null;
while (lastlevel >= currentLevel) {
levels.remove(levels.size() - 1);
@@ -82,9 +83,10 @@ public abstract class Canonicalizer11 ex
lastlevel = 0;
return;
}
- lastlevel=((XmlsStackElement)levels.get(levels.size()-1)).level;
+ lastlevel = (levels.get(levels.size() - 1)).level;
}
}
+
void addXmlnsAttr(Attr n) {
if (cur == null) {
cur = new XmlsStackElement();
@@ -94,7 +96,8 @@ public abstract class Canonicalizer11 ex
}
cur.nodes.add(n);
}
- void getXmlnsAttr(Collection col) {
+
+ void getXmlnsAttr(Collection<Attr> col) {
if (cur == null) {
cur = new XmlsStackElement();
cur.level = currentLevel;
@@ -107,27 +110,28 @@ public abstract class Canonicalizer11 ex
if (size == -1) {
parentRendered = true;
} else {
- e = (XmlsStackElement) levels.get(size);
- if (e.rendered && e.level+1 == currentLevel)
+ e = levels.get(size);
+ if (e.rendered && e.level + 1 == currentLevel) {
parentRendered = true;
+ }
}
if (parentRendered) {
col.addAll(cur.nodes);
cur.rendered = true;
return;
}
-
- Map loa = new HashMap();
- List baseAttrs = new ArrayList();
+
+ Map<String, Attr> loa = new HashMap<String, Attr>();
+ List<Attr> baseAttrs = new ArrayList<Attr>();
boolean successiveOmitted = true;
- for (;size>=0;size--) {
- e = (XmlsStackElement) levels.get(size);
+ for (; size >= 0; size--) {
+ e = levels.get(size);
if (e.rendered) {
successiveOmitted = false;
}
- Iterator it = e.nodes.iterator();
+ Iterator<Attr> it = e.nodes.iterator();
while (it.hasNext() && successiveOmitted) {
- Attr n = (Attr) it.next();
+ Attr n = it.next();
if (n.getLocalName().equals("base")) {
if (!e.rendered) {
baseAttrs.add(n);
@@ -137,11 +141,11 @@ public abstract class Canonicalizer11 ex
}
}
if (!baseAttrs.isEmpty()) {
- Iterator it = cur.nodes.iterator();
+ Iterator<Attr> it = cur.nodes.iterator();
String base = null;
Attr baseAttr = null;
while (it.hasNext()) {
- Attr n = (Attr) it.next();
+ Attr n = it.next();
if (n.getLocalName().equals("base")) {
base = n.getValue();
baseAttr = n;
@@ -150,7 +154,7 @@ public abstract class Canonicalizer11 ex
}
it = baseAttrs.iterator();
while (it.hasNext()) {
- Attr n = (Attr) it.next();
+ Attr n = it.next();
if (base == null) {
base = n.getValue();
baseAttr = n;
@@ -167,12 +171,16 @@ public abstract class Canonicalizer11 ex
col.add(baseAttr);
}
}
-
+
cur.rendered = true;
col.addAll(loa.values());
}
};
+
XmlAttrStack xmlattrStack = new XmlAttrStack();
+
+ boolean firstCall = true;
+ final SortedSet<Attr> result = new TreeSet<Attr>(COMPARE);
/**
* Constructor Canonicalizer11
@@ -184,7 +192,7 @@ public abstract class Canonicalizer11 ex
}
/**
- * Returns the Attr[]s to be outputted for the given element.
+ * Returns the Attr[]s to be output for the given element.
* <br>
* The code of this method is a copy of {@link #handleAttributes(Element,
* NameSpaceSymbTable)},
@@ -195,20 +203,20 @@ public abstract class Canonicalizer11 ex
*
* @param E
* @param ns
- * @return the Attr[]s to be outputted
+ * @return the Attr[]s to be output
* @throws CanonicalizationException
*/
- Iterator handleAttributesSubtree(Element E, NameSpaceSymbTable ns)
+ Iterator<Attr> handleAttributesSubtree(Element E, NameSpaceSymbTable ns)
throws CanonicalizationException {
if (!E.hasAttributes() && !firstCall) {
return null;
}
// result will contain the attrs which have to be outputted
- final SortedSet result = this.result;
+ final SortedSet<Attr> result = this.result;
result.clear();
NamedNodeMap attrs = E.getAttributes();
int attrsLength = attrs.getLength();
-
+
for (int i = 0; i < attrsLength; i++) {
Attr N = (Attr) attrs.item(i);
String NUri = N.getNamespaceURI();
@@ -222,25 +230,25 @@ public abstract class Canonicalizer11 ex
String NName = N.getLocalName();
String NValue = N.getValue();
- if (XML.equals(NName)
- && XML_LANG_URI.equals(NValue)) {
+ if (XML.equals(NName) && XML_LANG_URI.equals(NValue)) {
// The default mapping for xml must not be output.
continue;
}
-
+
Node n = ns.addMappingAndRender(NName, NValue, N);
-
+
if (n != null) {
// Render the ns definition
- result.add(n);
+ result.add((Attr)n);
if (C14nHelper.namespaceIsRelative(N)) {
Object exArgs[] = {E.getTagName(), NName, N.getNodeValue()};
throw new CanonicalizationException(
- "c14n.Canonicalizer.RelativeNamespace", exArgs);
+ "c14n.Canonicalizer.RelativeNamespace", exArgs
+ );
}
}
}
-
+
if (firstCall) {
// It is the first node of the subtree
// Obtain all the namespaces defined in the parents, and added
@@ -250,12 +258,12 @@ public abstract class Canonicalizer11 ex
xmlattrStack.getXmlnsAttr(result);
firstCall = false;
}
-
+
return result.iterator();
}
/**
- * Returns the Attr[]s to be outputted for the given element.
+ * Returns the Attr[]s to be output for the given element.
* <br>
* IMPORTANT: This method expects to work on a modified DOM tree, i.e. a
* DOM which has been prepared using
@@ -264,10 +272,10 @@ public abstract class Canonicalizer11 ex
*
* @param E
* @param ns
- * @return the Attr[]s to be outputted
+ * @return the Attr[]s to be output
* @throws CanonicalizationException
*/
- Iterator handleAttributes(Element E, NameSpaceSymbTable ns)
+ Iterator<Attr> handleAttributes(Element E, NameSpaceSymbTable ns)
throws CanonicalizationException {
// result will contain the attrs which have to be output
xmlattrStack.push(ns.getLevel());
@@ -278,14 +286,14 @@ public abstract class Canonicalizer11 ex
attrs = E.getAttributes();
attrsLength = attrs.getLength();
}
-
- SortedSet result = this.result;
+
+ SortedSet<Attr> result = this.result;
result.clear();
-
+
for (int i = 0; i < attrsLength; i++) {
Attr N = (Attr) attrs.item(i);
String NUri = N.getNamespaceURI();
-
+
if (!XMLNS_URI.equals(NUri)) {
// A non namespace definition node.
if (XML_LANG_URI.equals(NUri)) {
@@ -309,8 +317,7 @@ public abstract class Canonicalizer11 ex
String NName = N.getLocalName();
String NValue = N.getValue();
- if ("xml".equals(NName)
- && XML_LANG_URI.equals(NValue)) {
+ if ("xml".equals(NName) && XML_LANG_URI.equals(NValue)) {
/* except omit namespace node with local name xml, which defines
* the xml prefix, if its string value is
* http://www.w3.org/XML/1998/namespace.
@@ -328,12 +335,13 @@ public abstract class Canonicalizer11 ex
// (NName, NValue, N, isRealVisible);
Node n = ns.addMappingAndRender(NName, NValue, N);
if (n != null) {
- result.add(n);
+ result.add((Attr)n);
if (C14nHelper.namespaceIsRelative(N)) {
Object exArgs[] =
- { E.getTagName(), NName, N.getNodeValue() };
+ { E.getTagName(), NName, N.getNodeValue() };
throw new CanonicalizationException(
- "c14n.Canonicalizer.RelativeNamespace", exArgs);
+ "c14n.Canonicalizer.RelativeNamespace", exArgs
+ );
}
}
} else {
@@ -358,14 +366,14 @@ public abstract class Canonicalizer11 ex
}
// output the xmlns def if needed.
if (n != null) {
- result.add(n);
+ result.add((Attr)n);
}
// Float all xml:* attributes of the unselected parent elements to
// this one. addXmlAttributes(E,result);
xmlattrStack.getXmlnsAttr(result);
ns.getUnrenderedNodes(result);
}
-
+
return result.iterator();
}
@@ -377,10 +385,10 @@ public abstract class Canonicalizer11 ex
* @return none it always fails
* @throws CanonicalizationException always
*/
- public byte[] engineCanonicalizeXPathNodeSet(Set xpathNodeSet,
- String inclusiveNamespaces) throws CanonicalizationException {
- throw new CanonicalizationException(
- "c14n.Canonicalizer.UnsupportedOperation");
+ public byte[] engineCanonicalizeXPathNodeSet(
+ Set<Node> xpathNodeSet, String inclusiveNamespaces
+ ) throws CanonicalizationException {
+ throw new CanonicalizationException("c14n.Canonicalizer.UnsupportedOperation");
}
/**
@@ -391,17 +399,18 @@ public abstract class Canonicalizer11 ex
* @return none it always fails
* @throws CanonicalizationException
*/
- public byte[] engineCanonicalizeSubTree(Node rootNode,
- String inclusiveNamespaces) throws CanonicalizationException {
- throw new CanonicalizationException(
- "c14n.Canonicalizer.UnsupportedOperation");
+ public byte[] engineCanonicalizeSubTree(
+ Node rootNode, String inclusiveNamespaces
+ ) throws CanonicalizationException {
+ throw new CanonicalizationException("c14n.Canonicalizer.UnsupportedOperation");
}
void circumventBugIfNeeded(XMLSignatureInput input)
throws CanonicalizationException, ParserConfigurationException,
IOException, SAXException {
- if (!input.isNeedsToBeExpanded())
+ if (!input.isNeedsToBeExpanded()) {
return;
+ }
Document doc = null;
if (input.getSubNode() != null) {
doc = XMLUtils.getOwnerDocument(input.getSubNode());
@@ -410,7 +419,7 @@ public abstract class Canonicalizer11 ex
}
XMLUtils.circumventBug2650(doc);
}
-
+
void handleParent(Element e, NameSpaceSymbTable ns) {
if (!e.hasAttributes()) {
return;
@@ -430,21 +439,18 @@ public abstract class Canonicalizer11 ex
String NName = N.getLocalName();
String NValue = N.getNodeValue();
- if (XML.equals(NName)
- && Constants.XML_LANG_SPACE_SpecNS.equals(NValue)) {
+ if (XML.equals(NName) && Constants.XML_LANG_SPACE_SpecNS.equals(NValue)) {
continue;
}
ns.addMapping(NName,NValue,N);
}
}
- private static String joinURI(String baseURI, String relativeURI)
- throws URISyntaxException {
+ private static String joinURI(String baseURI, String relativeURI) throws URISyntaxException {
String bscheme = null;
String bauthority = null;
String bpath = "";
String bquery = null;
- String bfragment = null; // Is this correct?
// pre-parse the baseURI
if (baseURI != null) {
@@ -456,7 +462,6 @@ public abstract class Canonicalizer11 ex
bauthority = base.getAuthority();
bpath = base.getPath();
bquery = base.getQuery();
- bfragment = base.getFragment();
}
URI r = new URI(relativeURI);
@@ -515,8 +520,9 @@ public abstract class Canonicalizer11 ex
}
private static String removeDotSegments(String path) {
-
- log.debug("STEP OUTPUT BUFFER\t\tINPUT BUFFER");
+ if (log.isDebugEnabled()) {
+ log.debug("STEP OUTPUT BUFFER\t\tINPUT BUFFER");
+ }
// 1. The input buffer is initialized with the now-appended path
// components then replace occurrences of "//" in the input buffer
@@ -527,7 +533,7 @@ public abstract class Canonicalizer11 ex
}
// Initialize the output buffer with the empty string.
- StringBuffer output = new StringBuffer();
+ StringBuilder output = new StringBuilder();
// If the input buffer starts with a root slash "/" then move this
// character to the output buffer.
@@ -555,9 +561,9 @@ public abstract class Canonicalizer11 ex
output.append("../");
}
printStep("2A", output.toString(), input);
- // 2B. if the input buffer begins with a prefix of "/./" or "/.",
- // where "." is a complete path segment, then replace that prefix
- // with "/" in the input buffer; otherwise,
+ // 2B. if the input buffer begins with a prefix of "/./" or "/.",
+ // where "." is a complete path segment, then replace that prefix
+ // with "/" in the input buffer; otherwise,
} else if (input.startsWith("/./")) {
input = input.substring(2);
printStep("2B", output.toString(), input);
@@ -565,16 +571,16 @@ public abstract class Canonicalizer11 ex
// FIXME: what is complete path segment?
input = input.replaceFirst("/.", "/");
printStep("2B", output.toString(), input);
- // 2C. if the input buffer begins with a prefix of "/../" or "/..",
- // where ".." is a complete path segment, then replace that prefix
- // with "/" in the input buffer and if also the output buffer is
- // empty, last segment in the output buffer equals "../" or "..",
- // where ".." is a complete path segment, then append ".." or "/.."
- // for the latter case respectively to the output buffer else
- // remove the last segment and its preceding "/" (if any) from the
- // output buffer and if hereby the first character in the output
- // buffer was removed and it was not the root slash then delete a
- // leading slash from the input buffer; otherwise,
+ // 2C. if the input buffer begins with a prefix of "/../" or "/..",
+ // where ".." is a complete path segment, then replace that prefix
+ // with "/" in the input buffer and if also the output buffer is
+ // empty, last segment in the output buffer equals "../" or "..",
+ // where ".." is a complete path segment, then append ".." or "/.."
+ // for the latter case respectively to the output buffer else
+ // remove the last segment and its preceding "/" (if any) from the
+ // output buffer and if hereby the first character in the output
+ // buffer was removed and it was not the root slash then delete a
+ // leading slash from the input buffer; otherwise,
} else if (input.startsWith("/../")) {
input = input.substring(3);
if (output.length() == 0) {
@@ -586,7 +592,7 @@ public abstract class Canonicalizer11 ex
} else {
int index = output.lastIndexOf("/");
if (index == -1) {
- output = new StringBuffer();
+ output = new StringBuilder();
if (input.charAt(0) == '/') {
input = input.substring(1);
}
@@ -607,7 +613,7 @@ public abstract class Canonicalizer11 ex
} else {
int index = output.lastIndexOf("/");
if (index == -1) {
- output = new StringBuffer();
+ output = new StringBuilder();
if (input.charAt(0) == '/') {
input = input.substring(1);
}
@@ -616,11 +622,11 @@ public abstract class Canonicalizer11 ex
}
}
printStep("2C", output.toString(), input);
- // 2D. if the input buffer consists only of ".", then remove
- // that from the input buffer else if the input buffer consists
- // only of ".." and if the output buffer does not contain only
- // the root slash "/", then move the ".." to the output buffer
- // else delte it.; otherwise,
+ // 2D. if the input buffer consists only of ".", then remove
+ // that from the input buffer else if the input buffer consists
+ // only of ".." and if the output buffer does not contain only
+ // the root slash "/", then move the ".." to the output buffer
+ // else delte it.; otherwise,
} else if (input.equals(".")) {
input = "";
printStep("2D", output.toString(), input);
@@ -629,10 +635,10 @@ public abstract class Canonicalizer11 ex
output.append("..");
input = "";
printStep("2D", output.toString(), input);
- // 2E. move the first path segment (if any) in the input buffer
- // to the end of the output buffer, including the initial "/"
- // character (if any) and any subsequent characters up to, but not
- // including, the next "/" character or the end of the input buffer.
+ // 2E. move the first path segment (if any) in the input buffer
+ // to the end of the output buffer, including the initial "/"
+ // character (if any) and any subsequent characters up to, but not
+ // including, the next "/" character or the end of the input buffer.
} else {
int end = -1;
int begin = input.indexOf('/');
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/AgreementMethod.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/AgreementMethod.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/AgreementMethod.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/AgreementMethod.java Thu Feb 24 10:25:27 2011
@@ -16,12 +16,10 @@
*/
package org.apache.xml.security.encryption;
-
import java.util.Iterator;
import org.apache.xml.security.keys.KeyInfo;
import org.w3c.dom.Element;
-
/**
* A Key Agreement algorithm provides for the derivation of a shared secret key
* based on a shared secret computed from certain types of compatible public
@@ -75,6 +73,7 @@ import org.w3c.dom.Element;
* @author Axl Mattheus
*/
public interface AgreementMethod {
+
/**
* Returns an <code>byte</code> array.
* @return
@@ -88,10 +87,10 @@ public interface AgreementMethod {
void setKANonce(byte[] kanonce);
/**
- * Returns aditional information regarding the <code>AgreementMethod</code>.
+ * Returns additional information regarding the <code>AgreementMethod</code>.
* @return
*/
- Iterator getAgreementMethodInformation();
+ Iterator<Element> getAgreementMethodInformation();
/**
* Adds additional <code>AgreementMethod</code> information.
@@ -130,7 +129,7 @@ public interface AgreementMethod {
void setOriginatorKeyInfo(KeyInfo keyInfo);
/**
- * Retruns information relating to the recipient's shared secret.
+ * Returns information relating to the recipient's shared secret.
*
* @return information relating to the recipient's shared secret.
*/
@@ -150,4 +149,3 @@ public interface AgreementMethod {
*/
String getAlgorithm();
}
-
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherData.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherData.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherData.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherData.java Thu Feb 24 10:25:27 2011
@@ -16,7 +16,6 @@
*/
package org.apache.xml.security.encryption;
-
/**
* <code>CipherData</code> provides encrypted data. It must either contain the
* encrypted octet sequence as base64 encoded text of the
@@ -38,8 +37,10 @@ package org.apache.xml.security.encrypti
* @author Axl Mattheus
*/
public interface CipherData {
+
/** VALUE_TYPE ASN */
public static final int VALUE_TYPE = 0x00000001;
+
/** REFERENCE_TYPE ASN */
public static final int REFERENCE_TYPE = 0x00000002;
@@ -72,19 +73,17 @@ public interface CipherData {
* Returns a reference to an external location containing the encrypted
* octet sequence (<code>byte</code> array).
*
- * @return the reference to an external location containing the enctrypted
- * octet sequence.
+ * @return the reference to an external location containing the encrypted
+ * octet sequence.
*/
CipherReference getCipherReference();
/**
* Sets the <code>CipherData</code>'s reference.
*
- * @param reference an external location containing the enctrypted octet
- * sequence.
+ * @param reference an external location containing the encrypted octet sequence.
* @throws XMLEncryptionException
*/
- void setCipherReference(CipherReference reference) throws
- XMLEncryptionException;
+ void setCipherReference(CipherReference reference) throws XMLEncryptionException;
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherReference.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherReference.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherReference.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherReference.java Thu Feb 24 10:25:27 2011
@@ -18,14 +18,12 @@ package org.apache.xml.security.encrypti
import org.w3c.dom.Attr;
-
/**
* <code>CipherReference</code> identifies a source which, when processed,
* yields the encrypted octet sequence.
* <p>
* The actual value is obtained as follows. The <code>CipherReference URI</code>
* contains an identifier that is dereferenced. Should the
- * <code>CipherReference</code> element contain an OPTIONAL sequence of
* Transforms, the data resulting from dereferencing the <code>URI</code> is
* transformed as specified so as to yield the intended cipher value. For
* example, if the value is base64 encoded within an XML document; the
@@ -62,16 +60,16 @@ public interface CipherReference {
*/
String getURI();
- /**
- * Gets the URI as an Attribute node. Used to meld the CipherREference
- * with the XMLSignature ResourceResolvers
+ /**
+ * Gets the URI as an Attribute node. Used to meld the CipherREference
+ * with the XMLSignature ResourceResolvers
* @return
- */
- public Attr getURIAsAttr();
+ */
+ public Attr getURIAsAttr();
/**
* Returns the <code>Transforms</code> that specifies how to transform the
- * <code>URI</code> to yield the appropiate cipher value.
+ * <code>URI</code> to yield the appropriate cipher value.
*
* @return the transform that specifies how to transform the reference to
* yield the intended cipher value.
@@ -80,7 +78,7 @@ public interface CipherReference {
/**
* Sets the <code>Transforms</code> that specifies how to transform the
- * <code>URI</code> to yield the appropiate cipher value.
+ * <code>URI</code> to yield the appropriate cipher value.
*
* @param transforms the set of <code>Transforms</code> that specifies how
* to transform the reference to yield the intended cipher value.
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherValue.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherValue.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherValue.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/CipherValue.java Thu Feb 24 10:25:27 2011
@@ -16,7 +16,6 @@
*/
package org.apache.xml.security.encryption;
-
/**
* <code>CipherValue</code> is the wrapper for cipher text.
*
@@ -24,20 +23,18 @@ package org.apache.xml.security.encrypti
*/
public interface CipherValue {
/**
- * Resturns the Base 64 encoded, encrypted octets that is the
- * <code>CihperValue</code>.
+ * Returns the Base 64 encoded, encrypted octets that is the
+ * <code>CipherValue</code>.
*
* @return cipher value.
*/
- String getValue();
- // byte[] getValue();
-
+ String getValue();
+
/**
* Sets the Base 64 encoded, encrypted octets that is the
- * <code>CihperValue</code>.
+ * <code>CipherValue</code>.
*
* @param value the cipher value.
*/
- void setValue(String value);
- // void setValue(byte[] value);
+ void setValue(String value);
}
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedData.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedData.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedData.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedData.java Thu Feb 24 10:25:27 2011
@@ -16,7 +16,6 @@
*/
package org.apache.xml.security.encryption;
-
/**
* The <code>EncryptedData</code> element is the core element in the syntax. Not
* only does its <code>CipherData</code> child contain the encrypted data, but
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedKey.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedKey.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedKey.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedKey.java Thu Feb 24 10:25:27 2011
@@ -16,8 +16,6 @@
*/
package org.apache.xml.security.encryption;
-
-
/**
* The <code>EncryptedKey</code> element is used to transport encryption keys
* from the originator to a known recipient(s). It may be used as a stand-alone
@@ -47,9 +45,9 @@ package org.apache.xml.security.encrypti
* @author Axl Mattheus
*/
public interface EncryptedKey extends EncryptedType {
+
/**
- * Returns a hint as to which recipient this encrypted key value is intended
- * for.
+ * Returns a hint as to which recipient this encrypted key value is intended for.
*
* @return the recipient of the <code>EncryptedKey</code>.
*/
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedType.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedType.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedType.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptedType.java Thu Feb 24 10:25:27 2011
@@ -16,10 +16,8 @@
*/
package org.apache.xml.security.encryption;
-
import org.apache.xml.security.keys.KeyInfo;
-
/**
* EncryptedType is the abstract type from which <code>EncryptedData</code> and
* <code>EncryptedKey</code> are derived. While these two latter element types
@@ -46,6 +44,7 @@ import org.apache.xml.security.keys.KeyI
* @author Axl Mattheus
*/
public interface EncryptedType {
+
/**
* Returns a <code>String</code> providing for the standard method of
* assigning an id to the element within the document context.
@@ -113,7 +112,7 @@ public interface EncryptedType {
void setMimeType(String type);
/**
- * Retusn an <code>URI</code> representing the encoding of the
+ * Return an <code>URI</code> representing the encoding of the
* <code>EncryptedType</code>.
*
* @return the encoding of this <code>EncryptedType</code>.
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionMethod.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionMethod.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionMethod.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionMethod.java Thu Feb 24 10:25:27 2011
@@ -16,11 +16,9 @@
*/
package org.apache.xml.security.encryption;
-
import java.util.Iterator;
import org.w3c.dom.Element;
-
/**
* <code>EncryptionMethod</code> describes the encryption algorithm applied to
* the cipher data. If the element is absent, the encryption algorithm must be
@@ -85,7 +83,7 @@ public interface EncryptionMethod {
* @return an <code>Iterator</code> over all the additional infomation
* about the <code>EncryptionMethod</code>.
*/
- Iterator getEncryptionMethodInformation();
+ Iterator<Element> getEncryptionMethodInformation();
/**
* Adds encryption method information.
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperties.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperties.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperties.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperties.java Thu Feb 24 10:25:27 2011
@@ -16,10 +16,8 @@
*/
package org.apache.xml.security.encryption;
-
import java.util.Iterator;
-
/**
* <code>EncryptionProperties</code> can hold additional information concerning
* the generation of the <code>EncryptedData</code> or
@@ -42,6 +40,7 @@ import java.util.Iterator;
* @author Axl Mattheus
*/
public interface EncryptionProperties {
+
/**
* Returns the <code>EncryptionProperties</code>' id.
*
@@ -63,7 +62,7 @@ public interface EncryptionProperties {
*
* @return an <code>Iterator</code> over all the encryption properties.
*/
- Iterator getEncryptionProperties();
+ Iterator<EncryptionProperty> getEncryptionProperties();
/**
* Adds an <code>EncryptionProperty</code>.
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperty.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperty.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperty.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/EncryptionProperty.java Thu Feb 24 10:25:27 2011
@@ -16,7 +16,6 @@
*/
package org.apache.xml.security.encryption;
-
import java.util.Iterator;
import org.w3c.dom.Element;
@@ -46,6 +45,7 @@ import org.w3c.dom.Element;
* @author Axl Mattheus
*/
public interface EncryptionProperty {
+
/**
* Returns the <code>EncryptedType</code> being described.
*
@@ -94,10 +94,10 @@ public interface EncryptionProperty {
/**
* Returns the properties of the <CODE>EncryptionProperty</CODE>.
*
- * @return an <code>Iterator</code> over all the addiitonal encryption
+ * @return an <code>Iterator</code> over all the additional encryption
* information contained in this class.
*/
- Iterator getEncryptionInformation();
+ Iterator<Element> getEncryptionInformation();
/**
* Adds encryption information.
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Reference.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Reference.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Reference.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Reference.java Thu Feb 24 10:25:27 2011
@@ -16,11 +16,9 @@
*/
package org.apache.xml.security.encryption;
-
import java.util.Iterator;
import org.w3c.dom.Element;
-
/**
* A wrapper for a pointer from a key value of an <code>EncryptedKey</code> to
* items encrypted by that key value (<code>EncryptedData</code> or
@@ -70,7 +68,7 @@ public interface Reference {
*
* @return child elements.
*/
- Iterator getElementRetrievalInformation();
+ Iterator<Element> getElementRetrievalInformation();
/**
* Adds retrieval information.
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/ReferenceList.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/ReferenceList.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/ReferenceList.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/ReferenceList.java Thu Feb 24 10:25:27 2011
@@ -16,10 +16,8 @@
*/
package org.apache.xml.security.encryption;
-
import java.util.Iterator;
-
/**
* <code>ReferenceList</code> is an element that contains pointers from a key
* value of an <code>EncryptedKey</code> to items encrypted by that key value
@@ -41,8 +39,10 @@ import java.util.Iterator;
* @see Reference
*/
public interface ReferenceList {
- /** DATA TAG */
+
+ /** DATA TAG */
public static final int DATA_REFERENCE = 0x00000001;
+
/** KEY TAG */
public static final int KEY_REFERENCE = 0x00000002;
@@ -79,11 +79,11 @@ public interface ReferenceList {
/**
* Returns an <code>Iterator</code> over all the <code>Reference</code>s
- * contatined in this <code>ReferenceList</code>.
+ * contained in this <code>ReferenceList</code>.
*
* @return Iterator.
*/
- public Iterator getReferences();
+ public Iterator<Reference> getReferences();
/**
* <code>DataReference</code> factory method. Returns a
Modified: santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Transforms.java
URL: http://svn.apache.org/viewvc/santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Transforms.java?rev=1074098&r1=1074097&r2=1074098&view=diff
==============================================================================
--- santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Transforms.java (original)
+++ santuario/xml-security-java/trunk/src/main/java/org/apache/xml/security/encryption/Transforms.java Thu Feb 24 10:25:27 2011
@@ -16,9 +16,6 @@
*/
package org.apache.xml.security.encryption;
-
-
-
/**
* A container for <code>ds:Transform</code>s.
* <p>
@@ -36,36 +33,13 @@ package org.apache.xml.security.encrypti
*/
public interface Transforms {
/**
- * Returns an <code>Iterator</code> over all the transforms contained in
- * this transform list.
- *
- * @return all transforms.
- */
- /* Iterator getTransforms(); */
-
- /**
- * Adds a <code>ds:Transform</code> to the list of transforms.
- *
- * @param transform.
- */
- /* void addTransform(Transform transform); */
-
- /**
- * Removes the specified transform.
- *
- * @param transform.
- */
- /* void removeTransform(Transform transform); */
-
- /**
- * Temporary method to turn the XMLEncryption Transforms class
- * into a DS class. The main logic is currently implemented in the
- * DS class, so we need to get to get the base class.
- * <p>
- * <b>Note</b> This will be removed in future versions
+ * Temporary method to turn the XMLEncryption Transforms class
+ * into a DS class. The main logic is currently implemented in the
+ * DS class, so we need to get to get the base class.
+ * <p>
+ * <b>Note</b> This will be removed in future versions
* @return
- */
-
- org.apache.xml.security.transforms.Transforms getDSTransforms();
+ */
+ org.apache.xml.security.transforms.Transforms getDSTransforms();
}