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
-
Fields inherited from class java.security.Signature
SIGN, state, UNINITIALIZED, VERIFY
-
Fields inherited from class java.security.SignatureSpi
appRandom
-
-
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
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected ObjectengineGetParameter(String param)Deprecated.protected voidengineInitSign(PrivateKey privateKey)protected voidengineInitVerify(PublicKey publicKey)protected voidengineSetParameter(String param, Object value)Deprecated.replaced with thisprotected byte[]engineSign()protected voidengineUpdate(byte b)protected voidengineUpdate(byte[] b, int off, int len)protected booleanengineVerify(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 Detail
-
ElGamalSigEngine
public ElGamalSigEngine()
No specific hash requested, allows any ElGamal key.
-
ElGamalSigEngine
public ElGamalSigEngine(MessageDigest digest)
Specific hash requested, only matching keys will be allowed.- Parameters:
digest- the hash algorithm that keys must have to sign or verify.
-
-
Method Detail
-
engineInitSign
protected void engineInitSign(PrivateKey privateKey) throws InvalidKeyException
- Specified by:
engineInitSignin classSignatureSpi- Throws:
InvalidKeyException
-
engineInitVerify
protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException
- Specified by:
engineInitVerifyin classSignatureSpi- Throws:
InvalidKeyException
-
engineUpdate
protected void engineUpdate(byte b) throws SignatureException- Specified by:
engineUpdatein classSignatureSpi- Throws:
SignatureException
-
engineUpdate
protected void engineUpdate(byte[] b, int off, int len) throws SignatureException- Specified by:
engineUpdatein classSignatureSpi- Throws:
SignatureException
-
engineSign
protected byte[] engineSign() throws SignatureException- Specified by:
engineSignin classSignatureSpi- Returns:
- ASN.1 R,S
- Throws:
SignatureException
-
engineVerify
protected boolean engineVerify(byte[] sigBytes) throws SignatureException- Specified by:
engineVerifyin classSignatureSpi- Parameters:
sigBytes- ASN.1 R,S- Throws:
SignatureException
-
engineSetParameter
protected void engineSetParameter(String param, Object value)
Deprecated.replaced with this- Specified by:
engineSetParameterin classSignatureSpi
-
engineGetParameter
protected Object engineGetParameter(String param)
Deprecated.- Specified by:
engineGetParameterin classSignatureSpi
-
-