org.apache.xml.security.algorithms
Class MessageDigestAlgorithm

java.lang.Object
  extended by org.apache.xml.security.utils.ElementProxy
      extended by org.apache.xml.security.utils.SignatureElementProxy
          extended by org.apache.xml.security.algorithms.Algorithm
              extended by org.apache.xml.security.algorithms.MessageDigestAlgorithm

public class MessageDigestAlgorithm
extends Algorithm

Digest Message wrapper & selector class.

 MessageDigestAlgorithm.getInstance()
 


Field Summary
static String ALGO_ID_DIGEST_NOT_RECOMMENDED_MD5
          Message Digest - NOT RECOMMENDED MD5
static String ALGO_ID_DIGEST_RIPEMD160
          Message Digest - OPTIONAL RIPEMD-160
static String ALGO_ID_DIGEST_SHA1
          Digest - Required SHA1
static String ALGO_ID_DIGEST_SHA224
          Message Digest - OPTIONAL SHA224
static String ALGO_ID_DIGEST_SHA256
          Message Digest - RECOMMENDED SHA256
static 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 SHA384
static String ALGO_ID_DIGEST_SHA512
          Message Digest - OPTIONAL SHA512
static String ALGO_ID_DIGEST_WHIRLPOOL
           
 
Fields inherited from class org.apache.xml.security.utils.ElementProxy
baseURI, log
 
Method Summary
 byte[] digest()
          Proxy method for MessageDigest.digest() which is executed on the internal MessageDigest object.
 byte[] digest(byte[] input)
          Proxy method for MessageDigest.digest(byte[]) which is executed on the internal MessageDigest object.
 int digest(byte[] buf, int offset, int len)
          Proxy method for MessageDigest.digest(byte[], int, int) which is executed on the internal MessageDigest object.
 MessageDigest getAlgorithm()
          Returns the actual MessageDigest algorithm object
 String getBaseLocalName()
          Returns the localname of the Elements of the sub-class.
 String getBaseNamespace()
          Returns the namespace of the Elements of the sub-class.
 int getDigestLength()
          Proxy method for MessageDigest.getDigestLength() which is executed on the internal MessageDigest object.
static MessageDigestAlgorithm getInstance(Document doc, String algorithmURI)
          Factory method for constructing a message digest algorithm by name.
 String getJCEAlgorithmString()
          Proxy method for MessageDigest.getAlgorithm() which is executed on the internal MessageDigest object.
 Provider getJCEProvider()
          Proxy method for MessageDigest.getProvider() which is executed on the internal MessageDigest object.
static boolean isEqual(byte[] digesta, byte[] digestb)
          Proxy method for MessageDigest.isEqual(byte[], byte[]) which is executed on the internal MessageDigest object.
 void reset()
          Proxy method for MessageDigest.reset() which is executed on the internal MessageDigest object.
 void update(byte input)
          Proxy method for MessageDigest.update(byte) which is executed on the internal MessageDigest object.
 void update(byte[] input)
          Proxy method for MessageDigest.update(byte[]) which is executed on the internal MessageDigest object.
 void update(byte[] buf, int offset, int len)
          Proxy method for MessageDigest.update(byte[], int, int) which is executed on the internal MessageDigest 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getAlgorithm

public MessageDigest getAlgorithm()
Returns the actual MessageDigest algorithm object

Returns:
the actual MessageDigest algorithm object

isEqual

public static boolean isEqual(byte[] digesta,
                              byte[] digestb)
Proxy method for MessageDigest.isEqual(byte[], byte[]) which is executed on the internal MessageDigest object.

Parameters:
digesta -
digestb -
Returns:
the result of the MessageDigest.isEqual(byte[], byte[]) method

digest

public byte[] digest()
Proxy method for MessageDigest.digest() which is executed on the internal MessageDigest object.

Returns:
the result of the MessageDigest.digest() method

digest

public byte[] digest(byte[] input)
Proxy method for MessageDigest.digest(byte[]) which is executed on the internal MessageDigest 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 for MessageDigest.digest(byte[], int, int) which is executed on the internal MessageDigest object.

Parameters:
buf -
offset -
len -
Returns:
the result of the MessageDigest.digest(byte[], int, int) method
Throws:
DigestException

getJCEAlgorithmString

public String getJCEAlgorithmString()
Proxy method for MessageDigest.getAlgorithm() which is executed on the internal MessageDigest object.

Returns:
the result of the MessageDigest.getAlgorithm() method

getJCEProvider

public Provider getJCEProvider()
Proxy method for MessageDigest.getProvider() which is executed on the internal MessageDigest object.

Returns:
the result of the MessageDigest.getProvider() method

getDigestLength

public int getDigestLength()
Proxy method for MessageDigest.getDigestLength() which is executed on the internal MessageDigest object.

Returns:
the result of the MessageDigest.getDigestLength() method

reset

public void reset()
Proxy method for MessageDigest.reset() which is executed on the internal MessageDigest object.


update

public void update(byte[] input)
Proxy method for MessageDigest.update(byte[]) which is executed on the internal MessageDigest object.

Parameters:
input -

update

public void update(byte input)
Proxy method for MessageDigest.update(byte) which is executed on the internal MessageDigest object.

Parameters:
input -

update

public void update(byte[] buf,
                   int offset,
                   int len)
Proxy method for MessageDigest.update(byte[], int, int) which is executed on the internal MessageDigest object.

Parameters:
buf -
offset -
len -

getBaseNamespace

public String getBaseNamespace()
Description copied from class: ElementProxy
Returns the namespace of the Elements of the sub-class.

Overrides:
getBaseNamespace in class SignatureElementProxy
Returns:
the namespace of the Elements of the sub-class.

getBaseLocalName

public String getBaseLocalName()
Description copied from class: ElementProxy
Returns the localname of the Elements of the sub-class.

Specified by:
getBaseLocalName in class ElementProxy
Returns:
the localname of the Elements of the sub-class.


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.