Class JcaTlsDSSSigner
- java.lang.Object
-
- org.bouncycastle.tls.crypto.impl.jcajce.JcaTlsDSSSigner
-
- All Implemented Interfaces:
TlsSigner
- Direct Known Subclasses:
JcaTlsDSASigner
,JcaTlsECDSASigner
public abstract class JcaTlsDSSSigner extends java.lang.Object implements TlsSigner
JCA base class for the signers implementing the two DSA style algorithms from FIPS PUB 186-4: DSA and ECDSA.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
algorithmName
protected short
algorithmType
protected JcaTlsCrypto
crypto
protected java.security.PrivateKey
privateKey
-
Constructor Summary
Constructors Modifier Constructor Description protected
JcaTlsDSSSigner(JcaTlsCrypto crypto, java.security.PrivateKey privateKey, short algorithmType, java.lang.String algorithmName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
generateRawSignature(SignatureAndHashAlgorithm algorithm, byte[] hash)
Generate an encoded signature based on the passed in hash,TlsStreamSigner
getStreamSigner(SignatureAndHashAlgorithm algorithm)
-
-
-
Field Detail
-
crypto
protected final JcaTlsCrypto crypto
-
privateKey
protected final java.security.PrivateKey privateKey
-
algorithmType
protected final short algorithmType
-
algorithmName
protected final java.lang.String algorithmName
-
-
Constructor Detail
-
JcaTlsDSSSigner
protected JcaTlsDSSSigner(JcaTlsCrypto crypto, java.security.PrivateKey privateKey, short algorithmType, java.lang.String algorithmName)
-
-
Method Detail
-
generateRawSignature
public byte[] generateRawSignature(SignatureAndHashAlgorithm algorithm, byte[] hash) throws java.io.IOException
Description copied from interface:TlsSigner
Generate an encoded signature based on the passed in hash,- Specified by:
generateRawSignature
in interfaceTlsSigner
- Parameters:
algorithm
- the signature algorithm to use.hash
- the hash calculated for the signature.- Returns:
- an encoded signature.
- Throws:
java.io.IOException
- in case of an exception processing the hash.
-
getStreamSigner
public TlsStreamSigner getStreamSigner(SignatureAndHashAlgorithm algorithm) throws java.io.IOException
- Specified by:
getStreamSigner
in interfaceTlsSigner
- Throws:
java.io.IOException
-
-