Top Description Fields Constructors Methods
org.bouncycastle.crypto.signers

public Class ECDSASigner

extends Object
implements ECConstants, DSAExt
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.DSAExt, org.bouncycastle.crypto.DSA, org.bouncycastle.math.ec.ECConstants
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.CipherParameters, .CryptoServicesRegistrar, .DSAExt, org.bouncycastle.crypto.params.ECDomainParameters, .ECKeyParameters, .ECPrivateKeyParameters, .ECPublicKeyParameters, .ParametersWithRandom, org.bouncycastle.math.ec.ECAlgorithms, .ECConstants, .ECCurve, .ECFieldElement, .ECMultiplier, .ECPoint, .FixedPointCombMultiplier, org.bouncycastle.util.BigIntegers

EC-DSA as described in X9.62

Field Summary

Modifier and TypeField and Description
private final DSAKCalculator
private ECKeyParameters
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
ECDSASigner()

Default configuration, random K values.

public
ECDSASigner(DSAKCalculator
a K value calculator.
kCalculator
)

Configuration with an alternate, possibly deterministic calculator of K.

Method Summary

Modifier and TypeMethod and Description
protected BigInteger
calculateE(BigInteger n, byte[] message)

protected ECMultiplier
public BigInteger[]
generateSignature(byte[]
the message that will be verified later.
message
)

Implements org.bouncycastle.crypto.DSA.generateSignature.

generate a signature for the given message using the key we were initialised with.

protected ECFieldElement
getDenominator(int coordinateSystem, ECPoint p)

public BigInteger
getOrder()

Implements org.bouncycastle.crypto.DSAExt.getOrder.

Get the order of the group that the r, s values in signatures belong to.

public void
init(boolean
true if we are generating a signature, false otherwise.
forSigning
,
CipherParameters
key parameters for signature generation.
param
)

Implements org.bouncycastle.crypto.DSA.init.

initialise the signer for signature generation or signature verification.

protected SecureRandom
initSecureRandom(boolean needed, SecureRandom provided)

public boolean
verifySignature(byte[]
the message that was supposed to have been signed.
message
,
BigInteger
the r signature value.
r
,
BigInteger
the s signature value.
s
)

Implements org.bouncycastle.crypto.DSA.verifySignature.

return true if the value r and s represent a DSA signature for the passed in message (for standard DSA the message should be a SHA-1 hash of the real message to be verified).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

kCalculatorback to summary
private final DSAKCalculator kCalculator
keyback to summary
private ECKeyParameters key
randomback to summary
private SecureRandom random

Constructor Detail

ECDSASignerback to summary
public ECDSASigner()

Default configuration, random K values.

ECDSASignerback to summary
public ECDSASigner(DSAKCalculator kCalculator)

Configuration with an alternate, possibly deterministic calculator of K.

Parameters
kCalculator:DSAKCalculator

a K value calculator.

Method Detail

calculateEback to summary
protected BigInteger calculateE(BigInteger n, byte[] message)
createBasePointMultiplierback to summary
protected ECMultiplier createBasePointMultiplier()
generateSignatureback to summary
public BigInteger[] generateSignature(byte[] message)

Implements org.bouncycastle.crypto.DSA.generateSignature.

generate a signature for the given message using the key we were initialised with. For conventional DSA the message should be a SHA-1 hash of the message of interest.

Parameters
message:byte[]

the message that will be verified later.

Returns:BigInteger[]

Doc from org.bouncycastle.crypto.DSA.generateSignature.

two big integers representing the r and s values respectively.

getDenominatorback to summary
protected ECFieldElement getDenominator(int coordinateSystem, ECPoint p)
getOrderback to summary
public BigInteger getOrder()

Implements org.bouncycastle.crypto.DSAExt.getOrder.

Doc from org.bouncycastle.crypto.DSAExt.getOrder.

Get the order of the group that the r, s values in signatures belong to.

initback to summary
public void init(boolean forSigning, CipherParameters param)

Implements org.bouncycastle.crypto.DSA.init.

Doc from org.bouncycastle.crypto.DSA.init.

initialise the signer for signature generation or signature verification.

Parameters
forSigning:boolean

true if we are generating a signature, false otherwise.

param:CipherParameters

key parameters for signature generation.

initSecureRandomback to summary
protected SecureRandom initSecureRandom(boolean needed, SecureRandom provided)
verifySignatureback to summary
public boolean verifySignature(byte[] message, BigInteger r, BigInteger s)

Implements org.bouncycastle.crypto.DSA.verifySignature.

return true if the value r and s represent a DSA signature for the passed in message (for standard DSA the message should be a SHA-1 hash of the real message to be verified).

Parameters
message:byte[]

Doc from org.bouncycastle.crypto.DSA.verifySignature.

the message that was supposed to have been signed.

r:BigInteger

Doc from org.bouncycastle.crypto.DSA.verifySignature.

the r signature value.

s:BigInteger

Doc from org.bouncycastle.crypto.DSA.verifySignature.

the s signature value.