Home » openjdk-7 » javax » xml » crypto » dsig » keyinfo » [javadoc | source]
javax.xml.crypto.dsig.keyinfo
abstract public class: KeyInfoFactory [javadoc | source]
java.lang.Object
   javax.xml.crypto.dsig.keyinfo.KeyInfoFactory
A factory for creating KeyInfo objects from scratch or for unmarshalling a KeyInfo object from a corresponding XML representation.

Each instance of KeyInfoFactory supports a specific XML mechanism type. To create a KeyInfoFactory, call one of the static getInstance methods, passing in the XML mechanism type desired, for example:

KeyInfoFactory factory = KeyInfoFactory.getInstance("DOM");

The objects that this factory produces will be based on DOM and abide by the DOM interoperability requirements as defined in the DOM Mechanism Requirements section of the API overview. See the Service Providers section of the API overview for a list of standard mechanism types.

KeyInfoFactory implementations are registered and loaded using the java.security.Provider mechanism. For example, a service provider that supports the DOM mechanism would be specified in the Provider subclass as:

    put("KeyInfoFactory.DOM", "org.example.DOMKeyInfoFactory");

Also, the XMLStructures that are created by this factory may contain state specific to the KeyInfo and are not intended to be reusable.

An implementation MUST minimally support the default mechanism type: DOM.

Note that a caller must use the same KeyInfoFactory instance to create the XMLStructures of a particular KeyInfo object. The behavior is undefined if XMLStructures from different providers or different mechanism types are used together.

Concurrent Access

The static methods of this class are guaranteed to be thread-safe. Multiple threads may concurrently invoke the static methods defined in this class with no ill effects.

However, this is not true for the non-static methods defined by this class. Unless otherwise documented by a specific provider, threads that need to access a single KeyInfoFactory instance concurrently should synchronize amongst themselves and provide the necessary locking. Multiple threads each manipulating a different KeyInfoFactory instance need not synchronize.

Constructor:
 protected KeyInfoFactory() 
Method from javax.xml.crypto.dsig.keyinfo.KeyInfoFactory Summary:
getInstance,   getInstance,   getInstance,   getInstance,   getMechanismType,   getProvider,   getURIDereferencer,   isFeatureSupported,   newKeyInfo,   newKeyInfo,   newKeyName,   newKeyValue,   newPGPData,   newPGPData,   newPGPData,   newRetrievalMethod,   newRetrievalMethod,   newX509Data,   newX509IssuerSerial,   unmarshalKeyInfo
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.xml.crypto.dsig.keyinfo.KeyInfoFactory Detail:
 public static KeyInfoFactory getInstance() 
    Returns a KeyInfoFactory that supports the default XML processing mechanism and representation type ("DOM").

    This method uses the standard JCA provider lookup mechanism to locate and instantiate a KeyInfoFactory implementation of the default mechanism type. It traverses the list of registered security Providers, starting with the most preferred Provider. A new KeyInfoFactory object from the first Provider that supports the DOM mechanism is returned.

    Note that the list of registered providers may be retrieved via the Security.getProviders() method.

 public static KeyInfoFactory getInstance(String mechanismType) 
    Returns a KeyInfoFactory that supports the specified XML processing mechanism and representation type (ex: "DOM").

    This method uses the standard JCA provider lookup mechanism to locate and instantiate a KeyInfoFactory implementation of the desired mechanism type. It traverses the list of registered security Providers, starting with the most preferred Provider. A new KeyInfoFactory object from the first Provider that supports the specified mechanism is returned.

    Note that the list of registered providers may be retrieved via the Security.getProviders() method.

 public static KeyInfoFactory getInstance(String mechanismType,
    Provider provider) 
    Returns a KeyInfoFactory that supports the requested XML processing mechanism and representation type (ex: "DOM"), as supplied by the specified provider. Note that the specified Provider object does not have to be registered in the provider list.
 public static KeyInfoFactory getInstance(String mechanismType,
    String provider) throws NoSuchProviderException 
    Returns a KeyInfoFactory that supports the requested XML processing mechanism and representation type (ex: "DOM"), as supplied by the specified provider. The specified provider must be registered in the security provider list.

    Note that the list of registered providers may be retrieved via the Security.getProviders() method.

 public final String getMechanismType() 
    Returns the type of the XML processing mechanism and representation supported by this KeyInfoFactory (ex: "DOM")
 public final Provider getProvider() 
    Returns the provider of this KeyInfoFactory.
 abstract public URIDereferencer getURIDereferencer()
    Returns a reference to the URIDereferencer that is used by default to dereference URIs in RetrievalMethod objects.
 abstract public boolean isFeatureSupported(String feature)
    Indicates whether a specified feature is supported.
 abstract public KeyInfo newKeyInfo(List content)
    Creates a KeyInfo containing the specified list of key information types.
 abstract public KeyInfo newKeyInfo(List content,
    String id)
    Creates a KeyInfo containing the specified list of key information types and optional id. The id parameter represents the value of an XML ID attribute and is useful for referencing the KeyInfo from other XML structures.
 abstract public KeyName newKeyName(String name)
    Creates a KeyName from the specified name.
 abstract public KeyValue newKeyValue(PublicKey key) throws KeyException
    Creates a KeyValue from the specified public key.
 abstract public PGPData newPGPData(byte[] keyId)
    Creates a PGPData from the specified PGP public key identifier.
 abstract public PGPData newPGPData(byte[] keyPacket,
    List other)
    Creates a PGPData from the specified PGP key material packet and optional list of external elements.
 abstract public PGPData newPGPData(byte[] keyId,
    byte[] keyPacket,
    List other)
    Creates a PGPData from the specified PGP public key identifier, and optional key material packet and list of external elements.
 abstract public RetrievalMethod newRetrievalMethod(String uri)
    Creates a RetrievalMethod from the specified URI.
 abstract public RetrievalMethod newRetrievalMethod(String uri,
    String type,
    List transforms)
    Creates a RetrievalMethod from the specified parameters.
 abstract public X509Data newX509Data(List content)
    Creates a X509Data containing the specified list of X.509 content.
 abstract public X509IssuerSerial newX509IssuerSerial(String issuerName,
    BigInteger serialNumber)
    Creates an X509IssuerSerial from the specified X.500 issuer distinguished name and serial number.
 abstract public KeyInfo unmarshalKeyInfo(XMLStructure xmlStructure) throws MarshalException
    Unmarshals a new KeyInfo instance from a mechanism-specific XMLStructure (ex: DOMStructure ) instance.