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 classDOMDigestMethod.RIPEMD160(package private) static classDOMDigestMethod.SHA1(package private) static classDOMDigestMethod.SHA224(package private) static classDOMDigestMethod.SHA256(package private) static classDOMDigestMethod.SHA3_224(package private) static classDOMDigestMethod.SHA3_256(package private) static classDOMDigestMethod.SHA3_384(package private) static classDOMDigestMethod.SHA3_512(package private) static classDOMDigestMethod.SHA384(package private) static classDOMDigestMethod.SHA512(package private) static classDOMDigestMethod.WHIRLPOOL
-
Field Summary
Fields Modifier and Type Field Description private javax.xml.crypto.dsig.spec.DigestMethodParameterSpecparams(package private) static java.lang.StringSHA224(package private) static java.lang.StringSHA3_224(package private) static java.lang.StringSHA3_256(package private) static java.lang.StringSHA3_384(package private) static java.lang.StringSHA3_512(package private) static java.lang.StringSHA384(package private) static java.lang.StringWHIRLPOOL
-
Constructor Summary
Constructors Constructor Description DOMDigestMethod(java.security.spec.AlgorithmParameterSpec params)Creates aDOMDigestMethod.DOMDigestMethod(org.w3c.dom.Element dmElem)Creates aDOMDigestMethodfrom an element.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) voidcheckParams(javax.xml.crypto.dsig.spec.DigestMethodParameterSpec params)Checks if the specified parameters are valid for this algorithm.booleanequals(java.lang.Object o)(package private) abstract java.lang.StringgetMessageDigestAlgorithm()Returns the MessageDigest standard algorithm name.java.security.spec.AlgorithmParameterSpecgetParameterSpec()inthashCode()voidmarshal(org.w3c.dom.Node parent, java.lang.String prefix, javax.xml.crypto.dom.DOMCryptoContext context)This method invokes the abstractmarshalParamsmethod to marshal any algorithm-specific parameters.(package private) voidmarshalParams(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.DigestMethodunmarshal(org.w3c.dom.Element dmElem)(package private) javax.xml.crypto.dsig.spec.DigestMethodParameterSpecunmarshalParams(org.w3c.dom.Element paramsElem)UnmarshalsDigestMethodParameterSpecfrom 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.InvalidAlgorithmParameterExceptionCreates 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.MarshalExceptionCreates aDOMDigestMethodfrom an element. This constructor invokes the abstractunmarshalParamsmethod 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.InvalidAlgorithmParameterExceptionChecks 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:
getParameterSpecin interfacejavax.xml.crypto.AlgorithmMethod- Specified by:
getParameterSpecin interfacejavax.xml.crypto.dsig.DigestMethod
-
unmarshalParams
javax.xml.crypto.dsig.spec.DigestMethodParameterSpec unmarshalParams(org.w3c.dom.Element paramsElem) throws javax.xml.crypto.MarshalExceptionUnmarshalsDigestMethodParameterSpecfrom 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- theElementholding 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.MarshalExceptionThis method invokes the abstractmarshalParamsmethod to marshal any algorithm-specific parameters.- Specified by:
marshalin classDOMStructure- Throws:
javax.xml.crypto.MarshalException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
marshalParams
void marshalParams(org.w3c.dom.Element parent, java.lang.String prefix) throws javax.xml.crypto.MarshalExceptionMarshals 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.
-
-