public class AlgorithmType extends Object implements Comparable<AlgorithmType>
All algorithms should be available in both plain and HMAC variants.
| Modifier and Type | Field and Description |
|---|---|
static AlgorithmType |
MD4 |
static AlgorithmType |
MD5 |
static AlgorithmType |
RIPEMD160 |
static AlgorithmType |
SHA1 |
static AlgorithmType |
SHA256 |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(AlgorithmType o) |
static Pair<AlgorithmType,Boolean> |
fromRdfString(String str,
boolean convert)
Converts a string to an algorithm type.
|
static AlgorithmType |
getFirstAvailableForId() |
String |
getHmacName() |
String |
getName() |
int |
getType() |
static AlgorithmType[] |
getTypes() |
boolean |
isAvailable() |
boolean |
isCompatible() |
String |
toHmacRdfString() |
String |
toRdfString() |
String |
toString() |
public static final AlgorithmType MD4
public static final AlgorithmType MD5
public static final AlgorithmType SHA1
public static final AlgorithmType RIPEMD160
public static final AlgorithmType SHA256
public static AlgorithmType[] getTypes()
public static Pair<AlgorithmType,Boolean> fromRdfString(String str, boolean convert) throws IncompatibleException
str - The algorithm type. Valid values are: md4, md5, sha1, sha256,
rmd160. Any of those valid types can be prefixed with "hmac-".convert - - if the broken version of sha256 is found, just replace with non-broken version, instead of throwingIncompatibleException - upon invalid algorithm string.public String getName()
public int getType()
public String toRdfString()
public String toHmacRdfString()
public int compareTo(AlgorithmType o)
compareTo in interface Comparable<AlgorithmType>public boolean isCompatible()
public String getHmacName()
public boolean isAvailable()
public static AlgorithmType getFirstAvailableForId()
Copyright © 2018. All rights reserved.