Module org.apache.santuario.xmlsec
Class KeyResolver
- java.lang.Object
-
- org.apache.xml.security.keys.keyresolver.KeyResolver
-
public class KeyResolver extends java.lang.ObjectKeyResolver is factory class for subclass of KeyResolverSpi that represent child element of KeyInfo.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static classKeyResolver.ResolverIteratorIterate over the KeyResolverSpi instances
-
Field Summary
Fields Modifier and Type Field Description private static java.util.concurrent.atomic.AtomicBooleandefaultResolversAddedprivate static java.lang.System.LoggerLOGprivate static java.util.List<KeyResolverSpi>resolverList
-
Constructor Summary
Constructors Constructor Description KeyResolver()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.security.PublicKeygetPublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method getPublicKeystatic java.security.cert.X509CertificategetX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation)Method getX509Certificatestatic java.util.Iterator<KeyResolverSpi>iterator()static intlength()Method lengthstatic voidregister(java.lang.String className)This method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects.static voidregister(KeyResolverSpi keyResolverSpi, boolean start)This method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects.static voidregisterAtStart(java.lang.String className)This method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects.static voidregisterClassNames(java.util.List<java.lang.String> classNames)This method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects.static voidregisterDefaultResolvers()This method registers the default resolvers.
-
-
-
Field Detail
-
LOG
private static final java.lang.System.Logger LOG
-
resolverList
private static java.util.List<KeyResolverSpi> resolverList
-
defaultResolversAdded
private static final java.util.concurrent.atomic.AtomicBoolean defaultResolversAdded
-
-
Method Detail
-
length
public static int length()
Method length- Returns:
- the length of resolvers registered
-
getX509Certificate
public static final java.security.cert.X509Certificate getX509Certificate(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod getX509Certificate- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- The certificate represented by the element.
- Throws:
KeyResolverException
-
getPublicKey
public static final java.security.PublicKey getPublicKey(org.w3c.dom.Element element, java.lang.String baseURI, StorageResolver storage, boolean secureValidation) throws KeyResolverExceptionMethod getPublicKey- Parameters:
element-baseURI-storage-secureValidation-- Returns:
- the public key contained in the element
- Throws:
KeyResolverException
-
register
public static void register(java.lang.String className) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationExceptionThis method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects. This means that personalizedKeyResolverSpis should only be registered directly to theKeyInfousingKeyInfo.registerInternalKeyResolver(org.apache.xml.security.keys.keyresolver.KeyResolverSpi). Please note that this method will create a new copy of the underlying array, as the underlying collection is a CopyOnWriteArrayList.- Parameters:
className-- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.ClassNotFoundExceptionjava.lang.SecurityException- if a security manager is installed and the caller does not have permission to register the key resolver
-
registerAtStart
public static void registerAtStart(java.lang.String className)
This method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects. This means that personalizedKeyResolverSpis should only be registered directly to theKeyInfousingKeyInfo.registerInternalKeyResolver(org.apache.xml.security.keys.keyresolver.KeyResolverSpi). Please note that this method will create a new copy of the underlying array, as the underlying collection is a CopyOnWriteArrayList.- Parameters:
className-- Throws:
java.lang.SecurityException- if a security manager is installed and the caller does not have permission to register the key resolver
-
register
public static void register(KeyResolverSpi keyResolverSpi, boolean start)
This method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects. This means that personalizedKeyResolverSpis should only be registered directly to theKeyInfousingKeyInfo.registerInternalKeyResolver(org.apache.xml.security.keys.keyresolver.KeyResolverSpi). Please note that this method will create a new copy of the underlying array, as the underlying collection is a CopyOnWriteArrayList.- Parameters:
keyResolverSpi- a KeyResolverSpi instance to registerstart- whether to register the KeyResolverSpi at the start of the list or not- Throws:
java.lang.SecurityException- if a security manager is installed and the caller does not have permission to register the key resolver
-
registerClassNames
public static void registerClassNames(java.util.List<java.lang.String> classNames) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationExceptionThis method is used for registeringKeyResolverSpis which are available to allKeyInfoobjects. This means that personalizedKeyResolverSpis should only be registered directly to theKeyInfousingKeyInfo.registerInternalKeyResolver(org.apache.xml.security.keys.keyresolver.KeyResolverSpi). The KeyResolverSpi instances are not registered as a global resolver.- Parameters:
classNames-- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.ClassNotFoundExceptionjava.lang.SecurityException- if a security manager is installed and the caller does not have permission to register the key resolver
-
registerDefaultResolvers
public static void registerDefaultResolvers()
This method registers the default resolvers.
-
iterator
public static java.util.Iterator<KeyResolverSpi> iterator()
-
-