Secure iNet Factory

com.jscape.inet.ssh.util
Class User

java.lang.Object
  extended by com.jscape.inet.ssh.util.User
All Implemented Interfaces:
java.io.Serializable

public class User
extends java.lang.Object
implements java.io.Serializable

Unified container for the user parameters such as "name", "password" and "public key". May be used in the various user authentication processes.

Version:
1.0
Author:
Alex Usun
See Also:
Serialized Form

Constructor Summary
User(java.lang.String name, java.io.File keyFile, java.lang.String keyFilePassword)
          Creates a new user with the specified name and key pair, which must be read from the file.
User(java.lang.String name, java.security.KeyPair keyPair)
          Creates a new user with the specified name and key pair.
User(java.lang.String name, java.lang.String password)
          Creates a new user with the specified name and password.
User(java.lang.String name, java.lang.String password, java.io.File keyFile, java.lang.String keyFilePassword)
          Creates a new user with the specified name, password and key pair, which must be read from the file.
User(java.lang.String name, java.lang.String password, java.security.KeyPair keyPair)
          Creates a new user with the specified name, password and key pair.
User(User that)
          Copy constructor.
 
Method Summary
 java.security.KeyPair getKeyPair()
          Obtains user key pair.
 java.lang.String getName()
          Obtains user name.
 java.lang.String getPassword()
          Obtains user password.
 void setKeyPair(java.io.File keyFile, java.lang.String filePassword)
          Sets user key pair.
 void setKeyPair(java.security.KeyPair keyPair)
          Sets user key pair.
 void setKeyPair(java.lang.String key, java.lang.String password)
          Sets user key pair.
 void setName(java.lang.String name)
          Sets user name.
 void setPassword(java.lang.String password)
          Sets user password.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

User

public User(java.lang.String name,
            java.lang.String password,
            java.security.KeyPair keyPair)
Creates a new user with the specified name, password and key pair.

Parameters:
name - user name string
password - user password string
keyPair - user key pair

User

public User(java.lang.String name,
            java.lang.String password)
Creates a new user with the specified name and password.

Parameters:
name - user name string
password - user password string

User

public User(java.lang.String name,
            java.security.KeyPair keyPair)
Creates a new user with the specified name and key pair.

Parameters:
name - user name string
keyPair - user key pair

User

public User(java.lang.String name,
            java.io.File keyFile,
            java.lang.String keyFilePassword)
     throws java.io.IOException
Creates a new user with the specified name and key pair, which must be read from the file.

Parameters:
name - user name string
keyFile - user key pair file name
keyFilePassword - file password phrase
Throws:
java.io.IOException - if an I/O error occurs
FormatException - if the file has bad format

User

public User(java.lang.String name,
            java.lang.String password,
            java.io.File keyFile,
            java.lang.String keyFilePassword)
     throws java.io.IOException
Creates a new user with the specified name, password and key pair, which must be read from the file.

Parameters:
name - user name string
password - user password string
keyFile - user key pair file name
keyFilePassword - file password phrase
Throws:
java.io.IOException - if an I/O error occurs
FormatException - if the file has bad format

User

public User(User that)
Copy constructor.

Parameters:
that - instance to copy
Method Detail

getName

public java.lang.String getName()
Obtains user name.

Returns:
user name string

getPassword

public java.lang.String getPassword()
Obtains user password.

Returns:
user password string

getKeyPair

public java.security.KeyPair getKeyPair()
Obtains user key pair.

Returns:
user key pair

setName

public void setName(java.lang.String name)
Sets user name.

Parameters:
name - name

setPassword

public void setPassword(java.lang.String password)
Sets user password.

Parameters:
password - user password

setKeyPair

public void setKeyPair(java.security.KeyPair keyPair)
Sets user key pair.

Parameters:
keyPair - key pair.

setKeyPair

public void setKeyPair(java.io.File keyFile,
                       java.lang.String filePassword)
                throws java.io.IOException
Sets user key pair.

Parameters:
keyFile - private key file
filePassword - file password
Throws:
java.io.IOException - if an I/O error occurs
FormatException - if key format error occurs

setKeyPair

public void setKeyPair(java.lang.String key,
                       java.lang.String password)
                throws FormatException
Sets user key pair.

Parameters:
key - the private key
password - the private key password
Throws:
FormatException - if key format error occurs

Secure iNet Factory

Copyright © JSCAPE LLC. 1999-2011. All Rights Reserved