Bouncy Castle Cryptography Library 1.81

org.bouncycastle.operator
Class BufferingContentSigner

java.lang.Object
  extended byorg.bouncycastle.operator.BufferingContentSigner
All Implemented Interfaces:
ContentSigner, ExtendedContentSigner

public class BufferingContentSigner
extends java.lang.Object
implements ExtendedContentSigner

A class that explicitly buffers the data to be signed, sending it in one block when ready for signing.


Constructor Summary
BufferingContentSigner(ContentSigner contentSigner)
          Base constructor.
BufferingContentSigner(ContentSigner contentSigner, int bufferSize)
          Base constructor.
 
Method Summary
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier()
          Return the algorithm identifier supported by this signer.
 org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithmIdentifier()
          Return the algorithm identifier describing the digest algorithm used by this signature algorithm, if known.
 java.io.OutputStream getOutputStream()
          Return the buffering stream.
 byte[] getSignature()
          Generate signature from internally buffered data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BufferingContentSigner

public BufferingContentSigner(ContentSigner contentSigner)
Base constructor.

Parameters:
contentSigner - the content signer to be wrapped.

BufferingContentSigner

public BufferingContentSigner(ContentSigner contentSigner,
                              int bufferSize)
Base constructor.

Parameters:
contentSigner - the content signer to be wrapped.
bufferSize - the size of the internal buffer to use.
Method Detail

getAlgorithmIdentifier

public org.bouncycastle.asn1.x509.AlgorithmIdentifier getAlgorithmIdentifier()
Return the algorithm identifier supported by this signer.

Specified by:
getAlgorithmIdentifier in interface ContentSigner
Returns:
algorithm identifier for the signature generated.

getOutputStream

public java.io.OutputStream getOutputStream()
Return the buffering stream.

Specified by:
getOutputStream in interface ContentSigner
Returns:
the output stream used to accumulate the data.

getSignature

public byte[] getSignature()
Generate signature from internally buffered data.

Specified by:
getSignature in interface ContentSigner
Returns:
the signature calculated from the bytes written to the buffering stream.

getDigestAlgorithmIdentifier

public org.bouncycastle.asn1.x509.AlgorithmIdentifier getDigestAlgorithmIdentifier()
Return the algorithm identifier describing the digest algorithm used by this signature algorithm, if known.

Specified by:
getDigestAlgorithmIdentifier in interface ExtendedContentSigner
Returns:
algorithm oid and parameters, null otherwise.

Bouncy Castle Cryptography Library 1.81