Top Description Inners Fields Constructors Methods
org.bouncycastle.crypto.fips

public final Class FipsDSA

extends Object
Class Inheritance
Imports
java.math.BigInteger, java.security.AccessController, .PrivilegedAction, .SecureRandom, org.bouncycastle.crypto.AsymmetricPrivateKey, .AsymmetricPublicKey, .CryptoServicesRegistrar, org.bouncycastle.crypto.asymmetric.AsymmetricDSAPrivateKey, .AsymmetricDSAPublicKey, .AsymmetricKeyPair, .DSADomainParameters, .DSAValidationParameters, org.bouncycastle.crypto.internal.AsymmetricCipherKeyPair, .Digest, .EngineProvider, .Permissions, .PrimeCertaintyCalculator, org.bouncycastle.crypto.internal.params.DsaKeyGenerationParameters, .DsaParameterGenerationParameters, .DsaParameters, .DsaPrivateKeyParameters, .DsaPublicKeyParameters, .DsaValidationParameters, .ParametersWithRandom, org.bouncycastle.crypto.internal.test.ConsistencyTest, org.bouncycastle.math.internal.Primes, org.bouncycastle.util.Arrays, org.bouncycastle.util.encoders.Hex, org.bouncycastle.util.test.TestRandomBigInteger

Source class for FIPS approved implementations of DSA based algorithms.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
FipsDSA.DomainGenParameters

Parameters for DSA domain parameter generation.

public static class
FipsDSA.DomainParametersGenerator

Domain parameter generator for DSA.

public static class
FipsDSA.DomainParametersValidator

Domain parameter validator for DSA.

private static class
public static class
FipsDSA.KeyGenParameters

Parameters for DSA key pair generation.

public static class
FipsDSA.KeyPairGenerator

DSA key pair generator.

public static class
FipsDSA.OperatorFactory

Operator factory for creating DSA based signing and verification operators.

public static class
FipsDSA.Parameters

Parameters for DSA signatures.

Field Summary

Modifier and TypeField and Description
public static final FipsAlgorithm
ALGORITHM

DSA key marker, can be used for creating general purpose DSA keys.

public static final FipsDSA.Parameters
DSA

DSA algorithm parameter source - default is SHA-1

private static final EngineProvider<DsaSigner>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static DsaParameters
private static DsaPrivateKeyParameters
private static void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ALGORITHMback to summary
public static final FipsAlgorithm ALGORITHM

DSA key marker, can be used for creating general purpose DSA keys.

DSAback to summary
public static final FipsDSA.Parameters DSA

DSA algorithm parameter source - default is SHA-1

ENGINE_PROVIDERback to summary
private static final EngineProvider<DsaSigner> ENGINE_PROVIDER

Constructor Detail

FipsDSAback to summary
private FipsDSA()

Method Detail

getDomainParamsback to summary
private static DsaParameters getDomainParams(DSADomainParameters dsaParams)
getLwKeyback to summary
private static DsaPrivateKeyParameters getLwKey(final AsymmetricDSAPrivateKey privKey)
validateKeyPairback to summary
private static void validateKeyPair(AsymmetricCipherKeyPair kp)
org.bouncycastle.crypto.fips back to summary

public final Class FipsDSA.DomainGenParameters

extends FipsParameters
Class Inheritance

Parameters for DSA domain parameter generation.

Field Summary

Modifier and TypeField and Description
private final int
private final int
L

private final int
N

private final BigInteger
p

private final BigInteger
q

private final byte[]
private final int

Constructor Summary

AccessConstructor and Description
public
DomainGenParameters(int
desired length of prime P in bits (the effective key size).
strength
)

Construct just from strength (L) with a default value for N (160 for 1024, 256 for greater) and a default certainty.

public
DomainGenParameters(int
desired length of prime P in bits (the effective key size).
strength
,
int
certainty level for prime number generation.
certainty
)

Construct just from strength (L) with a default value for N (160 for 1024, 256 for greater).

public
DomainGenParameters(int
desired length of prime P in bits (the effective key size).
L
,
int
desired length of prime Q in bits.
N
,
int
certainty level for prime number generation.
certainty
)

