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