01: /*
02: * $Id: PGPAuthentication.java 10789 2008-02-12 20:04:43Z dfeist $
03: * --------------------------------------------------------------------------------------
04: * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
05: *
06: * The software in this package is published under the terms of the CPAL v1.0
07: * license, a copy of which has been included with this distribution in the
08: * LICENSE.txt file.
09: */
10:
11: package org.mule.module.pgp;
12:
13: import org.mule.api.security.Authentication;
14:
15: import java.util.Map;
16:
17: import cryptix.message.Message;
18: import cryptix.pki.KeyBundle;
19:
20: public class PGPAuthentication implements Authentication {
21: boolean authenticated = false;
22: private String userName;
23: private Message message;
24: private KeyBundle userKeyBundle = null;
25:
26: public PGPAuthentication(String userName, Message message) {
27: this .userName = userName;
28: this .message = message;
29: }
30:
31: /*
32: * (non-Javadoc)
33: *
34: * @see org.mule.api.security.Authentication#setAuthenticated(boolean)
35: */
36: public void setAuthenticated(boolean b) {
37: authenticated = b;
38: }
39:
40: /*
41: * (non-Javadoc)
42: *
43: * @see org.mule.api.security.Authentication#isAuthenticated()
44: */
45: public boolean isAuthenticated() {
46: return authenticated;
47: }
48:
49: /*
50: * (non-Javadoc)
51: *
52: * @see org.mule.api.security.Authentication#getCredentials()
53: */
54: public Object getCredentials() {
55: return message;
56: }
57:
58: /*
59: * (non-Javadoc)
60: *
61: * @see org.mule.api.security.Authentication#getDetails()
62: */
63: public Object getDetails() {
64: return userKeyBundle;
65: }
66:
67: protected void setDetails(KeyBundle kb) {
68: userKeyBundle = kb;
69: }
70:
71: /*
72: * (non-Javadoc)
73: *
74: * @see org.mule.api.security.Authentication#getPrincipal()
75: */
76: public Object getPrincipal() {
77: return userName;
78: }
79:
80: public Map getProperties() {
81: // TODO
82: return null;
83: }
84:
85: public void setProperties(Map securityMode) {
86: // TODO
87:
88: }
89:
90: }
|