aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip
diff options
context:
space:
mode:
authorEmil Ivov <emcho@jitsi.org>2006-08-02 11:42:07 +0000
committerEmil Ivov <emcho@jitsi.org>2006-08-02 11:42:07 +0000
commit795ce1003e5153f3ed974e540fd0ab33c8212b84 (patch)
tree6db6eef77b6476f316da65224449bc1313a59cd5 /src/net/java/sip
parent469229fb171f4d39062034efd66c20ef09599a91 (diff)
downloadjitsi-795ce1003e5153f3ed974e540fd0ab33c8212b84.zip
jitsi-795ce1003e5153f3ed974e540fd0ab33c8212b84.tar.gz
jitsi-795ce1003e5153f3ed974e540fd0ab33c8212b84.tar.bz2
Working on support for interactive password retrieval
Diffstat (limited to 'src/net/java/sip')
-rw-r--r--src/net/java/sip/communicator/service/protocol/SecurityAuthority.java20
-rw-r--r--src/net/java/sip/communicator/service/protocol/UserCredentials.java59
2 files changed, 78 insertions, 1 deletions
diff --git a/src/net/java/sip/communicator/service/protocol/SecurityAuthority.java b/src/net/java/sip/communicator/service/protocol/SecurityAuthority.java
index 488e1bf..201b4ff 100644
--- a/src/net/java/sip/communicator/service/protocol/SecurityAuthority.java
+++ b/src/net/java/sip/communicator/service/protocol/SecurityAuthority.java
@@ -7,11 +7,29 @@
package net.java.sip.communicator.service.protocol;
/**
- * Allows the user interface
+ * Implemented by the user interface, this interface allows a protocol provider
+ * to asynchronosly demand passwords necessary for authentication agaisn various
+ * realms.
+ * <p>
+ * Or in other (simpler words) this is a callback or a hook that the UI would
+ * give a protocol provider so that the protocol provider could
+ * requestCredentials() when necessary (when a password is not available for
+ * a server, or once it has changed, or redemand one after a faulty
+ * authentication)
*
* @author Emil Ivov
*/
public interface SecurityAuthority
{
+ /**
+ * Returns a Credentials object associated with the specified realm.
+ * <p>
+ * @param realm The realm that the credentials are needed for.
+ * @param defaultValues the values to propose the user by default
+ * @return The credentials associated with the specified realm or null if
+ * none could be obtained.
+ */
+ public UserCredentials obtainCredentials(String realm,
+ UserCredentials defaultValues);
}
diff --git a/src/net/java/sip/communicator/service/protocol/UserCredentials.java b/src/net/java/sip/communicator/service/protocol/UserCredentials.java
new file mode 100644
index 0000000..faa793d
--- /dev/null
+++ b/src/net/java/sip/communicator/service/protocol/UserCredentials.java
@@ -0,0 +1,59 @@
+/*
+ * SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
+ *
+ * Distributable under LGPL license.
+ * See terms of license at gnu.org.
+ */
+package net.java.sip.communicator.service.protocol;
+
+
+/**
+ * The class is used whenever user credentials for a particular realm (site
+ * server or service) are necessary
+ * @author Emil Ivov <emcho@dev.java.net>
+ * @version 1.0
+ */
+
+public class UserCredentials
+{
+ private String userName = null;
+ private char[] password = null;
+
+ /**
+ * Sets the name of the user that these credentials relate to.
+ * @param userName the name of the user that these credentials relate to.
+ */
+ public void setUserName(String userName)
+ {
+ this.userName = userName;
+ }
+
+ /**
+ * Returns the name of the user that these credentials relate to.
+ * @return the user name.
+ */
+ public String getUserName()
+ {
+ return this.userName;
+ }
+
+ /**
+ * Sets a password associated with this set of credentials.
+ *
+ * @param passwd the password associated with this set of credentials.
+ */
+ public void setPassword(char[] passwd)
+ {
+ this.password = passwd;
+ }
+
+ /**
+ * Returns these credentials' password
+ *
+ * @return these credentials' password
+ */
+ public char[] getPassword()
+ {
+ return password;
+ }
+}