KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mule > extras > pgp > PGPAuthentication


1 /*
2  * $Id: PGPAuthentication.java 3798 2006-11-04 04:07:14Z aperepel $
3  * --------------------------------------------------------------------------------------
4  * Copyright (c) MuleSource, Inc. All rights reserved. http://www.mulesource.com
5  *
6  * The software in this package is published under the terms of the MuleSource MPL
7  * license, a copy of which has been included with this distribution in the
8  * LICENSE.txt file.
9  */

10
11 package org.mule.extras.pgp;
12
13 import java.util.Map JavaDoc;
14
15 import cryptix.message.Message;
16 import cryptix.pki.KeyBundle;
17
18 import org.mule.umo.security.UMOAuthentication;
19
20 /**
21  * @author ariva
22  */

23 public class PGPAuthentication implements UMOAuthentication
24 {
25
26     boolean authenticated = false;
27     private String JavaDoc userName;
28     private Message message;
29     private KeyBundle userKeyBundle = null;
30
31     public PGPAuthentication(String JavaDoc userName, Message message)
32     {
33         this.userName = userName;
34         this.message = message;
35     }
36
37     /*
38      * (non-Javadoc)
39      *
40      * @see org.mule.umo.security.UMOAuthentication#setAuthenticated(boolean)
41      */

42     public void setAuthenticated(boolean b)
43     {
44         authenticated = b;
45     }
46
47     /*
48      * (non-Javadoc)
49      *
50      * @see org.mule.umo.security.UMOAuthentication#isAuthenticated()
51      */

52     public boolean isAuthenticated()
53     {
54         return authenticated;
55     }
56
57     /*
58      * (non-Javadoc)
59      *
60      * @see org.mule.umo.security.UMOAuthentication#getCredentials()
61      */

62     public Object JavaDoc getCredentials()
63     {
64         return message;
65     }
66
67     /*
68      * (non-Javadoc)
69      *
70      * @see org.mule.umo.security.UMOAuthentication#getDetails()
71      */

72     public Object JavaDoc getDetails()
73     {
74         return userKeyBundle;
75     }
76
77     protected void setDetails(KeyBundle kb)
78     {
79         userKeyBundle = kb;
80     }
81
82     /*
83      * (non-Javadoc)
84      *
85      * @see org.mule.umo.security.UMOAuthentication#getPrincipal()
86      */

87     public Object JavaDoc getPrincipal()
88     {
89         return userName;
90     }
91
92     public Map JavaDoc getProperties()
93     {
94         // TODO
95
return null;
96     }
97
98     public void setProperties(Map JavaDoc securityMode)
99     {
100         // TODO
101

102     }
103
104 }
105
Popular Tags