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.
See the KeyInfoFactory section in the
Java Security Standard Algorithm Names Specification for a list of
standard mechanism types.
KeyInfoFactory implementations are registered and loaded
using the java. 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.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public static KeyInfoFactory | Returns: a newKeyInfoFactorythe type of the XML processing mechanism and
representation. See the mechanismType)KeyInfoFactory section in the
Java Security Standard Algorithm Names Specification for a list
of standard mechanism types.Returns a |
| public static KeyInfoFactory | Returns: a newKeyInfoFactorythe type of the XML processing mechanism and
representation. See the mechanismType, Provider KeyInfoFactory section in the
Java Security Standard Algorithm Names Specification for a list
of standard mechanism types.the provider)Provider objectReturns a |
| public static KeyInfoFactory | Returns: a newKeyInfoFactorythe type of the XML processing mechanism and
representation. See the mechanismType, String KeyInfoFactory section in the
Java Security Standard Algorithm Names Specification for a list
of standard mechanism types.the string name of the provider provider)Returns a |
| public static KeyInfoFactory | Returns: a newKeyInfoFactoryReturns a |
| public final String | Returns: the XML processing mechanism type supported by thisKeyInfoFactoryReturns the type of the XML processing mechanism and representation
supported by this |
| public final Provider | Returns: the provider of thisKeyInfoFactoryReturns the provider of this |
| public abstract URIDereferencer | Returns: a reference to the defaultURIDereferencerReturns a reference to the |
| public abstract boolean | Returns: true if the specified feature is supported,
false otherwisethe feature name (as an absolute URI) feature)Indicates whether a specified feature is supported. |
| public abstract KeyInfo | Returns: aKeyInfoa list of one or more content)XMLStructures representing
key information types. The list is defensively copied to protect
against subsequent modification.Creates a |
| public abstract KeyInfo | Returns: aKeyInfoa list of one or more content, String XMLStructures representing
key information types. The list is defensively copied to protect
against subsequent modification.the value of an XML id)ID (may be null)Creates a |
| public abstract KeyName | Returns: aKeyNamethe name that identifies the key name)Creates a |
| public abstract KeyValue | Returns: aKeyValuethe public key key)Creates a |
| public abstract PGPData | Returns: aPGPDataa PGP public key identifier as defined in RFC 2440, section 11.2.
The array is cloned to protect against subsequent modification. keyId)Creates a |
| public abstract PGPData | Returns: aPGPDataa PGP public key identifier as defined in RFC 2440, section 11.2.
The array is cloned to protect against subsequent modification. keyId, byte[] a PGP key material packet as defined in RFC 2440, section 5.5.
The array is cloned to protect against subsequent modification. May
be keyPacket, List<? extends XMLStructure> null.a list of other)XMLStructures representing elements from
an external namespace. The list is defensively copied to protect
against subsequent modification. May be null or empty.Creates a |
| public abstract PGPData | Returns: aPGPDataa PGP key material packet as defined in RFC 2440, section 5.5.
The array is cloned to protect against subsequent modification. keyPacket, List<? extends XMLStructure> a list of other)XMLStructures representing elements from
an external namespace. The list is defensively copied to protect
against subsequent modification. May be null or empty.Creates a |
| public abstract RetrievalMethod | Returns: aRetrievalMethodthe URI that identifies the uri)KeyInfo information
to be retrievedCreates a |
| public abstract RetrievalMethod | Returns: aRetrievalMethodthe URI that identifies the uri, String KeyInfo information
to be retrieveda URI that identifies the type of type, List<? extends Transform> KeyInfo
information to be retrieved (may be null)a list of transforms)Transforms. The list is defensively
copied to protect against subsequent modification. May be
null or empty.Creates a |
| public abstract X509Data | Returns: aX509Dataa list of one or more X.509 content types. Valid types are
content)String (subject names), byte[] (subject key ids),
java., X509CRL,
or XMLStructure (X509IssuerSerial
objects or elements from an external namespace). Subject names are
distinguished names in RFC 2253 String format. Implementations MUST
support the attribute type keywords defined in RFC 2253 (CN, L, ST,
O, OU, C, STREET, DC and UID). Implementations MAY support additional
keywords. The list is defensively copied to protect against
subsequent modification.Creates a |
| public abstract X509IssuerSerial | Returns: anX509IssuerSerialthe issuer's distinguished name in RFC 2253 String
format. Implementations MUST support the attribute type keywords
defined in RFC 2253 (CN, L, ST, O, OU, C, STREET, DC and UID).
Implementations MAY support additional keywords. issuerName, BigInteger the serial number serialNumber)Creates an |
| public abstract KeyInfo | Returns: theKeyInfoa mechanism-specific XML structure from which to
unmarshal the keyinfo from xmlStructure)Unmarshals a new |
| mechanismType | back to summary |
|---|---|
| private String mechanismType | |
| provider | back to summary |
|---|---|
| private Provider provider | |
| KeyInfoFactory | back to summary |
|---|---|
| protected KeyInfoFactory() Default constructor, for invocation by subclasses. | |
| getInstance | back to summary |
|---|---|
| public static KeyInfoFactory getInstance(String mechanismType) Returns a This method uses the standard JCA provider lookup mechanism to
locate and instantiate a Note that the list of registered providers may be retrieved via
the Implementation Note The JDK Reference Implementation additionally uses the
| |
| getInstance | back to summary |
|---|---|
| public static KeyInfoFactory getInstance(String mechanismType, Provider provider) Returns a
| |
| getInstance | back to summary |
|---|---|
| public static KeyInfoFactory getInstance(String mechanismType, String provider) throws NoSuchProviderException Returns a Note that the list of registered providers may be retrieved via
the
| |
| getInstance | back to summary |
|---|---|
| public static KeyInfoFactory getInstance() Returns a This method uses the standard JCA provider lookup mechanism to
locate and instantiate a Note that the list of registered providers may be retrieved via
the Implementation Note The JDK Reference Implementation additionally uses the
| |
| getMechanismType | back to summary |
|---|---|
| public final String getMechanismType() Returns the type of the XML processing mechanism and representation
supported by this
| |
| getProvider | back to summary |
|---|---|
| public final Provider getProvider() Returns the provider of this
| |
| getURIDereferencer | back to summary |
|---|---|
| public abstract URIDereferencer getURIDereferencer() Returns a reference to the
| |
| isFeatureSupported | back to summary |
|---|---|
| public abstract boolean isFeatureSupported(String feature) Indicates whether a specified feature is supported.
| |
| newKeyInfo | back to summary |
|---|---|
| public abstract KeyInfo newKeyInfo(List<? extends XMLStructure> content) Creates a
| |
| newKeyInfo | back to summary |
|---|---|
| public abstract KeyInfo newKeyInfo(List<? extends XMLStructure> content, String id) Creates a
| |
| newKeyName | back to summary |
|---|---|
| public abstract KeyName newKeyName(String name) Creates a
| |
| newKeyValue | back to summary |
|---|---|
| public abstract KeyValue newKeyValue(PublicKey key) throws KeyException Creates a
| |
| newPGPData | back to summary |
|---|---|
| public abstract PGPData newPGPData(byte[] keyId) Creates a
| |
| newPGPData | back to summary |
|---|---|
| public abstract PGPData newPGPData(byte[] keyId, byte[] keyPacket, List<? extends XMLStructure> other) Creates a
| |
| newPGPData | back to summary |
|---|---|
| public abstract PGPData newPGPData(byte[] keyPacket, List<? extends XMLStructure> other) Creates a
| |
| newRetrievalMethod | back to summary |
|---|---|
| public abstract RetrievalMethod newRetrievalMethod(String uri) Creates a
| |
| newRetrievalMethod | back to summary |
|---|---|
| public abstract RetrievalMethod newRetrievalMethod(String uri, String type, List<? extends Transform> transforms) Creates a
| |
| newX509Data | back to summary |
|---|---|
| public abstract X509Data newX509Data(List<?> content) Creates a
| |
| newX509IssuerSerial | back to summary |
|---|---|
| public abstract X509IssuerSerial newX509IssuerSerial(String issuerName, BigInteger serialNumber) Creates an
| |
| unmarshalKeyInfo | back to summary |
|---|---|
| public abstract KeyInfo unmarshalKeyInfo(XMLStructure xmlStructure) throws MarshalException Unmarshals a new
| |