Construct without a usage index, this will do a random construction of G.

public
DomainGenParameters(int
desired length of prime P in bits (the effective key size).
L
,
int
desired length of prime Q in bits.
N
,
int
certainty level for prime number generation.
certainty
,
int
a valid usage index.
usageIndex
)

Construct for a specific usage index - this has the effect of using verifiable canonical generation of G.

public
DomainGenParameters(BigInteger
the prime P.
p
,
BigInteger
the prime Q.
q
)

Construct from initial prime values, this will do a random construction of G.

public
DomainGenParameters(BigInteger
the prime P.
p
,
BigInteger
the prime Q.
q
,
byte[]
seed used in the generation of (p, q).
seed
,
int
a valid usage index.
usageIndex
)

Construct for a specific usage index and initial prime values - this has the effect of using verifiable canonical generation of G.

pack-priv
DomainGenParameters(int L, int N, int certainty, BigInteger p, BigInteger q, byte[] seed, int usageIndex)

Method Summary

Inherited from org.bouncycastle.crypto.fips.FipsParameters:
getAlgorithm

Field Detail

certaintyback to summary
private final int certainty
Lback to summary
private final int L
Nback to summary
private final int N
pback to summary
private final BigInteger p
qback to summary
private final BigInteger q
seedback to summary
private final byte[] seed
usageIndexback to summary
private final int usageIndex

Constructor Detail

DomainGenParametersback to summary
public DomainGenParameters(int strength)

Construct just from strength (L) with a default value for N (160 for 1024, 256 for greater) and a default certainty.

Parameters
strength:int

desired length of prime P in bits (the effective key size).

DomainGenParametersback to summary
public DomainGenParameters(int strength, int certainty)

Construct just from strength (L) with a default value for N (160 for 1024, 256 for greater).

Parameters
strength:int

desired length of prime P in bits (the effective key size).

certainty:int

certainty level for prime number generation.

DomainGenParametersback to summary
public DomainGenParameters(int L, int N, int certainty)

Construct without a usage index, this will do a random construction of G.

Parameters
L:int

desired length of prime P in bits (the effective key size).

N:int

desired length of prime Q in bits.

certainty:int

certainty level for prime number generation.

DomainGenParametersback to summary
public DomainGenParameters(int L, int N, int certainty, int usageIndex)

Construct for a specific usage index - this has the effect of using verifiable canonical generation of G.

Parameters
L:int

desired length of prime P in bits (the effective key size).

N:int

desired length of prime Q in bits.

certainty:int

certainty level for prime number generation.

usageIndex:int

a valid usage index.

DomainGenParametersback to summary
public DomainGenParameters(BigInteger p, BigInteger q)

Construct from initial prime values, this will do a random construction of G.

Parameters
p:BigInteger

the prime P.

q:BigInteger

the prime Q.

DomainGenParametersback to summary
public DomainGenParameters(BigInteger p, BigInteger q, byte[] seed, int usageIndex)

Construct for a specific usage index and initial prime values - this has the effect of using verifiable canonical generation of G.

Parameters
p:BigInteger

the prime P.

q:BigInteger

the prime Q.

seed:byte[]

seed used in the generation of (p, q).

usageIndex:int

a valid usage index.

DomainGenParametersback to summary
pack-priv DomainGenParameters(int L, int N, int certainty, BigInteger p, BigInteger q, byte[] seed, int usageIndex)
org.bouncycastle.crypto.fips back to summary

public final Class FipsDSA.DomainParametersGenerator

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.crypto.fips.FipsDSA.DomainParametersGenerator

Domain parameter generator for DSA.

Field Summary

Modifier and TypeField and Description
private final FipsDigestAlgorithm
private final FipsDSA.DomainGenParameters
private final SecureRandom

Constructor Summary

AccessConstructor and Description
public
DomainParametersGenerator(FipsDSA.DomainGenParameters
domain generation parameters.
parameters
,
SecureRandom
a source of randomness for the parameter generation.
random
)

Default constructor using SHA-256 as the digest.

