org.jcp.xml.dsig.internal.dom

Class DOMReference

  • All Implemented Interfaces:
    javax.xml.crypto.dom.DOMURIReference, javax.xml.crypto.dsig.Reference, javax.xml.crypto.URIReference, javax.xml.crypto.XMLStructure


    public final class DOMReference
    extends DOMStructure
    implements javax.xml.crypto.dsig.Reference, javax.xml.crypto.dom.DOMURIReference
    DOM-based implementation of Reference.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int MAXIMUM_TRANSFORM_COUNT
      The maximum number of transforms per reference, if secure validation is enabled.
    • Constructor Summary

      Constructors 
      Constructor and Description
      DOMReference(org.w3c.dom.Element refElem, javax.xml.crypto.XMLCryptoContext context, java.security.Provider provider)
      Creates a DOMReference from an element.
      DOMReference(java.lang.String uri, java.lang.String type, javax.xml.crypto.dsig.DigestMethod dm, java.util.List<? extends javax.xml.crypto.dsig.Transform> appliedTransforms, javax.xml.crypto.Data result, java.util.List<? extends javax.xml.crypto.dsig.Transform> transforms, java.lang.String id, byte[] digestValue, java.security.Provider provider) 
      DOMReference(java.lang.String uri, java.lang.String type, javax.xml.crypto.dsig.DigestMethod dm, java.util.List<? extends javax.xml.crypto.dsig.Transform> appliedTransforms, javax.xml.crypto.Data result, java.util.List<? extends javax.xml.crypto.dsig.Transform> transforms, java.lang.String id, java.security.Provider provider) 
      DOMReference(java.lang.String uri, java.lang.String type, javax.xml.crypto.dsig.DigestMethod dm, java.util.List<? extends javax.xml.crypto.dsig.Transform> transforms, java.lang.String id, java.security.Provider provider)
      Creates a Reference from the specified parameters.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      void digest(javax.xml.crypto.dsig.XMLSignContext signContext) 
      boolean equals(java.lang.Object o) 
      byte[] getCalculatedDigestValue() 
      javax.xml.crypto.Data getDereferencedData() 
      java.io.InputStream getDigestInputStream() 
      javax.xml.crypto.dsig.DigestMethod getDigestMethod() 
      byte[] getDigestValue() 
      org.w3c.dom.Node getHere() 
      java.lang.String getId() 
      java.util.List getTransforms() 
      java.lang.String getType() 
      java.lang.String getURI() 
      int hashCode() 
      void marshal(org.w3c.dom.Node parent, java.lang.String dsPrefix, javax.xml.crypto.dom.DOMCryptoContext context) 
      boolean validate(javax.xml.crypto.dsig.XMLValidateContext validateContext) 
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.xml.crypto.XMLStructure

        isFeatureSupported
    • Field Detail

      • MAXIMUM_TRANSFORM_COUNT

        public static final int MAXIMUM_TRANSFORM_COUNT
        The maximum number of transforms per reference, if secure validation is enabled.
        See Also:
        Constant Field Values
    • Constructor Detail

      • DOMReference

        public DOMReference(java.lang.String uri,
                    java.lang.String type,
                    javax.xml.crypto.dsig.DigestMethod dm,
                    java.util.List<? extends javax.xml.crypto.dsig.Transform> transforms,
                    java.lang.String id,
                    java.security.Provider provider)
        Creates a Reference from the specified parameters.
        Parameters:
        uri - the URI (may be null)
        type - the type (may be null)
        dm - the digest method
        transforms - a list of Transforms. The list is defensively copied to protect against subsequent modification. May be null or empty.
        id - the reference ID (may be null)
        Throws:
        java.lang.NullPointerException - if dm is null
        java.lang.ClassCastException - if any of the transforms are not of type Transform
      • DOMReference

        public DOMReference(java.lang.String uri,
                    java.lang.String type,
                    javax.xml.crypto.dsig.DigestMethod dm,
                    java.util.List<? extends javax.xml.crypto.dsig.Transform> appliedTransforms,
                    javax.xml.crypto.Data result,
                    java.util.List<? extends javax.xml.crypto.dsig.Transform> transforms,
                    java.lang.String id,
                    java.security.Provider provider)
      • DOMReference

        public DOMReference(java.lang.String uri,
                    java.lang.String type,
                    javax.xml.crypto.dsig.DigestMethod dm,
                    java.util.List<? extends javax.xml.crypto.dsig.Transform> appliedTransforms,
                    javax.xml.crypto.Data result,
                    java.util.List<? extends javax.xml.crypto.dsig.Transform> transforms,
                    java.lang.String id,
                    byte[] digestValue,
                    java.security.Provider provider)
      • DOMReference

        public DOMReference(org.w3c.dom.Element refElem,
                    javax.xml.crypto.XMLCryptoContext context,
                    java.security.Provider provider)
                     throws javax.xml.crypto.MarshalException
        Creates a DOMReference from an element.
        Parameters:
        refElem - a Reference element
        Throws:
        javax.xml.crypto.MarshalException
    • Method Detail

      • getDigestMethod

        public javax.xml.crypto.dsig.DigestMethod getDigestMethod()
        Specified by:
        getDigestMethod in interface javax.xml.crypto.dsig.Reference
      • getId

        public java.lang.String getId()
        Specified by:
        getId in interface javax.xml.crypto.dsig.Reference
      • getURI

        public java.lang.String getURI()
        Specified by:
        getURI in interface javax.xml.crypto.URIReference
      • getType

        public java.lang.String getType()
        Specified by:
        getType in interface javax.xml.crypto.URIReference
      • getTransforms

        public java.util.List getTransforms()
        Specified by:
        getTransforms in interface javax.xml.crypto.dsig.Reference
      • getDigestValue

        public byte[] getDigestValue()
        Specified by:
        getDigestValue in interface javax.xml.crypto.dsig.Reference
      • getCalculatedDigestValue

        public byte[] getCalculatedDigestValue()
        Specified by:
        getCalculatedDigestValue in interface javax.xml.crypto.dsig.Reference
      • marshal

        public void marshal(org.w3c.dom.Node parent,
                   java.lang.String dsPrefix,
                   javax.xml.crypto.dom.DOMCryptoContext context)
                     throws javax.xml.crypto.MarshalException
        Specified by:
        marshal in class DOMStructure
        Throws:
        javax.xml.crypto.MarshalException
      • digest

        public void digest(javax.xml.crypto.dsig.XMLSignContext signContext)
                    throws javax.xml.crypto.dsig.XMLSignatureException
        Throws:
        javax.xml.crypto.dsig.XMLSignatureException
      • validate

        public boolean validate(javax.xml.crypto.dsig.XMLValidateContext validateContext)
                         throws javax.xml.crypto.dsig.XMLSignatureException
        Specified by:
        validate in interface javax.xml.crypto.dsig.Reference
        Throws:
        javax.xml.crypto.dsig.XMLSignatureException
      • getDereferencedData

        public javax.xml.crypto.Data getDereferencedData()
        Specified by:
        getDereferencedData in interface javax.xml.crypto.dsig.Reference
      • getDigestInputStream

        public java.io.InputStream getDigestInputStream()
        Specified by:
        getDigestInputStream in interface javax.xml.crypto.dsig.Reference
      • getHere

        public org.w3c.dom.Node getHere()
        Specified by:
        getHere in interface javax.xml.crypto.dom.DOMURIReference
      • equals

        public boolean equals(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object

© Portions Copyright 2003, 2014 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.