| 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 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.
| Protected Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Default constructor, for invocation by subclasses. | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Returns a  KeyInfoFactorythat supports the
 requested XML processing mechanism and representation type (ex: "DOM"),
 as supplied by the specified provider. | |||||||||||
| Returns a  KeyInfoFactorythat supports the
 default XML processing mechanism and representation type ("DOM"). | |||||||||||
| Returns a  KeyInfoFactorythat supports the
 requested XML processing mechanism and representation type (ex: "DOM"),
 as supplied by the specified provider. | |||||||||||
| Returns a  KeyInfoFactorythat supports the
 specified XML processing mechanism and representation type (ex: "DOM"). | |||||||||||
| Returns the type of the XML processing mechanism and representation
 supported by this  KeyInfoFactory(ex: "DOM") | |||||||||||
| Returns the provider of this  KeyInfoFactory. | |||||||||||
| Returns a reference to the  URIDereferencerthat is used by
 default to dereference URIs inRetrievalMethodobjects. | |||||||||||
| Indicates whether a specified feature is supported. | |||||||||||
| Creates a  KeyInfocontaining the specified list of key
 information types and optional id. | |||||||||||
| Creates a  KeyInfocontaining the specified list of
 key information types. | |||||||||||
| Creates a  KeyNamefrom the specified name. | |||||||||||
| Creates a  KeyValuefrom the specified public key. | |||||||||||
| Creates a  PGPDatafrom the specified PGP public key
 identifier, and optional key material packet and list of external
 elements. | |||||||||||
| Creates a  PGPDatafrom the specified PGP key material
 packet and optional list of external elements. | |||||||||||
| Creates a  PGPDatafrom the specified PGP public key
 identifier. | |||||||||||
| Creates a  RetrievalMethodfrom the specified parameters. | |||||||||||
| Creates a  RetrievalMethodfrom the specified URI. | |||||||||||
| Creates a  X509Datacontaining the specified list of
 X.509 content. | |||||||||||
| Creates an  X509IssuerSerialfrom the specified X.500 issuer
 distinguished name and serial number. | |||||||||||
| Unmarshals a new  KeyInfoinstance from a
 mechanism-specificXMLStructure(ex:DOMStructure)
 instance. | |||||||||||
| [Expand] Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
|  From class
  java.lang.Object | |||||||||||
Default constructor, for invocation by subclasses.
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.
| 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 string name of the provider | 
KeyInfoFactory| NoSuchProviderException | if the specified provider is not registered in the security provider list | 
|---|---|
| NullPointerException | if mechanismTypeorproviderarenull | 
| NoSuchMechanismException | if a KeyInfoFactoryimplementation for the specified mechanism is not available from the
    specified provider | 
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.
KeyInfoFactory| NoSuchMechanismException | if no Providersupports aKeyInfoFactoryimplementation for the DOM mechanism | 
|---|
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.
| 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 Providerobject | 
KeyInfoFactory| NullPointerException | if mechanismTypeorproviderarenull | 
|---|---|
| NoSuchMechanismException | if a KeyInfoFactoryimplementation for the specified mechanism is not available from the
    specifiedProviderobject | 
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.
| 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| NullPointerException | if mechanismTypeisnull | 
|---|---|
| NoSuchMechanismException | if no Providersupports aKeyInfoFactoryimplementation for the specified mechanism | 
Returns the type of the XML processing mechanism and representation
 supported by this KeyInfoFactory (ex: "DOM")
KeyInfoFactory
Returns the provider of this KeyInfoFactory.
KeyInfoFactory
Returns a reference to the URIDereferencer that is used by
 default to dereference URIs in RetrievalMethod objects.
URIDereferencer
Indicates whether a specified feature is supported.
| feature | the feature name (as an absolute URI) | 
|---|
true if the specified feature is supported,
    false otherwise| NullPointerException | if featureisnull | 