public
DomainParametersGenerator(FipsDigestAlgorithm
digest to use in prime calculations.
digestAlgorithm
,
FipsDSA.DomainGenParameters
domain generation parameters.
parameters
,
SecureRandom
a source of randomness for the parameter generation.
random
)

Base constructor.

Method Summary

Modifier and TypeMethod and Description
public DSADomainParameters

Returns:

a new set of DSADomainParameters
generateDomainParameters
()

Generate a new set of DSA domain parameters.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digestAlgorithmback to summary
private final FipsDigestAlgorithm digestAlgorithm
parametersback to summary
private final FipsDSA.DomainGenParameters parameters
randomback to summary
private final SecureRandom random

Constructor Detail

DomainParametersGeneratorback to summary
public DomainParametersGenerator(FipsDSA.DomainGenParameters parameters, SecureRandom random)

Default constructor using SHA-256 as the digest.

Parameters
parameters:FipsDSA.DomainGenParameters

domain generation parameters.

random:SecureRandom

a source of randomness for the parameter generation.

DomainParametersGeneratorback to summary
public DomainParametersGenerator(FipsDigestAlgorithm digestAlgorithm, FipsDSA.DomainGenParameters parameters, SecureRandom random)

Base constructor.

Parameters
digestAlgorithm:FipsDigestAlgorithm

digest to use in prime calculations.

parameters:FipsDSA.DomainGenParameters

domain generation parameters.

random:SecureRandom

a source of randomness for the parameter generation.

Method Detail

generateDomainParametersback to summary
public DSADomainParameters generateDomainParameters()

Generate a new set of DSA domain parameters.

Returns:DSADomainParameters

a new set of DSADomainParameters

org.bouncycastle.crypto.fips back to summary

public final Class FipsDSA.DomainParametersValidator

extends Object
Class Inheritance
  • java.lang.Object
  • org.bouncycastle.crypto.fips.FipsDSA.DomainParametersValidator

Domain parameter validator for DSA.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum

Field Summary

Modifier and TypeField and Description
private final FipsDigestAlgorithm
private final SecureRandom
private final FipsDSA.DomainParametersValidator.Version

Constructor Summary

AccessConstructor and Description
public
DomainParametersValidator(FipsDigestAlgorithm
digest to use in prime calculations.
digestAlgorithm
,
SecureRandom
source of randomness for prime number testing.
random
)

Base constructor - for 186-4

public
DomainParametersValidator(FipsDSA.DomainParametersValidator.Version
the version of DSS the validator is for.
version
,
FipsDigestAlgorithm
digest to use in prime calculations.
digestAlgorithm
,
SecureRandom
source of randomness for prime number testing.
random
)

Base constructor.

Method Summary

Modifier and TypeMethod and Description
private BigInteger
digest(Digest hash, byte[] input)

private static int
private byte[]
inc(byte[] value)

public boolean

Returns:

true if the generator is partially valid, false otherwise.
isPartiallyValidG
(BigInteger
the prime P.
p
,
BigInteger
the prime Q.
q
,
BigInteger
the generator G associated with P and Q.
g
)

Do a partial validation of g against p and q.

private boolean
isProbablePrime(BigInteger x, int iterations)

public boolean

Returns:

true if the generator is partially valid, false otherwise.
isValidG
(BigInteger
the prime P.
p
,
BigInteger
the prime Q.
q
,
byte[]
the domain parameter seed used to generate p and q.
seed
,
int
the 8 bit usage index for G.
index
,
BigInteger
the generator G associated with P and Q.
g
)

Do a full validation of g against p and q by including the seed and index associated with g's related parameters.

public boolean

Returns:

true if the P and Q values are the expected ones, false otherwise.
isValidPAndQ
(BigInteger
the prime P.
p
,
BigInteger
the prime Q.
q
,
byte[]
the seed P and Q were derived from.
seed
,
int
the number of iterations required to derive P.
counter
)

Validate P and Q against the passed in seed and counter.

private byte[]
seedPlus1(byte[] seed)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

digestAlgorithmback to summary
private final FipsDigestAlgorithm digestAlgorithm
randomback to summary
private final SecureRandom random
versionback to summary
private final FipsDSA.DomainParametersValidator.Version version

