View Javadoc

1   package es.caib.signatura.api;
2   
3   import java.io.IOException;
4   import java.io.InputStream;
5   /**
6    * Interface to access to a SMIME document parser.
7    * @author u91940
8    *
9    */
10  
11  public interface SMIMEParser {
12  	/**
13  	 * Returns a SMIME document parser.
14  	 * 
15  	 * @param smime SMIME document to parse.
16  	 * 
17  	 * @return the SMIME parser.
18  	 * 
19  	 * @throws InstantiationException
20  	 * @throws IllegalAccessException
21  	 * @throws IOException
22  	 * @throws SignatureException
23  	 */
24  	public SMIMEParser getInstance(InputStream smime) throws InstantiationException, IllegalAccessException, IOException, SignatureException ;
25  	
26  	/**
27  	 * This method parses an SMIME document.
28  	 * 
29  	 * @param mimeIS Document to parse.
30  	 * 
31  	 * @throws InstantiationException
32  	 * @throws IllegalAccessException
33  	 * @throws IOException
34  	 * @throws SignatureException
35  	 */
36  	public void parse(InputStream mimeIS) throws InstantiationException, IllegalAccessException, IOException, SignatureException ;
37  
38  	/**
39  	 * Returns the signed object that contains the SMIME document. 
40  	 * 
41  	 * @return The signed object (as a byte array).
42  	 */
43  	public Object getSignedObject();
44  	
45  	/**
46  	 * Gets an array that contains all the signatures of the SMIME document.
47  	 * 
48  	 * @return The signatures of the SMIME document.
49  	 */
50  	public Signature [] getSignatures();
51  
52  }