org.bouncycastle.tls.crypto.impl.bc.BcTlsStreamSigner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bctls-debug-jdk15to18 Show documentation
Show all versions of bctls-debug-jdk15to18 Show documentation
The Bouncy Castle Java APIs for TLS and DTLS, including a provider for the JSSE.
The newest version!
package org.bouncycastle.tls.crypto.impl.bc;
import java.io.IOException;
import java.io.OutputStream;
import org.bouncycastle.crypto.CryptoException;
import org.bouncycastle.crypto.Signer;
import org.bouncycastle.crypto.io.SignerOutputStream;
import org.bouncycastle.tls.AlertDescription;
import org.bouncycastle.tls.TlsFatalAlert;
import org.bouncycastle.tls.crypto.TlsStreamSigner;
class BcTlsStreamSigner
implements TlsStreamSigner
{
private final SignerOutputStream output;
BcTlsStreamSigner(Signer signer)
{
this.output = new SignerOutputStream(signer);
}
public OutputStream getOutputStream() throws IOException
{
return output;
}
public byte[] getSignature() throws IOException
{
try
{
return output.getSigner().generateSignature();
}
catch (CryptoException e)
{
throw new TlsFatalAlert(AlertDescription.internal_error, e);
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy