View Javadoc

1   package es.caib.signatura.api;
2   
3   import java.io.IOException;
4   import java.security.cert.X509Certificate;
5   
6   /** 
7    * Interface to access to the information contained into a digital certificate. It provides needed methods to get different attributes
8    * of the certificate.
9    * 
10   * @author Pau Carré Cardona
11   * @version 1.0
12   * @see Certificate
13   * 
14   */
15  public interface Certificate {
16  	
17  	/**
18  	 * Gets the name of the certification authority.
19  	 * 
20  	 * @return the name of the certificate authority.
21  	 */
22  	public String getCertCaName();
23  
24  	/**
25  	 * Gets the subject's Common Name of the certificate.
26  	 * 
27  	 * @return the subject common name.
28  	 */
29  	public String getCertSubjectCommonName();
30  
31  	/**
32  	 * Gets the concatenation of the subject's alternate name as follows: name0 = value, name1 = value, ...
33  	 * 
34  	 * @return a string containing the subject's alternate name of the certificate.
35  	 */
36  	public String getCertSubjectAlternativeNames();
37  
38  
39  	/**
40  	 * Returns the X509 Certificate.
41  	 * 
42  	 * @return the X509Certificate.
43  	 */  
44  	public X509Certificate getCert();
45  	  
46  	/**
47  	 * Gets a ParsedCertificate object with the subject's credentials.
48  	 * 
49  	 * @return a ParsedCertificate object with the subject's credentials.
50  	 */  
51  	public ParsedCertificate getParsedCertificate();
52  
53  	/**
54  	 * 
55  	 * Verify the certificate and its certification chain.
56  	 * 
57  	 * @return <code>true</code> if verification is successful <code>false</code> otherwise.
58  	 * 
59  	 * @throws IOException if unable to access to the file.
60  	 * @throws CertificateVerifyException if it hasn't been able to finish the verification process.
61  	 */
62  	public  boolean verify()
63      	throws IOException, CertificateVerifyException;
64  		
65  }