|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.xml.crypto.dsig.keyinfo.KeyInfoFactory
A factory for creating KeyInfo objects from scratch.
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.
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 Summary | |
protected |
KeyInfoFactory()
Default constructor, for invocation by subclasses. |
| Method Summary | |
static KeyInfoFactory |
getInstance()
Returns a KeyInfoFactory that supports the
default XML processing mechanism and representation type ("DOM"). |
static KeyInfoFactory |
getInstance(java.lang.String mechanismType)
Returns a KeyInfoFactory that supports the
specified XML processing mechanism and representation type (ex: "DOM"). |
static KeyInfoFactory |
getInstance(java.lang.String mechanismType,
java.security.Provider provider)
Returns a KeyInfoFactory that supports the
requested XML processing mechanism and representation type (ex: "DOM"),
as supplied by the specified provider. |
static KeyInfoFactory |
getInstance(java.lang.String mechanismType,
java.lang.String provider)
Returns a KeyInfoFactory that supports the
requested XML processing mechanism and representation type (ex: "DOM"),
as supplied by the specified provider. |
java.lang.String |
getMechanismType()
Returns the type of the XML processing mechanism and representation supported by this KeyInfoFactory (ex: "DOM") |
java.security.Provider |
getProvider()
Returns the provider of this KeyInfoFactory. |
abstract URIDereferencer |
getURIDereferencer()
Returns a reference to the URIDereferencer that is used by
default to dereference URIs in RetrievalMethod objects. |
abstract boolean |
isFeatureSupported(java.lang.String feature)
Indicates whether a specified feature is supported. |
abstract KeyInfo |
newKeyInfo(java.util.List content)
Creates a KeyInfo containing the specified list of
key information types. |
abstract KeyInfo |
newKeyInfo(java.util.List content,
java.lang.String id)
Creates a KeyInfo containing the specified list of key
information types and optional id. |
abstract KeyName |
newKeyName(java.lang.String name)
Creates a KeyName from the specified name. |
abstract KeyValue |
newKeyValue(java.security.PublicKey key)
Creates a KeyValue from the specified public key. |
abstract PGPData |
newPGPData(byte[] keyId)
Creates a PGPData from the specified PGP public key
identifier. |
abstract PGPData |
newPGPData(byte[] keyId,
byte[] keyPacket,
java.util.List other)
Creates a PGPData from the specified PGP public key
identifier, and optional key material packet and list of external
elements. |
abstract PGPData |
newPGPData(byte[] keyPacket,
java.util.List other)
Creates a PGPData from the specified PGP key material
packet and optional list of external elements. |
abstract RetrievalMethod |
newRetrievalMethod(java.lang.String uri)
Creates a RetrievalMethod from the specified URI. |
abstract RetrievalMethod |
newRetrievalMethod(java.lang.String uri,
java.lang.String type,
java.util.List transforms)
Creates a RetrievalMethod from the specified parameters. |
abstract X509Data |
newX509Data(java.util.List content)
Creates a X509Data containing the specified list of
X.509 content. |
abstract X509IssuerSerial |
newX509IssuerSerial(java.lang.String issuerName,
java.math.BigInteger serialNumber)
Creates an X509IssuerSerial from the specified X.500 issuer
distinguished name and serial number. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected KeyInfoFactory()
| Method Detail |
public static KeyInfoFactory getInstance(java.lang.String mechanismType)
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.
mechanismType - the type of the XML processing mechanism and
representation. See the Service
Providers section of the API overview for a list of standard
mechanism types.
KeyInfoFactory
java.lang.NullPointerException - if mechanismType is
null
NoSuchMechanismException - if an implementation of the specified
mechanismType cannot be found
public static KeyInfoFactory getInstance(java.lang.String mechanismType,
java.security.Provider provider)
KeyInfoFactory that supports the
requested XML processing mechanism and representation type (ex: "DOM"),
as supplied by the specified provider.
mechanismType - the type of the XML processing mechanism and
representation. See the Service
Providers section of the API overview for a list of standard
mechanism types.provider - the provider
KeyInfoFactory
java.lang.NullPointerException - if mechanismType or
provider are null
NoSuchMechanismException - if an implementation of the requested
mechanismType is not available from the specified
provider
public static KeyInfoFactory getInstance(java.lang.String mechanismType,
java.lang.String provider)
throws java.security.NoSuchProviderException
KeyInfoFactory that supports the
requested XML processing mechanism and representation type (ex: "DOM"),
as supplied by the specified provider.
mechanismType - the type of the XML processing mechanism and
representation. See the Service
Providers section of the API overview for a list of standard
mechanism types.provider - the name of the provider
KeyInfoFactory
java.security.NoSuchProviderException - if provider has not been
configured
java.lang.NullPointerException - if mechanismType or
provider are null
NoSuchMechanismException - if an implementation of the requested
mechanismType is not available from the specified
providerpublic static KeyInfoFactory getInstance()
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.
KeyInfoFactory
NoSuchMechanismException - if an implementation of the default
mechanism type cannot be foundpublic final java.lang.String getMechanismType()
KeyInfoFactory (ex: "DOM")
KeyInfoFactorypublic final java.security.Provider getProvider()
KeyInfoFactory.
KeyInfoFactorypublic abstract KeyInfo newKeyInfo(java.util.List content)
KeyInfo containing the specified list of
key information types.
content - a list of one or more XMLStructures representing
key information types. The list is defensively copied to protect
against subsequent modification.
KeyInfo
java.lang.NullPointerException - if content is null
java.lang.IllegalArgumentException - if content is empty
java.lang.ClassCastException - if content contains any entries
that are not of type XMLStructure
public abstract KeyInfo newKeyInfo(java.util.List content,
java.lang.String id)
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.
content - a list of one or more XMLStructures representing
key information types. The list is defensively copied to protect
against subsequent modification.id - the value of an XML ID (may be null)
KeyInfo
java.lang.NullPointerException - if content is null
java.lang.IllegalArgumentException - if content is empty
java.lang.ClassCastException - if content contains any entries
that are not of type XMLStructurepublic abstract KeyName newKeyName(java.lang.String name)
KeyName from the specified name.
name - the name that identifies the key
KeyName
java.lang.NullPointerException - if name is null
public abstract KeyValue newKeyValue(java.security.PublicKey key)
throws java.security.KeyException
KeyValue from the specified public key.
key - the public key
KeyValue
java.security.KeyException - if the key's algorithm is not
recognized or supported by this KeyInfoFactory
java.lang.NullPointerException - if key is nullpublic abstract PGPData newPGPData(byte[] keyId)
PGPData from the specified PGP public key
identifier.
keyId - a PGP public key identifier as defined in RFC 2440, section 11.2.
The array is cloned to protect against subsequent modification.
PGPData
java.lang.NullPointerException - if keyId is null
java.lang.IllegalArgumentException - if the key id is not in the correct
format
public abstract PGPData newPGPData(byte[] keyId,
byte[] keyPacket,
java.util.List other)
PGPData from the specified PGP public key
identifier, and optional key material packet and list of external
elements.
keyId - a PGP public key identifier as defined in RFC 2440, section 11.2.
The array is cloned to protect against subsequent modification.keyPacket - a PGP key material packet as defined in RFC 2440, section 5.5.
The array is cloned to protect against subsequent modification. May
be null.other - a list of XMLStructures representing elements from
an external namespace. The list is defensively copied to protect
against subsequent modification. May be null or empty.
PGPData
java.lang.NullPointerException - if keyId is null
java.lang.IllegalArgumentException - if the key id or key packet is not in
the correct format
java.lang.ClassCastException - if other contains any
entries that are not of type XMLStructure
public abstract PGPData newPGPData(byte[] keyPacket,
java.util.List other)
PGPData from the specified PGP key material
packet and optional list of external elements.
keyPacket - a PGP key material packet as defined in RFC 2440, section 5.5.
The array is cloned to protect against subsequent modification.other - a list of XMLStructures representing elements from
an external namespace. The list is defensively copied to protect
against subsequent modification. May be null or empty.
PGPData
java.lang.NullPointerException - if keyPacket is
null
java.lang.IllegalArgumentException - if the key packet is not in the correct
format
java.lang.ClassCastException - if other contains any
entries that are not of type XMLStructurepublic abstract RetrievalMethod newRetrievalMethod(java.lang.String uri)
RetrievalMethod from the specified URI.
uri - the URI that identifies the KeyInfo information
to be retrieved
RetrievalMethod
java.lang.NullPointerException - if uri is null
java.lang.IllegalArgumentException - if uri is not RFC 2396
compliant
public abstract RetrievalMethod newRetrievalMethod(java.lang.String uri,
java.lang.String type,
java.util.List transforms)
RetrievalMethod from the specified parameters.
uri - the URI that identifies the KeyInfo information
to be retrievedtype - a URI that identifies the type of KeyInfo
information to be retrieved (may be null)transforms - a list of Transforms. The list is defensively
copied to protect against subsequent modification. May be
null or empty.
RetrievalMethod
java.lang.NullPointerException - if uri is null
java.lang.IllegalArgumentException - if uri is not RFC 2396
compliant
java.lang.ClassCastException - if transforms contains any
entries that are not of type Transformpublic abstract X509Data newX509Data(java.util.List content)
X509Data containing the specified list of
X.509 content.
content - a list of one or more X.509 content types. Valid types are
String (subject names), byte[] (subject key ids),
X509Certificate, X509CRL,
or XMLStructure (X509IssuerSerial
objects or elements from an external namespace). The list is
defensively copied to protect against subsequent modification.
X509Data
java.lang.NullPointerException - if content is null
java.lang.IllegalArgumentException - if content is empty
java.lang.ClassCastException - if content contains any entries
that are not of one of the valid types mentioned above
public abstract X509IssuerSerial newX509IssuerSerial(java.lang.String issuerName,
java.math.BigInteger serialNumber)
X509IssuerSerial from the specified X.500 issuer
distinguished name and serial number.
issuerName - the issuer's distinguished name in RFC 2253 String
formatserialNumber - the serial number
X509IssuerSerial
java.lang.NullPointerException - if issuerName or
serialNumber are null
java.lang.IllegalArgumentException - if the issuer name is not RFC 2253
compliantpublic abstract boolean isFeatureSupported(java.lang.String feature)
feature - the feature name (as an absolute URI)
true if the specified feature is supported,
false otherwise
java.lang.NullPointerException - if feature is nullpublic abstract URIDereferencer getURIDereferencer()
URIDereferencer that is used by
default to dereference URIs in RetrievalMethod objects.
URIDereferencer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||