1 package es.caib.signatura.api;
2
3 import java.util.Date;
4
5 /**
6 * Interface to access to the certificate information. It abstracts subject's information encoding.
7 */
8 public interface ParsedCertificate {
9
10 /**
11 * Gets the NIF/CIF of the certificate holder.
12 * In case of legal persons, it gets the CIF of the legal person.
13 *
14 * @return the subject NIF.
15 */
16 public abstract String getNif();
17
18 /**
19 * Gets the subject's common name of the certificate.
20 *
21 * @return the subject's common name.
22 */
23 public abstract String getName();
24
25 /**
26 * Gets the NIF of the responsible person for the certificate. Only applies if it's a legal person's certificate.
27 *
28 * @return the responsible person's NIF
29 */
30 public abstract String getNifResponsable();
31
32 /**
33 * Gets the date when the certificate starts being valid.
34 *
35 * @return the date when the certificate starts being valid.
36 */
37 public abstract Date getValidSince();
38
39 /**
40 * Gets the date when the certificate stops being valid.
41 *
42 * @return the date when the certificate stops being valid.
43 */
44 public abstract Date getValidUntil();
45
46 /**
47 * Determines if it is a natural person's certificate.
48 *
49 * @return true if it is a natural person's certificate; false otherwise.
50 */
51 public abstract boolean isPersonaFisica();
52
53 /**
54 * Determines if it is a legal person's certificate (not natural person's certificate).
55 *
56 * @return true if it is a legal person's certificate; false otherwise.
57 */
58 public abstract boolean isPersonaJuridica();
59
60 /**
61 *
62 * @return Certificate Common Name (TEST: Certificate Common Name if we are in dev/test mode
63 * and the certificate is a not recognized one.
64 */
65 public String getCommonName();
66
67 }