- 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 algorithmnames.- Since:
- 1.0.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)StringgetAlgorithm()StringgetHashAlgorithm()StringgetSigningAlgorithm()inthashCode()booleanisNoHashing()static SignatureAlgorithmof(String algorithm)static SignatureAlgorithmof(String hashAlgorithm, String signingAlgorithm)StringtoString()
-
-
-
Method Detail
-
getAlgorithm
public String getAlgorithm()
- Specified by:
getAlgorithmin 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:
trueifhash algorithmisNONE.
-
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
SignatureAlgorithminstance.
-
of
public static SignatureAlgorithm of(String algorithm)
- Parameters:
algorithm- thesignature algorithm.- Returns:
- the
SignatureAlgorithminstance.
-
-