1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
package org.xwiki.crypto.script; |
21 |
|
|
22 |
|
import org.xwiki.crypto.pkix.params.CertifiedKeyPair; |
23 |
|
import org.xwiki.crypto.pkix.params.CertifiedPublicKey; |
24 |
|
import org.xwiki.crypto.script.internal.AbstractScriptingStore; |
25 |
|
import org.xwiki.crypto.store.KeyStore; |
26 |
|
import org.xwiki.crypto.store.KeyStoreException; |
27 |
|
import org.xwiki.crypto.store.StoreReference; |
28 |
|
import org.xwiki.security.authorization.AccessDeniedException; |
29 |
|
import org.xwiki.security.authorization.ContextualAuthorizationManager; |
30 |
|
import org.xwiki.security.authorization.Right; |
31 |
|
import org.xwiki.stability.Unstable; |
32 |
|
|
33 |
|
|
34 |
|
@link |
35 |
|
|
36 |
|
@version |
37 |
|
@since |
38 |
|
|
39 |
|
@Unstable |
|
|
| 0% |
Uncovered Elements: 21 (21) |
Complexity: 7 |
Complexity Density: 0.5 |
|
40 |
|
public class ScriptingKeyStore extends AbstractScriptingStore |
41 |
|
{ |
42 |
|
private KeyStore store; |
43 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
44 |
0 |
ScriptingKeyStore(KeyStore store, StoreReference reference,... |
45 |
|
ContextualAuthorizationManager contextualAuthorizationManager) |
46 |
|
{ |
47 |
0 |
super(reference, contextualAuthorizationManager); |
48 |
0 |
this.store = store; |
49 |
|
} |
50 |
|
|
51 |
|
|
52 |
|
|
53 |
|
|
54 |
|
|
55 |
|
|
56 |
|
@param |
57 |
|
@throws |
58 |
|
@throws |
59 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
60 |
0 |
public void store(CertifiedKeyPair keyPair) throws KeyStoreException, AccessDeniedException... |
61 |
|
{ |
62 |
0 |
checkAccess(Right.EDIT); |
63 |
0 |
store.store(storeReference, keyPair); |
64 |
|
} |
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
@param |
70 |
|
@param |
71 |
|
@throws |
72 |
|
@throws |
73 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
74 |
0 |
public void store(CertifiedKeyPair keyPair, String password) throws KeyStoreException, AccessDeniedException... |
75 |
|
{ |
76 |
0 |
checkAccess(Right.EDIT); |
77 |
0 |
store.store(storeReference, keyPair, password.getBytes(UTF8)); |
78 |
|
} |
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
@return |
84 |
|
@throws |
85 |
|
@throws |
86 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
87 |
0 |
public CertifiedKeyPair retrieve() throws KeyStoreException, AccessDeniedException... |
88 |
|
{ |
89 |
0 |
checkAccess(Right.VIEW); |
90 |
0 |
return store.retrieve(storeReference); |
91 |
|
} |
92 |
|
|
93 |
|
|
94 |
|
|
95 |
|
|
96 |
|
|
97 |
|
@param |
98 |
|
@return |
99 |
|
@throws |
100 |
|
@throws |
101 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
102 |
0 |
public CertifiedKeyPair retrieve(String password) throws KeyStoreException, AccessDeniedException... |
103 |
|
{ |
104 |
0 |
checkAccess(Right.VIEW); |
105 |
0 |
return store.retrieve(storeReference, password.getBytes(UTF8)); |
106 |
|
} |
107 |
|
|
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
@param |
112 |
|
@return |
113 |
|
@throws |
114 |
|
@throws |
115 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
116 |
0 |
public CertifiedKeyPair retrieve(CertifiedPublicKey publicKey) throws KeyStoreException, AccessDeniedException... |
117 |
|
{ |
118 |
0 |
checkAccess(Right.VIEW); |
119 |
0 |
return store.retrieve(storeReference, publicKey); |
120 |
|
} |
121 |
|
|
122 |
|
|
123 |
|
|
124 |
|
|
125 |
|
|
126 |
|
@param |
127 |
|
@param |
128 |
|
@return |
129 |
|
@throws |
130 |
|
@throws |
131 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
132 |
0 |
public CertifiedKeyPair retrieve(CertifiedPublicKey publicKey, String password)... |
133 |
|
throws KeyStoreException, AccessDeniedException |
134 |
|
{ |
135 |
0 |
checkAccess(Right.VIEW); |
136 |
0 |
return store.retrieve(storeReference, publicKey, password.getBytes(UTF8)); |
137 |
|
} |
138 |
|
} |