Constructor Detail

DomainParametersValidatorback to summary
public DomainParametersValidator(FipsDigestAlgorithm digestAlgorithm, SecureRandom random)

Base constructor - for 186-4

Parameters
digestAlgorithm:FipsDigestAlgorithm

digest to use in prime calculations.

random:SecureRandom

source of randomness for prime number testing.

DomainParametersValidatorback to summary
public DomainParametersValidator(FipsDSA.DomainParametersValidator.Version version, FipsDigestAlgorithm digestAlgorithm, SecureRandom random)

Base constructor.

Parameters
version:FipsDSA.DomainParametersValidator.Version

the version of DSS the validator is for.

digestAlgorithm:FipsDigestAlgorithm

digest to use in prime calculations.

random:SecureRandom

source of randomness for prime number testing.

Method Detail

digestback to summary
private BigInteger digest(Digest hash, byte[] input)
getMinimumIterationsback to summary
private static int getMinimumIterations(int L)
incback to summary
private byte[] inc(byte[] value)
isPartiallyValidGback to summary
public boolean isPartiallyValidG(BigInteger p, BigInteger q, BigInteger g)

Do a partial validation of g against p and q.

Parameters
p:BigInteger

the prime P.

q:BigInteger

the prime Q.

g:BigInteger

the generator G associated with P and Q.

Returns:boolean

true if the generator is partially valid, false otherwise.

isProbablePrimeback to summary
private boolean isProbablePrime(BigInteger x, int iterations)
isValidGback to summary
public boolean isValidG(BigInteger p, BigInteger q, byte[] seed, int index, BigInteger g)

Do a full validation of g against p and q by including the seed and index associated with g's related parameters.

Parameters
p:BigInteger

the prime P.

q:BigInteger

the prime Q.

seed:byte[]

the domain parameter seed used to generate p and q.

index:int

the 8 bit usage index for G.

g:BigInteger

the generator G associated with P and Q.

Returns:boolean

true if the generator is partially valid, false otherwise.

isValidPAndQback to summary
public boolean isValidPAndQ(BigInteger p, BigInteger q, byte[] seed, int counter)

Validate P and Q against the passed in seed and counter.

Parameters
p:BigInteger

the prime P.

q:BigInteger

the prime Q.

seed:byte[]

the seed P and Q were derived from.

counter:int

the number of iterations required to derive P.

Returns:boolean

true if the P and Q values are the expected ones, false otherwise.

seedPlus1back to summary
private byte[] seedPlus1(byte[] seed)
org.bouncycastle.crypto.fips back to summary

public final Enum FipsDSA.DomainParametersValidator.Version

extends Enum<FipsDSA.DomainParametersValidator.Version>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final FipsDSA.DomainParametersValidator.Version
public static final FipsDSA.DomainParametersValidator.Version

Constructor Summary

AccessConstructor and Description
private

Field Detail

FIPS_PUB_186_2back to summary
public static final FipsDSA.DomainParametersValidator.Version FIPS_PUB_186_2
FIPS_PUB_186_4back to summary
public static final FipsDSA.DomainParametersValidator.Version FIPS_PUB_186_4

Constructor Detail

Versionback to summary
private Version()

Method Detail

valueOfback to summary
public static FipsDSA.DomainParametersValidator.Version valueOf(String name)
valuesback to summary
public static FipsDSA.DomainParametersValidator.Version[] values()
org.bouncycastle.crypto.fips back to summary

private Class FipsDSA.DsaProvider

extends FipsEngineProvider<DsaSigner>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public DsaSigner

Constructor Detail

DsaProviderback to summary
private DsaProvider()

Method Detail

createEngineback to summary
public DsaSigner createEngine()

Implements org.bouncycastle.crypto.internal.EngineProvider.createEngine.

org.bouncycastle.crypto.fips back to summary

public final Class FipsDSA.KeyGenParameters

extends FipsParameters
Class Inheritance

Parameters for DSA key pair generation.

Field Summary

Modifier and TypeField and Description
private final DSADomainParameters

Constructor Summary

