Class DOMDigestMethod
- java.lang.Object
-
- org.apache.jcp.xml.dsig.internal.dom.DOMStructure
-
- org.apache.jcp.xml.dsig.internal.dom.DOMDigestMethod
-
- All Implemented Interfaces:
javax.xml.crypto.AlgorithmMethod
,javax.xml.crypto.dsig.DigestMethod
,javax.xml.crypto.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
public abstract class DOMDigestMethod extends DOMStructure implements javax.xml.crypto.dsig.DigestMethod
DOM-based abstract implementation of DigestMethod.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
DOMDigestMethod.RIPEMD160
(package private) static class
DOMDigestMethod.SHA1
(package private) static class
DOMDigestMethod.SHA224
(package private) static class
DOMDigestMethod.SHA256
(package private) static class
DOMDigestMethod.SHA3_224
(package private) static class
DOMDigestMethod.SHA3_256
(package private) static class
DOMDigestMethod.SHA3_384
(package private) static class
DOMDigestMethod.SHA3_512
(package private) static class
DOMDigestMethod.SHA384
(package private) static class
DOMDigestMethod.SHA512
(package private) static class
DOMDigestMethod.WHIRLPOOL
-
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
-
Constructor Summary
Constructors Constructor Description DOMDigestMethod(java.security.spec.AlgorithmParameterSpec params)
Creates aDOMDigestMethod
.DOMDigestMethod(org.w3c.dom.Element dmElem)
Creates aDOMDigestMethod
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 abstractmarshalParams
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)
UnmarshalsDigestMethodParameterSpec
from the specifiedElement
.-
Methods inherited from class org.apache.jcp.xml.dsig.internal.dom.DOMStructure
isFeatureSupported
-
-
-
-
Field Detail
-
SHA224
static final java.lang.String SHA224
- See Also:
- Constant Field Values
-
SHA384
static final java.lang.String SHA384
- See Also:
- Constant Field Values
-
WHIRLPOOL
static final java.lang.String WHIRLPOOL
- See Also:
- Constant Field Values
-
SHA3_224
static final java.lang.String SHA3_224
- See Also:
- Constant Field Values
-
SHA3_256
static final java.lang.String SHA3_256
- See Also:
- Constant Field Values
-
SHA3_384
static final java.lang.String SHA3_384
- See Also:
- Constant Field Values
-
SHA3_512
static final java.lang.String SHA3_512
- See Also:
- Constant Field Values
-
params
private javax.xml.crypto.dsig.spec.DigestMethodParameterSpec params
-
-
Constructor Detail
-
DOMDigestMethod
DOMDigestMethod(java.security.spec.AlgorithmParameterSpec params) throws java.security.InvalidAlgorithmParameterException
Creates aDOMDigestMethod
.- Parameters:
params
- the algorithm-specific params (may benull
)- 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 aDOMDigestMethod
from an element. This constructor invokes the abstractunmarshalParams
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 benull
)- 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 interfacejavax.xml.crypto.AlgorithmMethod
- Specified by:
getParameterSpec
in interfacejavax.xml.crypto.dsig.DigestMethod
-
unmarshalParams
javax.xml.crypto.dsig.spec.DigestMethodParameterSpec unmarshalParams(org.w3c.dom.Element paramsElem) throws javax.xml.crypto.MarshalException
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:
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 abstractmarshalParams
method to marshal any algorithm-specific parameters.- Specified by:
marshal
in classDOMStructure
- Throws:
javax.xml.crypto.MarshalException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.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 toprefix
- 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.
-
-