1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.module.pgp; |
12 | |
|
13 | |
import org.mule.api.security.Authentication; |
14 | |
|
15 | |
import java.util.Map; |
16 | |
|
17 | |
import org.bouncycastle.openpgp.PGPPublicKey; |
18 | |
|
19 | |
public class PGPAuthentication implements Authentication |
20 | |
{ |
21 | |
private boolean authenticated; |
22 | |
private String userName; |
23 | |
private Message message; |
24 | |
private PGPPublicKey publicKey; |
25 | |
|
26 | |
public PGPAuthentication(String userName, Message message) |
27 | 0 | { |
28 | 0 | this.authenticated = false; |
29 | 0 | this.userName = userName; |
30 | 0 | this.message = message; |
31 | 0 | } |
32 | |
|
33 | |
public void setAuthenticated(boolean b) |
34 | |
{ |
35 | 0 | authenticated = b; |
36 | 0 | } |
37 | |
|
38 | |
public boolean isAuthenticated() |
39 | |
{ |
40 | 0 | return authenticated; |
41 | |
} |
42 | |
|
43 | |
public Object getCredentials() |
44 | |
{ |
45 | 0 | return message; |
46 | |
} |
47 | |
|
48 | |
public Object getDetails() |
49 | |
{ |
50 | 0 | return publicKey; |
51 | |
} |
52 | |
|
53 | |
protected void setDetails(PGPPublicKey publicKey) |
54 | |
{ |
55 | 0 | this.publicKey = publicKey; |
56 | 0 | } |
57 | |
|
58 | |
public Object getPrincipal() |
59 | |
{ |
60 | 0 | return userName; |
61 | |
} |
62 | |
|
63 | |
public Map getProperties() |
64 | |
{ |
65 | |
|
66 | 0 | return null; |
67 | |
} |
68 | |
|
69 | |
public void setProperties(Map securityMode) |
70 | |
{ |
71 | |
|
72 | |
|
73 | 0 | } |
74 | |
} |