AccessConstructor and Description
public
KeyGenParameters(DSADomainParameters
DSA domain parameters representing the parameter set any generated keys will be for.
domainParameters
)

Base constructor for the default algorithm ID.

Method Summary

Modifier and TypeMethod and Description
public DSADomainParameters

Returns:

the DSA domain parameter set.
getDomainParameters
()

Return the DSA domain parameters for this object.

Inherited from org.bouncycastle.crypto.fips.FipsParameters:
getAlgorithm

Field Detail

domainParametersback to summary
private final DSADomainParameters domainParameters

Constructor Detail

KeyGenParametersback to summary
public KeyGenParameters(DSADomainParameters domainParameters)

Base constructor for the default algorithm ID.

Parameters
domainParameters:DSADomainParameters

DSA domain parameters representing the parameter set any generated keys will be for.

Method Detail

getDomainParametersback to summary
public DSADomainParameters getDomainParameters()

Return the DSA domain parameters for this object.

Returns:DSADomainParameters

the DSA domain parameter set.

org.bouncycastle.crypto.fips back to summary

public final Class FipsDSA.KeyPairGenerator

extends FipsAsymmetricKeyPairGenerator<FipsDSA.KeyGenParameters, AsymmetricDSAPublicKey, AsymmetricDSAPrivateKey>
Class Inheritance

DSA key pair generator.

Field Summary

Modifier and TypeField and Description
private final DSADomainParameters
private final DsaKeyPairGenerator
private final DsaKeyGenerationParameters

Constructor Summary

AccessConstructor and Description
public
KeyPairGenerator(FipsDSA.KeyGenParameters
domain parameters and algorithm for the generated key.
keyGenParameters
,
SecureRandom
a source of randomness for calculating the private value.
random
)

Construct a key pair generator for DSA keys,

Method Summary

Modifier and TypeMethod and Description
public AsymmetricKeyPair<AsymmetricDSAPublicKey, AsymmetricDSAPrivateKey>

Returns:

a new AsymmetricKeyPair containing a DSA key pair.
generateKeyPair
()

Implements abstract org.bouncycastle.crypto.fips.FipsAsymmetricKeyPairGenerator.generateKeyPair.

Implements org.bouncycastle.crypto.AsymmetricKeyPairGenerator.generateKeyPair.

Generate a new DSA key pair.
Inherited from org.bouncycastle.crypto.fips.FipsAsymmetricKeyPairGenerator:
getParameters

Field Detail

domainParametersback to summary
private final DSADomainParameters domainParameters
engineback to summary
private final DsaKeyPairGenerator engine
paramback to summary
private final DsaKeyGenerationParameters param

Constructor Detail

KeyPairGeneratorback to summary
public KeyPairGenerator(FipsDSA.KeyGenParameters keyGenParameters, SecureRandom random)

Construct a key pair generator for DSA keys,

Parameters
keyGenParameters:FipsDSA.KeyGenParameters

domain parameters and algorithm for the generated key.

random:SecureRandom

a source of randomness for calculating the private value.

Method Detail

generateKeyPairback to summary
public AsymmetricKeyPair<AsymmetricDSAPublicKey, AsymmetricDSAPrivateKey> generateKeyPair()

Implements abstract org.bouncycastle.crypto.fips.FipsAsymmetricKeyPairGenerator.generateKeyPair.

Implements org.bouncycastle.crypto.AsymmetricKeyPairGenerator.generateKeyPair.

Generate a new DSA key pair.

Returns:AsymmetricKeyPair<AsymmetricDSAPublicKey, AsymmetricDSAPrivateKey>

a new AsymmetricKeyPair containing a DSA key pair.

Annotations
@Override
org.bouncycastle.crypto.fips back to summary

public final Class FipsDSA.OperatorFactory

extends FipsSignatureOperatorFactory<FipsDSA.Parameters>
Class Inheritance

Operator factory for creating DSA based signing and verification operators.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public FipsOutputSignerUsingSecureRandom<FipsDSA.Parameters>

Returns:

an OutputSignerUsingSecureRandom.
createSigner
(AsymmetricPrivateKey
the key to initialize the signature generator with.
key
,
final FipsDSA.Parameters
parameters required to configure the generation.
parameters
)

