FileDocCategorySizeDatePackage
Credentials.javaAPI DocExample1262Thu Sep 02 00:40:54 BST 2004com.oreilly.strutsckbk.ch11

Credentials

public class Credentials extends Object
Credential
author
Bill Siggelkow

Fields Summary
private String
name
private String
password
Constructors Summary
Credentials(String encryptedCredentials)
Creates a credential from an encrypted credentials string encrypted using {@link #encryptToString(String) encryptToString}.

param
encryptedCredentials Encrypted credentials string.

		decryptFromString(encryptedCredentials);
	
public Credentials(String name, String password)
Creates a new credential for the given name and password.

		this.name = name;
		this.password = password;
	
Methods Summary
private voiddecryptFromString(java.lang.String encryptedCredentials)

		int separatorIndex = encryptedCredentials.indexOf(":");
		name =  encryptedCredentials.substring(0, separatorIndex);
		password =  encryptedCredentials.substring(separatorIndex+1);
	
java.lang.StringencryptToString()

		return name + ':" + password;
	
java.lang.StringgetName()

		return name;
	
java.lang.StringgetPassword()

		return password;