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
Digest Message wrapper and selector class.
MessageDigestAlgorithm.getInstance()
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMessage Digest - NOT RECOMMENDED MD5static final StringMessage Digest - OPTIONAL RIPEMD-160static final StringDigest - Required SHA1static final StringMessage Digest - OPTIONAL SHA224static final StringMessage Digest - RECOMMENDED SHA256static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringMessage Digest - OPTIONAL SHA384static final StringMessage Digest - OPTIONAL SHA512static final Stringprivate final MessageDigestField algorithm stores the actualMessageDigestFields inherited from class ElementProxy
baseURI, LOG -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMessageDigestAlgorithm(Document doc, String algorithmURI) Constructor for the brave who pass their own message digest algorithms and the corresponding URI. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]digest()Proxy method forMessageDigest.digest()which is executed on the internalMessageDigestobject.byte[]digest(byte[] input) Proxy method forMessageDigest.digest(byte[])which is executed on the internalMessageDigestobject.intdigest(byte[] buf, int offset, int len) Proxy method forMessageDigest.digest(byte[], int, int)which is executed on the internalMessageDigestobject.Returns the actualMessageDigestalgorithm objectReturns the localname of the Elements of the sub-class.Returns the namespace of the Elements of the sub-class.private static MessageDigestgetDigestInstance(String algorithmURI) intProxy method forMessageDigest.getDigestLength()which is executed on the internalMessageDigestobject.static MessageDigestAlgorithmgetInstance(Document doc, String algorithmURI) Factory method for constructing a message digest algorithm by name.Proxy method forMessageDigest.getAlgorithm()which is executed on the internalMessageDigestobject.Proxy method forMessageDigest.getProvider()which is executed on the internalMessageDigestobject.static booleanisEqual(byte[] digesta, byte[] digestb) Proxy method forMessageDigest.isEqual(byte[], byte[])which is executed on the internalMessageDigestobject.voidreset()Proxy method forMessageDigest.reset()which is executed on the internalMessageDigestobject.voidupdate(byte input) Proxy method forMessageDigest.update(byte)which is executed on the internalMessageDigestobject.voidupdate(byte[] input) Proxy method forMessageDigest.update(byte[])which is executed on the internalMessageDigestobject.voidupdate(byte[] buf, int offset, int len) Proxy method forMessageDigest.update(byte[], int, int)which is executed on the internalMessageDigestobject.Methods inherited from class Algorithm
getAlgorithmURI, setAlgorithmURIMethods inherited from class 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 Details
-
ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5
Message Digest - NOT RECOMMENDED MD5- See Also:
-
ALGO_ID_DIGEST_SHA1
-
ALGO_ID_DIGEST_SHA224
-
ALGO_ID_DIGEST_SHA256
-
ALGO_ID_DIGEST_SHA384
-
ALGO_ID_DIGEST_SHA512
-
ALGO_ID_DIGEST_RIPEMD160
-
ALGO_ID_DIGEST_WHIRLPOOL
- See Also:
-
ALGO_ID_DIGEST_SHA3_224
- See Also:
-
ALGO_ID_DIGEST_SHA3_256
- See Also:
-
ALGO_ID_DIGEST_SHA3_384
- See Also:
-
ALGO_ID_DIGEST_SHA3_512
- See Also:
-
algorithm
Field algorithm stores the actualMessageDigest
-
-
Constructor Details
-
MessageDigestAlgorithm
Constructor for the brave who pass their own message digest algorithms and the corresponding URI.- Parameters:
doc-algorithmURI-- Throws:
XMLSignatureException
-
-
Method Details
-
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
- Throws:
XMLSignatureException
-
getAlgorithm
Returns the actualMessageDigestalgorithm object- Returns:
- the actual
MessageDigestalgorithm object
-
isEqual
public static boolean isEqual(byte[] digesta, byte[] digestb) Proxy method forMessageDigest.isEqual(byte[], byte[])which is executed on the internalMessageDigestobject.- 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 internalMessageDigestobject.- Returns:
- the result of the
MessageDigest.digest()method
-
digest
public byte[] digest(byte[] input) Proxy method forMessageDigest.digest(byte[])which is executed on the internalMessageDigestobject.- Parameters:
input-- Returns:
- the result of the
MessageDigest.digest(byte[])method
-
digest
Proxy method forMessageDigest.digest(byte[], int, int)which is executed on the internalMessageDigestobject.- Parameters:
buf-offset-len-- Returns:
- the result of the
MessageDigest.digest(byte[], int, int)method - Throws:
DigestException
-
getJCEAlgorithmString
Proxy method forMessageDigest.getAlgorithm()which is executed on the internalMessageDigestobject.- Returns:
- the result of the
MessageDigest.getAlgorithm()method
-
getJCEProvider
Proxy method forMessageDigest.getProvider()which is executed on the internalMessageDigestobject.- Returns:
- the result of the
MessageDigest.getProvider()method
-
getDigestLength
public int getDigestLength()Proxy method forMessageDigest.getDigestLength()which is executed on the internalMessageDigestobject.- Returns:
- the result of the
MessageDigest.getDigestLength()method
-
reset
public void reset()Proxy method forMessageDigest.reset()which is executed on the internalMessageDigestobject. -
update
public void update(byte[] input) Proxy method forMessageDigest.update(byte[])which is executed on the internalMessageDigestobject.- Parameters:
input-
-
update
public void update(byte input) Proxy method forMessageDigest.update(byte)which is executed on the internalMessageDigestobject.- Parameters:
input-
-
update
public void update(byte[] buf, int offset, int len) Proxy method forMessageDigest.update(byte[], int, int)which is executed on the internalMessageDigestobject.- Parameters:
buf-offset-len-
-
getBaseNamespace
Returns the namespace of the Elements of the sub-class.- Overrides:
getBaseNamespacein classSignatureElementProxy- Returns:
- the namespace of the Elements of the sub-class.
-
getBaseLocalName
Returns the localname of the Elements of the sub-class.- Specified by:
getBaseLocalNamein classElementProxy- Returns:
- the localname of the Elements of the sub-class.
-