Implements abstract org.bouncycastle.crypto.fips.FipsSignatureOperatorFactory.createSigner.

Implements org.bouncycastle.crypto.SignatureOperatorFactory.createSigner.

Return a generator of DSA signatures.
public FipsOutputVerifier<FipsDSA.Parameters>

Returns:

an OutputVerifier.
createVerifier
(AsymmetricPublicKey
the key to initialize the verifier with.
key
,
final FipsDSA.Parameters
parameters required to configure the verification.
parameters
)

Implements abstract org.bouncycastle.crypto.fips.FipsSignatureOperatorFactory.createVerifier.

Implements org.bouncycastle.crypto.SignatureOperatorFactory.createVerifier.

Create a verifier for DSA signatures.

Constructor Detail

OperatorFactoryback to summary
public OperatorFactory()

Method Detail

createSignerback to summary
public FipsOutputSignerUsingSecureRandom<FipsDSA.Parameters> createSigner(AsymmetricPrivateKey key, final FipsDSA.Parameters parameters)

Implements abstract org.bouncycastle.crypto.fips.FipsSignatureOperatorFactory.createSigner.

Implements org.bouncycastle.crypto.SignatureOperatorFactory.createSigner.

Return a generator of DSA signatures. Note this operator needs to be associated with a SecureRandom to be fully initialised.

Parameters
key:AsymmetricPrivateKey

the key to initialize the signature generator with.

parameters:FipsDSA.Parameters

parameters required to configure the generation.

Returns:FipsOutputSignerUsingSecureRandom<FipsDSA.Parameters>

an OutputSignerUsingSecureRandom.

Annotations
@Override
createVerifierback to summary
public FipsOutputVerifier<FipsDSA.Parameters> createVerifier(AsymmetricPublicKey key, final FipsDSA.Parameters parameters)

Implements abstract org.bouncycastle.crypto.fips.FipsSignatureOperatorFactory.createVerifier.

Implements org.bouncycastle.crypto.SignatureOperatorFactory.createVerifier.

Create a verifier for DSA signatures.

Parameters
key:AsymmetricPublicKey

the key to initialize the verifier with.

parameters:FipsDSA.Parameters

parameters required to configure the verification.

Returns:FipsOutputVerifier<FipsDSA.Parameters>

an OutputVerifier.

Annotations
@Override
org.bouncycastle.crypto.fips back to summary

public final Class FipsDSA.Parameters

extends FipsParameters
Class Inheritance

Parameters for DSA signatures.

Field Summary

Modifier and TypeField and Description
private final FipsDigestAlgorithm

Constructor Summary

AccessConstructor and Description
pack-priv
private

Method Summary

Modifier and TypeMethod and Description
public FipsDigestAlgorithm

Returns:

the digest algorithm
getDigestAlgorithm
()

Return the algorithm for the underlying digest these parameters will use.

public FipsDSA.Parameters

Returns:

a new parameter for signature generation.
withDigestAlgorithm
(FipsDigestAlgorithm
the digest to use for signature generation.
digestAlgorithm
)

Return a new parameter set with for the passed in digest algorithm.

Inherited from org.bouncycastle.crypto.fips.FipsParameters:
getAlgorithm

Field Detail

digestAlgorithmback to summary
private final FipsDigestAlgorithm digestAlgorithm

Constructor Detail

Parametersback to summary
pack-priv Parameters()
Parametersback to summary
private Parameters(FipsDigestAlgorithm digestAlgorithm)

Method Detail

getDigestAlgorithmback to summary
public FipsDigestAlgorithm getDigestAlgorithm()

Return the algorithm for the underlying digest these parameters will use.

Returns:FipsDigestAlgorithm

the digest algorithm

withDigestAlgorithmback to summary
public FipsDSA.Parameters withDigestAlgorithm(FipsDigestAlgorithm digestAlgorithm)

Return a new parameter set with for the passed in digest algorithm.

Parameters
digestAlgorithm:FipsDigestAlgorithm

the digest to use for signature generation.

Returns:FipsDSA.Parameters

a new parameter for signature generation.