- java.lang.Object
-
- io.github.mmm.crypto.asymmetric.sign.SignatureAlgorithm
-
- All Implemented Interfaces:
CryptoAlgorithm
public final class SignatureAlgorithm extends Object implements CryptoAlgorithm
Little helper to workaround quirks in JCE/JCA forsignature algorithm
names.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
String
getAlgorithm()
String
getHashAlgorithm()
String
getSigningAlgorithm()
int
hashCode()
boolean
isNoHashing()
static SignatureAlgorithm
of(String algorithm)
static SignatureAlgorithm
of(String hashAlgorithm, String signingAlgorithm)
String
toString()
-
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithm
in interfaceCryptoAlgorithm
- Returns:
- the name of the underlying algorithm (e.g. "RSA", "NONEwithECDSA", etc.).
- See Also:
Key.getAlgorithm()
,Signature.getAlgorithm()
,MessageDigest.getAlgorithm()
,SecureRandom.getAlgorithm()
,Cipher.getAlgorithm()
-
getHashAlgorithm
public String getHashAlgorithm()
- Returns:
- the hash algorithm to perform of the message payload before signing.
-
isNoHashing
public boolean isNoHashing()
- Returns:
true
ifhash algorithm
isNONE
.
-
getSigningAlgorithm
public String getSigningAlgorithm()
- Returns:
- the raw signing algorithm (e.g. RSA, DSA, or ECDSA).
-
of
public static SignatureAlgorithm of(String hashAlgorithm, String signingAlgorithm)
- Parameters:
hashAlgorithm
- thegetHashAlgorithm()
.signingAlgorithm
- thegetSigningAlgorithm()
.- Returns:
- the
SignatureAlgorithm
instance.
-
of
public static SignatureAlgorithm of(String algorithm)
- Parameters:
algorithm
- thesignature algorithm
.- Returns:
- the
SignatureAlgorithm
instance.
-
-