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

public Class DSTU4145Signer

extends Object
implements DSAExt
Class Inheritance
All Implemented Interfaces
org.bouncycastle.crypto.DSAExt, org.bouncycastle.crypto.DSA
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, .ECCurve, .ECFieldElement, .ECMultiplier, .ECPoint, .FixedPointCombMultiplier, org.bouncycastle.util.Arrays, .BigIntegers

DSTU 4145-2002

National Ukrainian standard of digital signature based on elliptic curves (DSTU 4145-2002).

Field Summary

Modifier and TypeField and Description
private ECKeyParameters
private static final BigInteger
private SecureRandom

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected ECMultiplier
private static BigInteger
private static BigInteger
generateRandomInteger(BigInteger n, SecureRandom random)

Generates random integer such, than its bit length is less than that of n

public BigInteger[]
generateSignature(byte[]
the message to be signed.
message
)

Implements org.bouncycastle.crypto.DSA.generateSignature.

sign the passed in message (usually the output of a hash function).
public BigInteger
getOrder()

Implements org.bouncycastle.crypto.DSAExt.getOrder.

Get the order of the group that the r, s values in signatures belong to.
private static ECFieldElement
hash2FieldElement(ECCurve curve, byte[] hash)

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.
private static BigInteger
truncate(BigInteger x, int bitLength)

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.

verify the message message against the signature values r and s.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

keyback to summary
private ECKeyParameters key
ONEback to summary
private static final BigInteger ONE
randomback to summary
private SecureRandom random

Constructor Detail

DSTU4145Signerback to summary
public DSTU4145Signer()

Method Detail

createBasePointMultiplierback to summary
protected ECMultiplier createBasePointMultiplier()
fieldElement2Integerback to summary
private static BigInteger fieldElement2Integer(BigInteger n, ECFieldElement fe)
generateRandomIntegerback to summary
private static BigInteger generateRandomInteger(BigInteger n, SecureRandom random)

Generates random integer such, than its bit length is less than that of n

generateSignatureback to summary
public BigInteger[] generateSignature(byte[] message)

Implements org.bouncycastle.crypto.DSA.generateSignature.

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

sign the passed in message (usually the output of a hash function).

Parameters
message:byte[]

the message to be signed.

Returns:BigInteger[]

two big integers representing the r and s values respectively.

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.

hash2FieldElementback to summary
private static ECFieldElement hash2FieldElement(ECCurve curve, byte[] hash)
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.

truncateback to summary
private static BigInteger truncate(BigInteger x, int bitLength)
verifySignatureback to summary
public boolean verifySignature(byte[] message, BigInteger r, BigInteger s)

Implements org.bouncycastle.crypto.DSA.verifySignature.

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

verify the message message against the signature values r and s.

Parameters
message:byte[]

the message that was supposed to have been signed.

r:BigInteger

the r signature value.

s:BigInteger

the s signature value.