KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > keyrecovery > KeyRecoveryData


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13
14 package org.ejbca.core.model.keyrecovery;
15
16
17 import java.math.BigInteger JavaDoc;
18 import java.security.cert.Certificate JavaDoc;
19 import java.security.KeyPair JavaDoc;
20
21 import org.ejbca.util.StringTools;
22
23
24 /**
25  * This is a value class containing the data relating to key saved for recovery for a user, sent
26  * between server and clients.
27  *
28  * @author TomSelleck
29  * @version $Id: KeyRecoveryData.java,v 1.1 2006/01/17 20:31:52 anatom Exp $
30  */

31 public class KeyRecoveryData implements java.io.Serializable JavaDoc {
32
33     // Public Constructors
34
public KeyRecoveryData(BigInteger JavaDoc certificatesn, String JavaDoc issuerdn, String JavaDoc username,
35                            boolean markedasrecoverable, KeyPair JavaDoc keypair, Certificate JavaDoc certificate) {
36         this.certificatesn = certificatesn;
37         this.issuerdn = issuerdn;
38         this.username = StringTools.strip(username);
39         this.markedasrecoverable = markedasrecoverable;
40         this.keypair = keypair;
41         this.certificate = certificate;
42     }
43
44     /**
45      * Creates a new KeyRecoveryData object.
46      */

47     public KeyRecoveryData() {
48     }
49
50     // Public Methods
51
public BigInteger JavaDoc getCertificateSN() {
52         return this.certificatesn;
53     }
54
55     /**
56      * DOCUMENT ME!
57      *
58      * @param certificatesn DOCUMENT ME!
59      */

60     public void setCertificateSN(BigInteger JavaDoc certificatesn) {
61         this.certificatesn = certificatesn;
62     }
63
64     /**
65      * DOCUMENT ME!
66      *
67      * @return DOCUMENT ME!
68      */

69     public String JavaDoc getIssuerDN() {
70         return this.issuerdn;
71     }
72
73     /**
74      * DOCUMENT ME!
75      *
76      * @param issuerdn DOCUMENT ME!
77      */

78     public void setIssuerDN(String JavaDoc issuerdn) {
79         this.issuerdn = issuerdn;
80     }
81
82     /**
83      * DOCUMENT ME!
84      *
85      * @return DOCUMENT ME!
86      */

87     public String JavaDoc getUsername() {
88         return this.username;
89     }
90
91     /**
92      * DOCUMENT ME!
93      *
94      * @param username DOCUMENT ME!
95      */

96     public void setUsername(String JavaDoc username) {
97         this.username = StringTools.strip(username);
98     }
99
100     /**
101      * DOCUMENT ME!
102      *
103      * @return DOCUMENT ME!
104      */

105     public boolean getMarkedAsRecoverable() {
106         return this.markedasrecoverable;
107     }
108
109     /**
110      * DOCUMENT ME!
111      *
112      * @param markedasrecoverable DOCUMENT ME!
113      */

114     public void setMarkedAsRecoverable(boolean markedasrecoverable) {
115         this.markedasrecoverable = markedasrecoverable;
116     }
117
118     /**
119      * DOCUMENT ME!
120      *
121      * @return DOCUMENT ME!
122      */

123     public KeyPair JavaDoc getKeyPair() {
124         return this.keypair;
125     }
126
127     /**
128      * DOCUMENT ME!
129      *
130      * @param keypair DOCUMENT ME!
131      */

132     public void setKeyPair(KeyPair JavaDoc keypair) {
133         this.keypair = keypair;
134     }
135
136     /**
137      * @return Returns the certificate.
138      */

139     public Certificate JavaDoc getCertificate() {
140         return certificate;
141     }
142     /**
143      * @param certificate The certificate to set.
144      */

145     public void setCertificate(Certificate JavaDoc certificate) {
146         this.certificate = certificate;
147     }
148     
149     // Private fields
150
private BigInteger JavaDoc certificatesn;
151     private String JavaDoc issuerdn;
152     private String JavaDoc username;
153     private boolean markedasrecoverable;
154     private KeyPair JavaDoc keypair;
155     private Certificate JavaDoc certificate;
156
157
158 }
159
Popular Tags