Home » openjdk-7 » javax » xml » crypto » dsig » [javadoc | source]
javax.xml.crypto.dsig
public interface: XMLSignature [javadoc | source]

All Implemented Interfaces:
    XMLStructure

A representation of the XML Signature element as defined in the W3C Recommendation for XML-Signature Syntax and Processing. This class contains methods for signing and validating XML signatures with behavior as defined by the W3C specification. The XML Schema Definition is defined as:

<element name="Signature" type="ds:SignatureType"/>
<complexType name="SignatureType">
   <sequence>
     <element ref="ds:SignedInfo"/>
     <element ref="ds:SignatureValue"/>
     <element ref="ds:KeyInfo" minOccurs="0"/>
     <element ref="ds:Object" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
   <attribute name="Id" type="ID" use="optional"/>
</complexType>

An XMLSignature instance may be created by invoking one of the newXMLSignature methods of the XMLSignatureFactory class.

If the contents of the underlying document containing the XMLSignature are subsequently modified, the behavior is undefined.

Note that this class is named XMLSignature rather than Signature to avoid naming clashes with the existing java.security.Signature class.

Nested Class Summary:
public interface  XMLSignature.SignatureValue  A representation of the XML SignatureValue element as defined in the W3C Recommendation for XML-Signature Syntax and Processing. The XML Schema Definition is defined as:

  <element name="SignatureValue" type="ds:SignatureValueType"/>
    <complexType name="SignatureValueType">
      <simpleContent>
        <extension base="base64Binary">
          <attribute name="Id" type="ID" use="optional"/>
        </extension>
      </simpleContent>
    </complexType>
 
Field Summary
static final  String XMLNS    The XML Namespace URI of the W3C Recommendation for XML-Signature Syntax and Processing. 
Method from javax.xml.crypto.dsig.XMLSignature Summary:
getId,   getKeyInfo,   getKeySelectorResult,   getObjects,   getSignatureValue,   getSignedInfo,   sign,   validate
Method from javax.xml.crypto.dsig.XMLSignature Detail:
 public String getId()
    Returns the optional Id of this XMLSignature.
 public KeyInfo getKeyInfo()
    Returns the key info of this XMLSignature.
 public KeySelectorResult getKeySelectorResult()
    Returns the result of the KeySelector , if specified, after this XMLSignature has been signed or validated.
 public List getObjects()
 public SignatureValue getSignatureValue()
    Returns the signature value of this XMLSignature.
 public SignedInfo getSignedInfo()
    Returns the signed info of this XMLSignature.
 public  void sign(XMLSignContext signContext) throws MarshalException, XMLSignatureException
    Signs this XMLSignature.

    If this method throws an exception, this XMLSignature and the signContext parameter will be left in the state that it was in prior to the invocation.

 public boolean validate(XMLValidateContext validateContext) throws XMLSignatureException
    Validates the signature according to the core validation processing rules. This method validates the signature using the existing state, it does not unmarshal and reinitialize the contents of the XMLSignature using the location information specified in the context.

    This method only validates the signature the first time it is invoked. On subsequent invocations, it returns a cached result.