Class DOMDigestMethod

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.xml.crypto.dsig.spec.DigestMethodParameterSpec params  
      (package private) static java.lang.String SHA224  
      (package private) static java.lang.String SHA3_224  
      (package private) static java.lang.String SHA3_256  
      (package private) static java.lang.String SHA3_384  
      (package private) static java.lang.String SHA3_512  
      (package private) static java.lang.String SHA384  
      (package private) static java.lang.String WHIRLPOOL  
      • Fields inherited from interface javax.xml.crypto.dsig.DigestMethod

        RIPEMD160, SHA1, SHA256, SHA512
    • Constructor Summary

      Constructors 
      Constructor Description
      DOMDigestMethod​(java.security.spec.AlgorithmParameterSpec params)
      Creates a DOMDigestMethod.
      DOMDigestMethod​(org.w3c.dom.Element dmElem)
      Creates a DOMDigestMethod from an element.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) void checkParams​(javax.xml.crypto.dsig.spec.DigestMethodParameterSpec params)
      Checks if the specified parameters are valid for this algorithm.
      boolean equals​(java.lang.Object o)  
      (package private) abstract java.lang.String getMessageDigestAlgorithm()
      Returns the MessageDigest standard algorithm name.
      java.security.spec.AlgorithmParameterSpec getParameterSpec()  
      int hashCode()  
      void marshal​(org.w3c.dom.Node parent, java.lang.String prefix, javax.xml.crypto.dom.DOMCryptoContext context)
      This method invokes the abstract marshalParams method to marshal any algorithm-specific parameters.
      (package private) void marshalParams​(org.w3c.dom.Element parent, java.lang.String prefix)
      Marshals the algorithm-specific parameters to an Element and appends it to the specified parent element.
      (package private) static javax.xml.crypto.dsig.DigestMethod unmarshal​(org.w3c.dom.Element dmElem)  
      (package private) javax.xml.crypto.dsig.spec.DigestMethodParameterSpec unmarshalParams​(org.w3c.dom.Element paramsElem)
      Unmarshals DigestMethodParameterSpec from the specified Element.
      • Methods inherited from class java.lang.Object

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

        getAlgorithm
      • Methods inherited from interface javax.xml.crypto.XMLStructure

        isFeatureSupported
    • Constructor Detail

      • DOMDigestMethod

        DOMDigestMethod​(java.security.spec.AlgorithmParameterSpec params)
                 throws java.security.InvalidAlgorithmParameterException
        Creates a DOMDigestMethod.
        Parameters:
        params - the algorithm-specific params (may be null)
        Throws:
        java.security.InvalidAlgorithmParameterException - if the parameters are not appropriate for this digest method
      • DOMDigestMethod

        DOMDigestMethod​(org.w3c.dom.Element dmElem)
                 throws javax.xml.crypto.MarshalException
        Creates a DOMDigestMethod from an element. This constructor invokes the abstract unmarshalParams method to unmarshal any algorithm-specific input parameters.
        Parameters:
        dmElem - a DigestMethod element
        Throws:
        javax.xml.crypto.MarshalException
    • Method Detail

      • unmarshal

        static javax.xml.crypto.dsig.DigestMethod unmarshal​(org.w3c.dom.Element dmElem)
                                                     throws javax.xml.crypto.MarshalException
        Throws:
        javax.xml.crypto.MarshalException
      • checkParams

        void checkParams​(javax.xml.crypto.dsig.spec.DigestMethodParameterSpec params)
                  throws java.security.InvalidAlgorithmParameterException
        Checks if the specified parameters are valid for this algorithm. By default, this method throws an exception if parameters are specified since most DigestMethod algorithms do not have parameters. Subclasses should override it if they have parameters.
        Parameters:
        params - the algorithm-specific params (may be null)
        Throws:
        java.security.InvalidAlgorithmParameterException - if the parameters are not appropriate for this digest method
      • getParameterSpec

        public final java.security.spec.AlgorithmParameterSpec getParameterSpec()
        Specified by:
        getParameterSpec in interface javax.xml.crypto.AlgorithmMethod
        Specified by:
        getParameterSpec in interface javax.xml.crypto.dsig.DigestMethod
      • unmarshalParams

        javax.xml.crypto.dsig.spec.DigestMethodParameterSpec unmarshalParams​(org.w3c.dom.Element paramsElem)
                                                                      throws javax.xml.crypto.MarshalException
        Unmarshals DigestMethodParameterSpec from the specified Element. By default, this method throws an exception since most DigestMethod algorithms do not have parameters. Subclasses should override it if they have parameters.
        Parameters:
        paramsElem - the Element holding the input params
        Returns:
        the algorithm-specific DigestMethodParameterSpec
        Throws:
        javax.xml.crypto.MarshalException - if the parameters cannot be unmarshalled
      • marshal

        public void marshal​(org.w3c.dom.Node parent,
                            java.lang.String prefix,
                            javax.xml.crypto.dom.DOMCryptoContext context)
                     throws javax.xml.crypto.MarshalException
        This method invokes the abstract marshalParams method to marshal any algorithm-specific parameters.
        Specified by:
        marshal in class DOMStructure
        Throws:
        javax.xml.crypto.MarshalException
      • 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
      • marshalParams

        void marshalParams​(org.w3c.dom.Element parent,
                           java.lang.String prefix)
                    throws javax.xml.crypto.MarshalException
        Marshals the algorithm-specific parameters to an Element and appends it to the specified parent element. By default, this method throws an exception since most DigestMethod algorithms do not have parameters. Subclasses should override it if they have parameters.
        Parameters:
        parent - the parent element to append the parameters to
        prefix - the namespace prefix to use
        Throws:
        javax.xml.crypto.MarshalException - if the parameters cannot be marshalled
      • getMessageDigestAlgorithm

        abstract java.lang.String getMessageDigestAlgorithm()
        Returns the MessageDigest standard algorithm name.