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