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 java.util.Collection; |
23 |
|
|
24 |
|
import org.xwiki.crypto.pkix.CertificateProvider; |
25 |
|
import org.xwiki.crypto.pkix.params.CertifiedPublicKey; |
26 |
|
import org.xwiki.crypto.script.internal.AbstractScriptingStore; |
27 |
|
import org.xwiki.crypto.store.CertificateStore; |
28 |
|
import org.xwiki.crypto.store.CertificateStoreException; |
29 |
|
import org.xwiki.crypto.store.StoreReference; |
30 |
|
import org.xwiki.security.authorization.AccessDeniedException; |
31 |
|
import org.xwiki.security.authorization.ContextualAuthorizationManager; |
32 |
|
import org.xwiki.security.authorization.Right; |
33 |
|
import org.xwiki.stability.Unstable; |
34 |
|
|
35 |
|
|
36 |
|
@link |
37 |
|
|
38 |
|
@version |
39 |
|
@since |
40 |
|
|
41 |
|
@Unstable |
|
|
| 0% |
Uncovered Elements: 12 (12) |
Complexity: 4 |
Complexity Density: 0.5 |
|
42 |
|
public class ScriptingCertificateStore extends AbstractScriptingStore |
43 |
|
{ |
44 |
|
private CertificateStore store; |
45 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
46 |
0 |
ScriptingCertificateStore(CertificateStore store, StoreReference reference,... |
47 |
|
ContextualAuthorizationManager contextualAuthorizationManager) |
48 |
|
{ |
49 |
0 |
super(reference, contextualAuthorizationManager); |
50 |
0 |
this.store = store; |
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(CertifiedPublicKey certificate) throws CertificateStoreException, AccessDeniedException... |
61 |
|
{ |
62 |
0 |
checkAccess(Right.EDIT); |
63 |
0 |
store.store(storeReference, certificate); |
64 |
|
} |
65 |
|
|
66 |
|
|
67 |
|
|
68 |
|
|
69 |
|
@return |
70 |
|
@throws |
71 |
|
@throws |
72 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
73 |
0 |
public CertificateProvider getCertificateProvider() throws CertificateStoreException, AccessDeniedException... |
74 |
|
{ |
75 |
0 |
checkAccess(Right.VIEW); |
76 |
0 |
return store.getCertificateProvider(storeReference); |
77 |
|
} |
78 |
|
|
79 |
|
|
80 |
|
|
81 |
|
|
82 |
|
@return |
83 |
|
@throws |
84 |
|
@throws |
85 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
86 |
0 |
public Collection<CertifiedPublicKey> getAllCertificates() throws CertificateStoreException, AccessDeniedException... |
87 |
|
{ |
88 |
0 |
checkAccess(Right.VIEW); |
89 |
0 |
return store.getAllCertificates(storeReference); |
90 |
|
} |
91 |
|
} |