View Javadoc
1   /*
2    * Licensed under the GPL License. You may not use this file except in compliance with the License.
3    * You may obtain a copy of the License at
4    *
5    *   https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
6    *
7    * THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
8    * WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
9    * PURPOSE.
10   */
11  package psiprobe.model.certificates;
12  
13  import java.io.Serializable;
14  import java.time.Instant;
15  import java.util.Date;
16  
17  /**
18   * The Class Cert.
19   */
20  public class Cert implements Serializable {
21  
22    /** The Constant serialVersionUID. */
23    private static final long serialVersionUID = -727528588030989042L;
24  
25    /** The alias. */
26    private String alias;
27  
28    /** The subject distinguished name. */
29    private String subjectDistinguishedName;
30  
31    /** The issuer distinguished name. */
32    private String issuerDistinguishedName;
33  
34    /** The not before. */
35    private Instant notBefore;
36  
37    /** The not after. */
38    private Instant notAfter;
39  
40    /**
41     * Gets the subject distinguished name.
42     *
43     * @return the subject distinguished name
44     */
45    public String getSubjectDistinguishedName() {
46      return subjectDistinguishedName;
47    }
48  
49    /**
50     * Sets the subject distinguished name.
51     *
52     * @param distinguishedName the new subject distinguished name
53     */
54    public void setSubjectDistinguishedName(String distinguishedName) {
55      this.subjectDistinguishedName = distinguishedName;
56    }
57  
58    /**
59     * Gets the not before.
60     *
61     * @return the not before
62     */
63    public Date getNotBefore() {
64      return notBefore == null ? null : Date.from(notBefore);
65    }
66  
67    /**
68     * Sets the not before.
69     *
70     * @param notBefore the new not before
71     */
72    public void setNotBefore(Instant notBefore) {
73      this.notBefore = notBefore;
74    }
75  
76    /**
77     * Gets the not after.
78     *
79     * @return the not after
80     */
81    public Date getNotAfter() {
82      return notAfter == null ? null : Date.from(notAfter);
83    }
84  
85    /**
86     * Sets the not after.
87     *
88     * @param notAfter the new not after
89     */
90    public void setNotAfter(Instant notAfter) {
91      this.notAfter = notAfter;
92    }
93  
94    /**
95     * Gets the issuer distinguished name.
96     *
97     * @return the issuer distinguished name
98     */
99    public String getIssuerDistinguishedName() {
100     return issuerDistinguishedName;
101   }
102 
103   /**
104    * Sets the issuer distinguished name.
105    *
106    * @param issuerDistinguishedName the new issuer distinguished name
107    */
108   public void setIssuerDistinguishedName(String issuerDistinguishedName) {
109     this.issuerDistinguishedName = issuerDistinguishedName;
110   }
111 
112   /**
113    * Gets the alias.
114    *
115    * @return the alias
116    */
117   public String getAlias() {
118     return alias;
119   }
120 
121   /**
122    * Sets the alias.
123    *
124    * @param alias the new alias
125    */
126   public void setAlias(String alias) {
127     this.alias = alias;
128   }
129 
130 }