• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.bouncycastle.operator;
2 
3 import java.io.OutputStream;
4 
5 import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
6 
7 /**
8  * General interface for an operator that is able to create a signature from
9  * a stream of output.
10  */
11 public interface ContentSigner
12 {
13     /**
14      * Return the algorithm identifier describing the signature
15      * algorithm and parameters this signer generates.
16      *
17      * @return algorithm oid and parameters.
18      */
getAlgorithmIdentifier()19     AlgorithmIdentifier getAlgorithmIdentifier();
20 
21     /**
22      * Returns a stream that will accept data for the purpose of calculating
23      * a signature. Use org.bouncycastle.util.io.TeeOutputStream if you want to accumulate
24      * the data on the fly as well.
25      *
26      * @return an OutputStream
27      */
getOutputStream()28     OutputStream getOutputStream();
29 
30     /**
31      * Returns a signature based on the current data written to the stream, since the
32      * start or the last call to getSignature().
33      *
34      * @return bytes representing the signature.
35      */
getSignature()36     byte[] getSignature();
37 }
38