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 Certificatecertificateprotected TlsCryptoParameterscryptoParamsprotected SignatureAndHashAlgorithmsignatureAndHashAlgorithmprotected TlsSignersigner
-
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.CertificategetCertificate()Return the certificate structure representing our identity.protected SignatureAndHashAlgorithmgetEffectiveAlgorithm()SignatureAndHashAlgorithmgetSignatureAndHashAlgorithm()Return the algorithm IDs for the signature algorithm and the associated hash it uses.TlsStreamSignergetStreamSigner()
-
-
-
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:TlsCredentialsReturn the certificate structure representing our identity.- Specified by:
getCertificatein interfaceTlsCredentials- Returns:
- our certificate structure.
-
generateRawSignature
public byte[] generateRawSignature(byte[] hash) throws java.io.IOExceptionDescription copied from interface:TlsCredentialedSignerGenerate a signature against the passed in hash.- Specified by:
generateRawSignaturein 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:TlsCredentialedSignerReturn the algorithm IDs for the signature algorithm and the associated hash it uses.- Specified by:
getSignatureAndHashAlgorithmin interfaceTlsCredentialedSigner- Returns:
- the full algorithm details for the signature.
-
getStreamSigner
public TlsStreamSigner getStreamSigner() throws java.io.IOException
- Specified by:
getStreamSignerin interfaceTlsCredentialedSigner- Throws:
java.io.IOException
-
getEffectiveAlgorithm
protected SignatureAndHashAlgorithm getEffectiveAlgorithm()
-
-