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.- Version:
- %I%, %G%
- Author:
- $Author$
-
-
Field Summary
Fields Modifier and Type Field Description protected KeyResolverSpi_resolverSpiField _resolverSpiprotected StorageResolver_storageField _storage
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanResolve(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)Method canResolvestatic KeyResolvergetInstance(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)Method getInstancejava.lang.StringgetProperty(java.lang.String key)Method getPropertyjava.lang.String[]getPropertyKeys()Method getPropertyKeysstatic voidinit()The init() function is called by org.apache.xml.security.Init.init()static KeyResolveritem(int i)Method itemstatic intlength()Method lengthstatic voidregister(java.lang.String className)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.java.security.PublicKeyresolvePublicKey(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)Method resolvejava.lang.StringresolverClassName()Method resolverClassNamejavax.crypto.SecretKeyresolveSecretKey(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)static java.security.PublicKeyresolveStatic(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)Method resolveStaticjava.security.cert.X509CertificateresolveX509Certificate(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)Method resolveX509CertificatevoidsetProperty(java.lang.String key, java.lang.String value)Method setPropertybooleanunderstandsProperty(java.lang.String propertyToTest)Method understandsProperty
-
-
-
Field Detail
-
_resolverSpi
protected KeyResolverSpi _resolverSpi
Field _resolverSpi
-
_storage
protected StorageResolver _storage
Field _storage
-
-
Method Detail
-
length
public static int length()
Method length- Returns:
- the length of resolvers registed
-
item
public static KeyResolver item(int i) throws KeyResolverException
Method item- Parameters:
i-- Returns:
- the number i resolver registerd
- Throws:
KeyResolverException
-
getInstance
public static final KeyResolver getInstance(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage) throws KeyResolverException
Method getInstance- Parameters:
element-BaseURI-storage-- Returns:
- the instance that happends to implement the thing.
- Throws:
KeyResolverException
-
init
public static void init()
The init() function is called by org.apache.xml.security.Init.init()
-
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).- Parameters:
className-- Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.ClassNotFoundException
-
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).- Parameters:
className-
-
resolveStatic
public static java.security.PublicKey resolveStatic(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage) throws KeyResolverExceptionMethod resolveStatic- Parameters:
element-BaseURI-storage-- Returns:
- resolve from the static register an element
- Throws:
KeyResolverException
-
resolvePublicKey
public java.security.PublicKey resolvePublicKey(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage) throws KeyResolverExceptionMethod resolve- Parameters:
element-BaseURI-storage-- Returns:
- resolved public key from the registered from the elements
- Throws:
KeyResolverException
-
resolveX509Certificate
public java.security.cert.X509Certificate resolveX509Certificate(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage) throws KeyResolverExceptionMethod resolveX509Certificate- Parameters:
element-BaseURI-storage-- Returns:
- resolved X509certificate key from the registered from the elements
- Throws:
KeyResolverException
-
resolveSecretKey
public javax.crypto.SecretKey resolveSecretKey(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage) throws KeyResolverException- Parameters:
element-BaseURI-storage-- Returns:
- resolved SecretKey key from the registered from the elements
- Throws:
KeyResolverException
-
setProperty
public void setProperty(java.lang.String key, java.lang.String value)Method setProperty- Parameters:
key-value-
-
getProperty
public java.lang.String getProperty(java.lang.String key)
Method getProperty- Parameters:
key-- Returns:
- the property setted for this resolver
-
getPropertyKeys
public java.lang.String[] getPropertyKeys()
Method getPropertyKeys- Returns:
- the properties key registerd in this resolver
-
understandsProperty
public boolean understandsProperty(java.lang.String propertyToTest)
Method understandsProperty- Parameters:
propertyToTest-- Returns:
- true if the resolver understands property propertyToTest
-
canResolve
public boolean canResolve(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)Method canResolve- Parameters:
element-BaseURI-storage-- Returns:
- true if can resolve the key in the element
-
resolverClassName
public java.lang.String resolverClassName()
Method resolverClassName- Returns:
- the name of the resolver.
-
-