|---|
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.
| 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 benull) | 
KeyInfo| NullPointerException | if contentisnull | 
|---|---|
| IllegalArgumentException | if contentis empty | 
| ClassCastException | if contentcontains any entries
    that are not of typeXMLStructure | 
Creates a 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| NullPointerException | if contentisnull | 
|---|---|
| IllegalArgumentException | if contentis empty | 
| ClassCastException | if contentcontains any entries
    that are not of typeXMLStructure | 
Creates a KeyName from the specified name.
| name | the name that identifies the key | 
|---|
KeyName| NullPointerException | if nameisnull | 
|---|
Creates a KeyValue from the specified public key.
| key | the public key | 
|---|
KeyValue| KeyException | if the key's algorithm is not
    recognized or supported by thisKeyInfoFactory | 
|---|---|
| NullPointerException | if keyisnull | 
Creates a 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 benullor empty. | 
PGPData| NullPointerException | if keyIdisnull | 
|---|---|
| IllegalArgumentException | if the keyIdorkeyPacketis not in the correct format. ForkeyPacket, the format of the packet header is
    checked and the tag is verified that it is of type key material. The
    contents and format of the packet body are not checked. | 
| ClassCastException | if othercontains any
    entries that are not of typeXMLStructure | 
Creates a 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 benullor empty. | 
PGPData| NullPointerException | if keyPacketisnull | 
|---|---|
| IllegalArgumentException | if keyPacketis not in the
    correct format. ForkeyPacket, the format of the packet
    header is checked and the tag is verified that it is of type key
    material. The contents and format of the packet body are not checked. | 
| ClassCastException | if othercontains any
    entries that are not of typeXMLStructure | 
Creates a 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| NullPointerException | if keyIdisnull | 
|---|---|
| IllegalArgumentException | if the key id is not in the correct format | 
Creates a RetrievalMethod from the specified parameters.
| uri | the URI that identifies the KeyInfoinformation
    to be retrieved | 
|---|---|
| type | a URI that identifies the type of KeyInfoinformation to be retrieved (may benull) | 
| transforms | a list of Transforms. The list is defensively
    copied to protect against subsequent modification. May benullor empty. | 
RetrievalMethod| NullPointerException | if uriisnull | 
|---|---|
| IllegalArgumentException | if uriis not RFC 2396
    compliant | 
| ClassCastException | if transformscontains any
    entries that are not of typeTransform | 
Creates a RetrievalMethod from the specified URI.
| uri | the URI that identifies the KeyInfoinformation
    to be retrieved | 
|---|
RetrievalMethod| NullPointerException | if uriisnull | 
|---|---|
| IllegalArgumentException | if uriis not RFC 2396
    compliant | 
Creates a 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,
    orXMLStructure(X509IssuerSerialobjects 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. | 
|---|
X509Data| NullPointerException | if contentisnull | 
|---|---|
| IllegalArgumentException | if contentis empty, or
    if a subject name is not RFC 2253 compliant or one of the attribute
    type keywords is not recognized. | 
| ClassCastException | if contentcontains any entries
    that are not of one of the valid types mentioned above | 
Creates an X509IssuerSerial from the specified X.500 issuer
 distinguished name and serial number.
| issuerName | the 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. | 
|---|---|
| serialNumber | the serial number | 
X509IssuerSerial| NullPointerException | if issuerNameorserialNumberarenull | 
|---|---|
| IllegalArgumentException | if the issuer name is not RFC 2253 compliant or one of the attribute type keywords is not recognized. | 
Unmarshals a new KeyInfo instance from a
 mechanism-specific XMLStructure (ex: DOMStructure)
 instance.
| xmlStructure | a mechanism-specific XML structure from which to unmarshal the keyinfo from | 
|---|
KeyInfo| NullPointerException | if xmlStructureisnull | 
|---|---|
| ClassCastException | if the type of xmlStructureis
   inappropriate for this factory | 
| MarshalException | if an unrecoverable exception occurs during unmarshalling |