Class KeyResolver
- java.lang.Object
-
- org.apache.xml.security.keys.keyresolver.KeyResolver
-
public class KeyResolver extends java.lang.Object
KeyResolver 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
_resolverSpi
Field _resolverSpiprotected StorageResolver
_storage
Field _storage
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canResolve(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)
Method canResolvestatic KeyResolver
getInstance(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)
Method getInstancejava.lang.String
getProperty(java.lang.String key)
Method getPropertyjava.lang.String[]
getPropertyKeys()
Method getPropertyKeysstatic void
init()
The init() function is called by org.apache.xml.security.Init.init()static KeyResolver
item(int i)
Method itemstatic int
length()
Method lengthstatic void
register(java.lang.String className)
This method is used for registeringKeyResolverSpi
s which are available to allKeyInfo
objects.static void
registerAtStart(java.lang.String className)
This method is used for registeringKeyResolverSpi
s which are available to allKeyInfo
objects.java.security.PublicKey
resolvePublicKey(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)
Method resolvejava.lang.String
resolverClassName()
Method resolverClassNamejavax.crypto.SecretKey
resolveSecretKey(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)
static java.security.PublicKey
resolveStatic(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)
Method resolveStaticjava.security.cert.X509Certificate
resolveX509Certificate(org.w3c.dom.Element element, java.lang.String BaseURI, StorageResolver storage)
Method resolveX509Certificatevoid
setProperty(java.lang.String key, java.lang.String value)
Method setPropertyboolean
understandsProperty(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.InstantiationException
This method is used for registeringKeyResolverSpi
s which are available to allKeyInfo
objects. This means that personalizedKeyResolverSpi
s should only be registered directly to theKeyInfo
usingKeyInfo.registerInternalKeyResolver(org.apache.xml.security.keys.keyresolver.KeyResolverSpi)
.- Parameters:
className
-- Throws:
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.ClassNotFoundException
-
registerAtStart
public static void registerAtStart(java.lang.String className)
This method is used for registeringKeyResolverSpi
s which are available to allKeyInfo
objects. This means that personalizedKeyResolverSpi
s should only be registered directly to theKeyInfo
usingKeyInfo.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 KeyResolverException
Method 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 KeyResolverException
Method 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 KeyResolverException
Method 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.
-
-