Class DOMDigestMethod
java.lang.Object
org.apache.jcp.xml.dsig.internal.dom.DOMStructure
org.apache.jcp.xml.dsig.internal.dom.DOMDigestMethod
- All Implemented Interfaces:
AlgorithmMethod
,DigestMethod
,XMLStructure
- Direct Known Subclasses:
DOMDigestMethod.RIPEMD160
,DOMDigestMethod.SHA1
,DOMDigestMethod.SHA224
,DOMDigestMethod.SHA256
,DOMDigestMethod.SHA3_224
,DOMDigestMethod.SHA3_256
,DOMDigestMethod.SHA3_384
,DOMDigestMethod.SHA3_512
,DOMDigestMethod.SHA384
,DOMDigestMethod.SHA512
,DOMDigestMethod.WHIRLPOOL
DOM-based abstract implementation of DigestMethod.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
(package private) static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DigestMethodParameterSpec
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
(package private) static final String
Fields inherited from interface javax.xml.crypto.dsig.DigestMethod
RIPEMD160, SHA1, SHA256, SHA512
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aDOMDigestMethod
.DOMDigestMethod
(Element dmElem) Creates aDOMDigestMethod
from an element. -
Method Summary
Modifier and TypeMethodDescription(package private) void
checkParams
(DigestMethodParameterSpec params) Checks if the specified parameters are valid for this algorithm.boolean
(package private) abstract String
Returns the MessageDigest standard algorithm name.final AlgorithmParameterSpec
int
hashCode()
void
marshal
(Node parent, String prefix, DOMCryptoContext context) This method invokes the abstractmarshalParams
method to marshal any algorithm-specific parameters.(package private) void
marshalParams
(Element parent, String prefix) Marshals the algorithm-specific parameters to an Element and appends it to the specified parent element.(package private) static DigestMethod
(package private) DigestMethodParameterSpec
unmarshalParams
(Element paramsElem) UnmarshalsDigestMethodParameterSpec
from the specifiedElement
.Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
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
-
Field Details
-
SHA224
- See Also:
-
SHA384
- See Also:
-
WHIRLPOOL
- See Also:
-
SHA3_224
- See Also:
-
SHA3_256
- See Also:
-
SHA3_384
- See Also:
-
SHA3_512
- See Also:
-
params
-
-
Constructor Details
-
DOMDigestMethod
DOMDigestMethod(AlgorithmParameterSpec params) throws InvalidAlgorithmParameterException Creates aDOMDigestMethod
.- Parameters:
params
- the algorithm-specific params (may benull
)- Throws:
InvalidAlgorithmParameterException
- if the parameters are not appropriate for this digest method
-
DOMDigestMethod
DOMDigestMethod(Element dmElem) throws MarshalException Creates aDOMDigestMethod
from an element. This constructor invokes the abstractunmarshalParams
method to unmarshal any algorithm-specific input parameters.- Parameters:
dmElem
- a DigestMethod element- Throws:
MarshalException
-
-
Method Details
-
unmarshal
- Throws:
MarshalException
-
checkParams
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 benull
)- Throws:
InvalidAlgorithmParameterException
- if the parameters are not appropriate for this digest method
-
getParameterSpec
- Specified by:
getParameterSpec
in interfaceAlgorithmMethod
- Specified by:
getParameterSpec
in interfaceDigestMethod
-
unmarshalParams
UnmarshalsDigestMethodParameterSpec
from the specifiedElement
. 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
- theElement
holding the input params- Returns:
- the algorithm-specific
DigestMethodParameterSpec
- Throws:
MarshalException
- if the parameters cannot be unmarshalled
-
marshal
This method invokes the abstractmarshalParams
method to marshal any algorithm-specific parameters.- Specified by:
marshal
in classDOMStructure
- Throws:
MarshalException
-
equals
-
hashCode
public int hashCode() -
marshalParams
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 toprefix
- the namespace prefix to use- Throws:
MarshalException
- if the parameters cannot be marshalled
-
getMessageDigestAlgorithm
Returns the MessageDigest standard algorithm name.
-