Package net.i2p.crypto.elgamal
Class ElGamalSigEngine
java.lang.Object
java.security.SignatureSpi
java.security.Signature
net.i2p.crypto.elgamal.ElGamalSigEngine
public final class ElGamalSigEngine extends Signature
ElG signatures with SHA-256
ref: https://en.wikipedia.org/wiki/ElGamal_signature_scheme
- Since:
- 0.9.25
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ElGamalSigEngine()
No specific hash requested, allows any ElGamal key.ElGamalSigEngine(MessageDigest digest)
Specific hash requested, only matching keys will be allowed. -
Method Summary
Modifier and Type Method Description protected Object
engineGetParameter(String param)
Deprecated.protected void
engineInitSign(PrivateKey privateKey)
protected void
engineInitVerify(PublicKey publicKey)
protected void
engineSetParameter(String param, Object value)
Deprecated.replaced with thisprotected byte[]
engineSign()
protected void
engineUpdate(byte b)
protected void
engineUpdate(byte[] b, int off, int len)
protected boolean
engineVerify(byte[] sigBytes)
Methods inherited from class java.security.Signature
clone, getAlgorithm, getInstance, getInstance, getInstance, getParameter, getParameters, getProvider, initSign, initSign, initVerify, initVerify, setParameter, setParameter, sign, sign, toString, update, update, update, update, verify, verify
Methods inherited from class java.security.SignatureSpi
engineGetParameters, engineInitSign, engineSetParameter, engineSign, engineUpdate, engineVerify
-
Constructor Details
-
ElGamalSigEngine
public ElGamalSigEngine()No specific hash requested, allows any ElGamal key. -
ElGamalSigEngine
Specific hash requested, only matching keys will be allowed.- Parameters:
digest
- the hash algorithm that keys must have to sign or verify.
-
-
Method Details
-
engineInitSign
- Specified by:
engineInitSign
in classSignatureSpi
- Throws:
InvalidKeyException
-
engineInitVerify
- Specified by:
engineInitVerify
in classSignatureSpi
- Throws:
InvalidKeyException
-
engineUpdate
- Specified by:
engineUpdate
in classSignatureSpi
- Throws:
SignatureException
-
engineUpdate
- Specified by:
engineUpdate
in classSignatureSpi
- Throws:
SignatureException
-
engineSign
- Specified by:
engineSign
in classSignatureSpi
- Returns:
- ASN.1 R,S
- Throws:
SignatureException
-
engineVerify
- Specified by:
engineVerify
in classSignatureSpi
- Parameters:
sigBytes
- ASN.1 R,S- Throws:
SignatureException
-
engineSetParameter
Deprecated.replaced with this- Specified by:
engineSetParameter
in classSignatureSpi
-
engineGetParameter
Deprecated.- Specified by:
engineGetParameter
in classSignatureSpi
-