--- old/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java 2013-06-28 11:33:42.510150360 -0400
+++ new/src/share/classes/com/sun/org/apache/xml/internal/security/keys/keyresolver/KeyResolver.java 2013-06-28 11:33:42.338155717 -0400
@@ -31,10 +31,13 @@
import javax.crypto.SecretKey;
+import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.DEREncodedKeyValueResolver;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.DSAKeyValueResolver;
+import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.KeyInfoReferenceResolver;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.RSAKeyValueResolver;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.RetrievalMethodResolver;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509CertificateResolver;
+import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509DigestResolver;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509IssuerSerialResolver;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509SKIResolver;
import com.sun.org.apache.xml.internal.security.keys.keyresolver.implementations.X509SubjectNameResolver;
@@ -49,7 +52,7 @@
public class KeyResolver {
/** {@link org.apache.commons.logging} logging facility */
- private static java.util.logging.Logger log =
+ private static java.util.logging.Logger log =
java.util.logging.Logger.getLogger(KeyResolver.class.getName());
/** Field resolverVector */
@@ -57,10 +60,10 @@
/** Field resolverSpi */
private final KeyResolverSpi resolverSpi;
-
+
/**
* Constructor.
- *
+ *
* @param keyResolverSpi a KeyResolverSpi instance
*/
private KeyResolver(KeyResolverSpi keyResolverSpi) {
@@ -83,7 +86,7 @@
* @param baseURI
* @param storage
* @return The certificate represented by the element.
- *
+ *
* @throws KeyResolverException
*/
public static final X509Certificate getX509Certificate(
@@ -94,7 +97,7 @@
Object exArgs[] = {
(((element != null)
&& (element.getNodeType() == Node.ELEMENT_NODE))
- ? element.getTagName() : "null")
+ ? element.getTagName() : "null")
};
throw new KeyResolverException("utils.resolver.noClass", exArgs);
@@ -111,7 +114,7 @@
Object exArgs[] = {
(((element != null) && (element.getNodeType() == Node.ELEMENT_NODE))
- ? element.getTagName() : "null")
+ ? element.getTagName() : "null")
};
throw new KeyResolverException("utils.resolver.noClass", exArgs);
@@ -124,7 +127,7 @@
* @param baseURI
* @param storage
* @return the public key contained in the element
- *
+ *
* @throws KeyResolverException
*/
public static final PublicKey getPublicKey(
@@ -152,7 +155,7 @@
Object exArgs[] = {
(((element != null) && (element.getNodeType() == Node.ELEMENT_NODE))
- ? element.getTagName() : "null")
+ ? element.getTagName() : "null")
};
throw new KeyResolverException("utils.resolver.noClass", exArgs);
@@ -162,18 +165,18 @@
* This method is used for registering {@link KeyResolverSpi}s which are
* available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that
* personalized {@link KeyResolverSpi}s should only be registered directly
- * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
+ * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
* {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}.
- * Please note that this method will create a new copy of the underlying array, as the
+ * Please note that this method will create a new copy of the underlying array, as the
* underlying collection is a CopyOnWriteArrayList.
*
* @param className
* @param globalResolver Whether the KeyResolverSpi is a global resolver or not
- * @throws InstantiationException
- * @throws IllegalAccessException
- * @throws ClassNotFoundException
+ * @throws InstantiationException
+ * @throws IllegalAccessException
+ * @throws ClassNotFoundException
*/
- public static void register(String className, boolean globalResolver)
+ public static void register(String className, boolean globalResolver)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
KeyResolverSpi keyResolverSpi =
(KeyResolverSpi) Class.forName(className).newInstance();
@@ -185,9 +188,9 @@
* This method is used for registering {@link KeyResolverSpi}s which are
* available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that
* personalized {@link KeyResolverSpi}s should only be registered directly
- * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
+ * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
* {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}.
- * Please note that this method will create a new copy of the underlying array, as the
+ * Please note that this method will create a new copy of the underlying array, as the
* underlying collection is a CopyOnWriteArrayList.
*
* @param className
@@ -213,21 +216,21 @@
keyResolverSpi.setGlobalResolver(globalResolver);
register(keyResolverSpi, true);
}
-
+
/**
* This method is used for registering {@link KeyResolverSpi}s which are
* available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that
* personalized {@link KeyResolverSpi}s should only be registered directly
- * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
+ * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
* {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}.
- * Please note that this method will create a new copy of the underlying array, as the
+ * Please note that this method will create a new copy of the underlying array, as the
* underlying collection is a CopyOnWriteArrayList.
*
* @param keyResolverSpi a KeyResolverSpi instance to register
* @param start whether to register the KeyResolverSpi at the start of the list or not
*/
public static void register(
- KeyResolverSpi keyResolverSpi,
+ KeyResolverSpi keyResolverSpi,
boolean start
) {
KeyResolver resolver = new KeyResolver(keyResolverSpi);
@@ -237,22 +240,22 @@
resolverVector.add(resolver);
}
}
-
+
/**
* This method is used for registering {@link KeyResolverSpi}s which are
* available to all {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} objects. This means that
* personalized {@link KeyResolverSpi}s should only be registered directly
- * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
+ * to the {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo} using
* {@link com.sun.org.apache.xml.internal.security.keys.KeyInfo#registerInternalKeyResolver}.
* The KeyResolverSpi instances are not registered as a global resolver.
- *
+ *
*
* @param classNames
- * @throws InstantiationException
- * @throws IllegalAccessException
- * @throws ClassNotFoundException
+ * @throws InstantiationException
+ * @throws IllegalAccessException
+ * @throws ClassNotFoundException
*/
- public static void registerClassNames(List classNames)
+ public static void registerClassNames(List classNames)
throws ClassNotFoundException, IllegalAccessException, InstantiationException {
List keyResolverList = new ArrayList(classNames.size());
for (String className : classNames) {
@@ -263,12 +266,12 @@
}
resolverVector.addAll(keyResolverList);
}
-
+
/**
* This method registers the default resolvers.
*/
public static void registerDefaultResolvers() {
-
+
List keyResolverList = new ArrayList();
keyResolverList.add(new KeyResolver(new RSAKeyValueResolver()));
keyResolverList.add(new KeyResolver(new DSAKeyValueResolver()));
@@ -277,7 +280,10 @@
keyResolverList.add(new KeyResolver(new RetrievalMethodResolver()));
keyResolverList.add(new KeyResolver(new X509SubjectNameResolver()));
keyResolverList.add(new KeyResolver(new X509IssuerSerialResolver()));
-
+ keyResolverList.add(new KeyResolver(new DEREncodedKeyValueResolver()));
+ keyResolverList.add(new KeyResolver(new KeyInfoReferenceResolver()));
+ keyResolverList.add(new KeyResolver(new X509DigestResolver()));
+
resolverVector.addAll(keyResolverList);
}
@@ -286,9 +292,9 @@
*
* @param element
* @param baseURI
- * @param storage
+ * @param storage
* @return resolved public key from the registered from the elements
- *
+ *
* @throws KeyResolverException
*/
public PublicKey resolvePublicKey(
@@ -304,7 +310,7 @@
* @param baseURI
* @param storage
* @return resolved X509certificate key from the registered from the elements
- *
+ *
* @throws KeyResolverException
*/
public X509Certificate resolveX509Certificate(