Package org.bouncycastle.tls
Class DefaultTlsCredentialedSigner
- java.lang.Object
-
- org.bouncycastle.tls.DefaultTlsCredentialedSigner
-
- All Implemented Interfaces:
TlsCredentialedSigner
,TlsCredentials
- Direct Known Subclasses:
BcDefaultTlsCredentialedSigner
,JcaDefaultTlsCredentialedSigner
public class DefaultTlsCredentialedSigner extends java.lang.Object implements TlsCredentialedSigner
Container class for generating signatures that carries the signature type, parameters, public key certificate and public key's associated signer object.
-
-
Field Summary
Fields Modifier and Type Field Description protected Certificate
certificate
protected TlsCryptoParameters
cryptoParams
protected SignatureAndHashAlgorithm
signatureAndHashAlgorithm
protected TlsSigner
signer
-
Constructor Summary
Constructors Constructor Description DefaultTlsCredentialedSigner(TlsCryptoParameters cryptoParams, TlsSigner signer, Certificate certificate, SignatureAndHashAlgorithm signatureAndHashAlgorithm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]
generateRawSignature(byte[] hash)
Generate a signature against the passed in hash.Certificate
getCertificate()
Return the certificate structure representing our identity.protected SignatureAndHashAlgorithm
getEffectiveAlgorithm()
SignatureAndHashAlgorithm
getSignatureAndHashAlgorithm()
Return the algorithm IDs for the signature algorithm and the associated hash it uses.TlsStreamSigner
getStreamSigner()
-
-
-
Field Detail
-
cryptoParams
protected TlsCryptoParameters cryptoParams
-
certificate
protected Certificate certificate
-
signatureAndHashAlgorithm
protected SignatureAndHashAlgorithm signatureAndHashAlgorithm
-
signer
protected TlsSigner signer
-
-
Constructor Detail
-
DefaultTlsCredentialedSigner
public DefaultTlsCredentialedSigner(TlsCryptoParameters cryptoParams, TlsSigner signer, Certificate certificate, SignatureAndHashAlgorithm signatureAndHashAlgorithm)
-
-
Method Detail
-
getCertificate
public Certificate getCertificate()
Description copied from interface:TlsCredentials
Return the certificate structure representing our identity.- Specified by:
getCertificate
in interfaceTlsCredentials
- Returns:
- our certificate structure.
-
generateRawSignature
public byte[] generateRawSignature(byte[] hash) throws java.io.IOException
Description copied from interface:TlsCredentialedSigner
Generate a signature against the passed in hash.- Specified by:
generateRawSignature
in interfaceTlsCredentialedSigner
- Parameters:
hash
- a message digest calculated across the message the signature is to apply to.- Returns:
- an encoded signature.
- Throws:
java.io.IOException
- if the hash cannot be processed, or there is an issue with the private credentials.
-
getSignatureAndHashAlgorithm
public SignatureAndHashAlgorithm getSignatureAndHashAlgorithm()
Description copied from interface:TlsCredentialedSigner
Return the algorithm IDs for the signature algorithm and the associated hash it uses.- Specified by:
getSignatureAndHashAlgorithm
in interfaceTlsCredentialedSigner
- Returns:
- the full algorithm details for the signature.
-
getStreamSigner
public TlsStreamSigner getStreamSigner() throws java.io.IOException
- Specified by:
getStreamSigner
in interfaceTlsCredentialedSigner
- Throws:
java.io.IOException
-
getEffectiveAlgorithm
protected SignatureAndHashAlgorithm getEffectiveAlgorithm()
-
-