Module org.apache.santuario.xmlsec
Class MessageDigestAlgorithm
- java.lang.Object
-
- org.apache.xml.security.utils.ElementProxy
-
- org.apache.xml.security.utils.SignatureElementProxy
-
- org.apache.xml.security.algorithms.Algorithm
-
- org.apache.xml.security.algorithms.MessageDigestAlgorithm
-
public final class MessageDigestAlgorithm extends Algorithm
Digest Message wrapper and selector class.MessageDigestAlgorithm.getInstance()
-
-
Field Summary
Fields Modifier and Type Field Description static String
ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5
Message Digest - NOT RECOMMENDED MD5static String
ALGO_ID_DIGEST_RIPEMD160
Message Digest - OPTIONAL RIPEMD-160static String
ALGO_ID_DIGEST_SHA1
Digest - Required SHA1static String
ALGO_ID_DIGEST_SHA224
Message Digest - OPTIONAL SHA224static String
ALGO_ID_DIGEST_SHA256
Message Digest - RECOMMENDED SHA256static String
ALGO_ID_DIGEST_SHA3_224
static String
ALGO_ID_DIGEST_SHA3_256
static String
ALGO_ID_DIGEST_SHA3_384
static String
ALGO_ID_DIGEST_SHA3_512
static String
ALGO_ID_DIGEST_SHA384
Message Digest - OPTIONAL SHA384static String
ALGO_ID_DIGEST_SHA512
Message Digest - OPTIONAL SHA512static String
ALGO_ID_DIGEST_WHIRLPOOL
-
Fields inherited from class org.apache.xml.security.utils.ElementProxy
baseURI, LOG
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
digest()
Proxy method forMessageDigest.digest()
which is executed on the internalMessageDigest
object.byte[]
digest(byte[] input)
Proxy method forMessageDigest.digest(byte[])
which is executed on the internalMessageDigest
object.int
digest(byte[] buf, int offset, int len)
Proxy method forMessageDigest.digest(byte[], int, int)
which is executed on the internalMessageDigest
object.MessageDigest
getAlgorithm()
Returns the actualMessageDigest
algorithm objectString
getBaseLocalName()
Returns the localname of the Elements of the sub-class.String
getBaseNamespace()
Returns the namespace of the Elements of the sub-class.static MessageDigest
getDigestInstance(String algorithmURI)
int
getDigestLength()
Proxy method forMessageDigest.getDigestLength()
which is executed on the internalMessageDigest
object.static MessageDigestAlgorithm
getInstance(Document doc, String algorithmURI)
Factory method for constructing a message digest algorithm by name.String
getJCEAlgorithmString()
Proxy method forMessageDigest.getAlgorithm()
which is executed on the internalMessageDigest
object.Provider
getJCEProvider()
Proxy method forMessageDigest.getProvider()
which is executed on the internalMessageDigest
object.static boolean
isEqual(byte[] digesta, byte[] digestb)
Proxy method forMessageDigest.isEqual(byte[], byte[])
which is executed on the internalMessageDigest
object.void
reset()
Proxy method forMessageDigest.reset()
which is executed on the internalMessageDigest
object.void
update(byte input)
Proxy method forMessageDigest.update(byte)
which is executed on the internalMessageDigest
object.void
update(byte[] input)
Proxy method forMessageDigest.update(byte[])
which is executed on the internalMessageDigest
object.void
update(byte[] buf, int offset, int len)
Proxy method forMessageDigest.update(byte[], int, int)
which is executed on the internalMessageDigest
object.-
Methods inherited from class org.apache.xml.security.algorithms.Algorithm
getAlgorithmURI, setAlgorithmURI
-
Methods inherited from class org.apache.xml.security.utils.ElementProxy
addBase64Element, addBase64Text, addBigIntegerElement, addReturnToSelf, addText, addTextElement, appendOther, appendSelf, appendSelf, createElementForFamily, createElementForFamilyLocal, createText, getBaseURI, getBigIntegerFromChildElement, getBytesFromTextChild, getDefaultPrefix, getDocument, getElement, getElementPlusReturns, getFirstChild, getLocalAttribute, getTextFromChildElement, getTextFromTextChild, length, registerDefaultPrefixes, setDefaultPrefix, setDocument, setElement, setElement, setLocalAttribute, setLocalIdAttribute, setXPathNamespaceContext
-
-
-
-
Field Detail
-
ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5
public static final String ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5
Message Digest - NOT RECOMMENDED MD5- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA1
public static final String ALGO_ID_DIGEST_SHA1
Digest - Required SHA1- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA224
public static final String ALGO_ID_DIGEST_SHA224
Message Digest - OPTIONAL SHA224- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA256
public static final String ALGO_ID_DIGEST_SHA256
Message Digest - RECOMMENDED SHA256- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA384
public static final String ALGO_ID_DIGEST_SHA384
Message Digest - OPTIONAL SHA384- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA512
public static final String ALGO_ID_DIGEST_SHA512
Message Digest - OPTIONAL SHA512- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_RIPEMD160
public static final String ALGO_ID_DIGEST_RIPEMD160
Message Digest - OPTIONAL RIPEMD-160- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_WHIRLPOOL
public static final String ALGO_ID_DIGEST_WHIRLPOOL
- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA3_224
public static final String ALGO_ID_DIGEST_SHA3_224
- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA3_256
public static final String ALGO_ID_DIGEST_SHA3_256
- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA3_384
public static final String ALGO_ID_DIGEST_SHA3_384
- See Also:
- Constant Field Values
-
ALGO_ID_DIGEST_SHA3_512
public static final String ALGO_ID_DIGEST_SHA3_512
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static MessageDigestAlgorithm getInstance(Document doc, String algorithmURI) throws XMLSignatureException
Factory method for constructing a message digest algorithm by name.- Parameters:
doc
-algorithmURI
-- Returns:
- The MessageDigestAlgorithm element to attach in document and to digest
- Throws:
XMLSignatureException
-
getDigestInstance
public static MessageDigest getDigestInstance(String algorithmURI) throws XMLSignatureException
- Throws:
XMLSignatureException
-
getAlgorithm
public MessageDigest getAlgorithm()
Returns the actualMessageDigest
algorithm object- Returns:
- the actual
MessageDigest
algorithm object
-
isEqual
public static boolean isEqual(byte[] digesta, byte[] digestb)
Proxy method forMessageDigest.isEqual(byte[], byte[])
which is executed on the internalMessageDigest
object.- Parameters:
digesta
-digestb
-- Returns:
- the result of the
MessageDigest.isEqual(byte[], byte[])
method
-
digest
public byte[] digest()
Proxy method forMessageDigest.digest()
which is executed on the internalMessageDigest
object.- Returns:
- the result of the
MessageDigest.digest()
method
-
digest
public byte[] digest(byte[] input)
Proxy method forMessageDigest.digest(byte[])
which is executed on the internalMessageDigest
object.- Parameters:
input
-- Returns:
- the result of the
MessageDigest.digest(byte[])
method
-
digest
public int digest(byte[] buf, int offset, int len) throws DigestException
Proxy method forMessageDigest.digest(byte[], int, int)
which is executed on the internalMessageDigest
object.- Parameters:
buf
-offset
-len
-- Returns:
- the result of the
MessageDigest.digest(byte[], int, int)
method - Throws:
DigestException
-
getJCEAlgorithmString
public String getJCEAlgorithmString()
Proxy method forMessageDigest.getAlgorithm()
which is executed on the internalMessageDigest
object.- Returns:
- the result of the
MessageDigest.getAlgorithm()
method
-
getJCEProvider
public Provider getJCEProvider()
Proxy method forMessageDigest.getProvider()
which is executed on the internalMessageDigest
object.- Returns:
- the result of the
MessageDigest.getProvider()
method
-
getDigestLength
public int getDigestLength()
Proxy method forMessageDigest.getDigestLength()
which is executed on the internalMessageDigest
object.- Returns:
- the result of the
MessageDigest.getDigestLength()
method
-
reset
public void reset()
Proxy method forMessageDigest.reset()
which is executed on the internalMessageDigest
object.
-
update
public void update(byte[] input)
Proxy method forMessageDigest.update(byte[])
which is executed on the internalMessageDigest
object.- Parameters:
input
-
-
update
public void update(byte input)
Proxy method forMessageDigest.update(byte)
which is executed on the internalMessageDigest
object.- Parameters:
input
-
-
update
public void update(byte[] buf, int offset, int len)
Proxy method forMessageDigest.update(byte[], int, int)
which is executed on the internalMessageDigest
object.- Parameters:
buf
-offset
-len
-
-
getBaseNamespace
public String getBaseNamespace()
Returns the namespace of the Elements of the sub-class.- Overrides:
getBaseNamespace
in classSignatureElementProxy
- Returns:
- the namespace of the Elements of the sub-class.
-
getBaseLocalName
public String getBaseLocalName()
Returns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalName
in classElementProxy
- Returns:
- the localname of the Elements of the sub-class.
-
-