1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
package org.kuali.rice.ksb.security.admin; |
17 | |
|
18 | |
import java.io.Serializable; |
19 | |
import java.security.KeyStore; |
20 | |
import java.util.Date; |
21 | |
import java.util.HashMap; |
22 | |
import java.util.Map; |
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class KeyStoreEntryDataContainer implements Serializable { |
31 | |
|
32 | |
private static final String DISPLAYABLE_ENTRY_TYPE_TRUSTED_CERTIFICATE = "Trusted Certificate"; |
33 | |
private static final String DISPLAYABLE_ENTRY_TYPE_PRIVATE_KEY = "Private Key"; |
34 | |
private static final String DISPLAYABLE_ENTRY_TYPE_SECRET_KEY = "Secret Key"; |
35 | |
|
36 | 0 | public static final Map<Class<? extends KeyStore.Entry>,String> DISPLAYABLE_ENTRY_TYPES = new HashMap<Class<? extends KeyStore.Entry>,String>(); |
37 | |
static { |
38 | 0 | DISPLAYABLE_ENTRY_TYPES.put(KeyStore.TrustedCertificateEntry.class, DISPLAYABLE_ENTRY_TYPE_TRUSTED_CERTIFICATE); |
39 | 0 | DISPLAYABLE_ENTRY_TYPES.put(KeyStore.PrivateKeyEntry.class, DISPLAYABLE_ENTRY_TYPE_PRIVATE_KEY); |
40 | 0 | DISPLAYABLE_ENTRY_TYPES.put(KeyStore.SecretKeyEntry.class, DISPLAYABLE_ENTRY_TYPE_SECRET_KEY); |
41 | 0 | } |
42 | |
|
43 | |
private String alias; |
44 | |
private Date createDate; |
45 | |
private Class<? extends KeyStore.Entry> type; |
46 | |
|
47 | |
public KeyStoreEntryDataContainer(String alias, Date createDate) { |
48 | 0 | super(); |
49 | 0 | this.alias = alias; |
50 | 0 | this.createDate = createDate; |
51 | 0 | } |
52 | |
|
53 | |
public boolean isAllowsRemoval() { |
54 | 0 | if (KeyStore.TrustedCertificateEntry.class.equals(type)) { |
55 | 0 | return true; |
56 | |
} |
57 | 0 | return false; |
58 | |
} |
59 | |
|
60 | |
public String getDisplayType() { |
61 | 0 | return DISPLAYABLE_ENTRY_TYPES.get(getType()); |
62 | |
} |
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
public String getAlias() { |
68 | 0 | return this.alias; |
69 | |
} |
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
public void setAlias(String alias) { |
75 | 0 | this.alias = alias; |
76 | 0 | } |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
public Date getCreateDate() { |
82 | 0 | return this.createDate; |
83 | |
} |
84 | |
|
85 | |
|
86 | |
|
87 | |
|
88 | |
public void setCreateDate(Date createDate) { |
89 | 0 | this.createDate = createDate; |
90 | 0 | } |
91 | |
|
92 | |
|
93 | |
|
94 | |
|
95 | |
public Class<? extends KeyStore.Entry> getType() { |
96 | 0 | return this.type; |
97 | |
} |
98 | |
|
99 | |
|
100 | |
|
101 | |
|
102 | |
public void setType(Class<? extends KeyStore.Entry> type) { |
103 | 0 | this.type = type; |
104 | 0 | } |
105 | |
|
106 | |
} |