public class AlgorithmId extends Object implements Serializable
get(String)
The OID is handled in it's String format in this class. example 1.2.840.113549.1.1.11 for "SHA256withRSA"Constructor and Description |
---|
AlgorithmId(String oid)
Constructs a parameterless algorithm ID.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(AlgorithmId other)
Returns true iff the argument indicates the same algorithm with the same parameters.
|
boolean |
equals(Object other)
Compares this AlgorithmID to another.
|
boolean |
equals(String id)
Compares two algorithm IDs for equality.
|
static AlgorithmId |
get(String algname)
Returns one of the algorithm IDs most commonly associated with this algorithm name.
|
static String |
getDigAlgFromSigAlg(String signatureAlgorithm)
Extracts the digest algorithm name from a signature algorithm name.
|
static String |
getEncAlgFromSigAlg(String signatureAlgorithm)
Extracts the encryption algorithm name from a signature algorithm name.
|
String |
getOID()
Returns the ISO OID for this algorithm.
|
int |
hashCode()
Returns a hashcode for this AlgorithmId.
|
static String |
makeSigAlg(String digAlg,
String encAlg)
Creates a signature algorithm name from a digest algorithm name and a encryption algorithm name.
|
public AlgorithmId(String oid)
oid
- the identifier for the algorithmpublic boolean equals(AlgorithmId other)
other
- public boolean equals(@Nullable Object other)
equals
in class Object
other
- preferably an AlgorithmId, else an ObjectIdentifiertrue
if this object is the same as the obj argument; false
otherwise.Object.hashCode()
,
HashMap
public final boolean equals(String id)
public static AlgorithmId get(String algname) throws NoSuchAlgorithmException
algname
- the name being usedNoSuchAlgorithmException
- on error.public static String getDigAlgFromSigAlg(String signatureAlgorithm)
public static String getEncAlgFromSigAlg(String signatureAlgorithm)
public final String getOID()
getName
call when you do not need to
ensure cross-system portability of algorithm names, or need a user friendly name.public int hashCode()
hashCode
in class Object
Object.equals(java.lang.Object)
,
System.identityHashCode(java.lang.Object)