public class HashElement extends Object implements ExtensionElement
Modifier and Type | Field and Description |
---|---|
static String |
ATTR_ALGO |
static String |
ELEMENT |
Constructor and Description |
---|
HashElement(HashManager.ALGORITHM algorithm,
byte[] hash)
Create a HashElement from pre-calculated values.
|
HashElement(HashManager.ALGORITHM algorithm,
String hashB64)
Create a HashElement from pre-calculated values.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
HashManager.ALGORITHM |
getAlgorithm()
Return the hash algorithm used in this HashElement.
|
String |
getElementName()
Returns the root element name.
|
byte[] |
getHash()
Return the checksum as a byte array.
|
String |
getHashB64()
Return the checksum as a base16 (hex) string.
|
String |
getNamespace()
Returns the root element XML namespace.
|
int |
hashCode() |
CharSequence |
toXML(String enclosingNamespace)
Returns the XML representation of this Element.
|
public static final String ELEMENT
public static final String ATTR_ALGO
public HashElement(HashManager.ALGORITHM algorithm, byte[] hash)
algorithm
- The algorithm which was used.hash
- the checksum as byte array.public HashElement(HashManager.ALGORITHM algorithm, String hashB64)
algorithm
- the algorithm that was used.hashB64
- the checksum in base 64.public HashManager.ALGORITHM getAlgorithm()
public byte[] getHash()
public String getHashB64()
public String getElementName()
NamedElement
getElementName
in interface NamedElement
public CharSequence toXML(String enclosingNamespace)
Element
public String getNamespace()
ExtensionElement
getNamespace
in interface ExtensionElement