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

pack-priv Class DsaSigner

extends Object
implements DSA
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.internal.DSA
Imports
java.math.BigInteger, java.security.SecureRandom, org.bouncycastle.crypto.internal.CipherParameters, .DSA, org.bouncycastle.crypto.internal.params.DsaKeyParameters, .DsaParameters, .DsaPrivateKeyParameters, .DsaPublicKeyParameters, .ParametersWithRandom

The Digital Signature Algorithm - as described in "Handbook of Applied Cryptography", pages 452 - 453.

Field Summary

Modifier and TypeField and Description
private final DsaKCalculator
private DsaKeyParameters
private SecureRandom

Constructor Summary

AccessConstructor and Description
public
DsaSigner(DsaKCalculator
a K value calculator.
kCalculator
)

Configuration with an alternate, possibly deterministic calculator of K.

Method Summary

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

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

Implements org.bouncycastle.crypto.internal.DSA.generateSignature.

generate a signature for the given message using the key we were initialised with.
private BigInteger
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.internal.DSA.init.

initialise the signer for signature generation or signature verification.
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.internal.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 DsaKeyParameters key
randomback to summary
private SecureRandom random

Constructor Detail

DsaSignerback to summary
public DsaSigner(DsaKCalculator kCalculator)

Configuration with an alternate, possibly deterministic calculator of K.

Parameters
kCalculator:DsaKCalculator

a K value calculator.

Method Detail

calculateEback to summary
private BigInteger calculateE(BigInteger n, byte[] message)
generateSignatureback to summary
public BigInteger[] generateSignature(byte[] message)

Implements org.bouncycastle.crypto.internal.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.internal.DSA.generateSignature.

two big integers representing the r and s values respectively.

getRandomizerback to summary
private BigInteger getRandomizer(BigInteger q, SecureRandom provided)
initback to summary
public void init(boolean forSigning, CipherParameters param)

Implements org.bouncycastle.crypto.internal.DSA.init.

Doc from org.bouncycastle.crypto.internal.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.

verifySignatureback to summary
public boolean verifySignature(byte[] message, BigInteger r, BigInteger s)

Implements org.bouncycastle.crypto.internal.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.internal.DSA.verifySignature.

the message that was supposed to have been signed.

r:BigInteger

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

the r signature value.

s:BigInteger

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

the s signature value.