public final class RoamingUser
extends java.lang.Object
RoamingUser class provides utility APIs for communication
with an Entrust Authority Roaming Server to retrieve a roaming profile,
to create/recover a roaming user, update a roaming profile, and deregister
a roaming profile.
RoamingCredentialReader and RoamingCredentialWriter
objects can be used with a User object to perform almost
all functions performed by this class.RoamingCredentialReader,
RoamingCredentialWriter,
User| Constructor and Description |
|---|
RoamingUser(java.lang.String iniFileName)
Creates an instance of
RoamingUser |
| Modifier and Type | Method and Description |
|---|---|
void |
changePassword(SecureStringBuffer oldPassword,
SecureStringBuffer newPassword)
Deprecated.
As of 7.0, use
User.changePassword() with a
RoamingCredentialWriter object set to perform this task. |
void |
create(java.lang.String userId,
SecureStringBuffer password,
CredentialCreator creator)
Deprecated.
As of 7.0, use a
CredentialCreator with a
RoamingCredentialWriter object to perform this task. |
void |
deregister()
Deprecated.
as of 7.0, the method
RoamingCredentialReader.deregister() should
be used to perform this function. |
void |
enableSSLLog(boolean enable)
Enables SSL log.
|
boolean |
encryptionKeyUpdateRequired()
Deprecated.
As of 7.0, use a
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object for key management tasks. |
byte[] |
getProfile()
Returns the user's profile as a
byte array. |
EntrustFiles |
getRequestedFiles()
Returns an
EntrustFiles object from Roaming Server
during the login operation. |
byte[] |
getServerVersion(java.lang.String userid)
Retrieves the latest version of Roaming supported by the
Roaming Server.
|
boolean |
isLoggedIn()
Determines whether or not the user is logged in.
|
int |
login(java.lang.String userid,
SecureStringBuffer password)
Deprecated.
as of 7.0,
RoamingCredentialReader and
RoamingCredentialWriter should be used with a User
object to perform this function. |
void |
logout()
Logs out the user and deletes all user-specific information.
|
void |
recover(java.lang.String userId,
SecureStringBuffer password,
CredentialRecoverer recoverer)
Deprecated.
As of 7.0, use a
CredentialRecoverer with a
RoamingCredentialWriter object to perform this task. |
void |
register(java.lang.String profilePath,
java.lang.String roamingUserID,
SecureStringBuffer password)
Registers a user.
|
boolean |
signingKeyUpdateRequired()
Deprecated.
As of 7.0, use a
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object for key management tasks. |
boolean |
sslLogEnabled()
Returns the SSL log mode.
|
void |
update(EntrustFiles files)
Updates the user's files in the Directory, or places them
in the Directory if they do not already exist.
|
void |
updateAnother(java.lang.String subjectDN,
EntrustFiles files)
Updates another User's files in the Directory, or places them
in the Directory if they do not already exist.
|
boolean |
updateEncryptionKeys()
Deprecated.
As of 7.0, use a
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object, and let the User perform key management automtically. |
boolean |
updateSigningKeys()
Deprecated.
As of 7.0, use a
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object, and let the User perform key management automtically. |
public RoamingUser(java.lang.String iniFileName)
throws RoamingException,
java.io.FileNotFoundException,
UserFatalException
RoamingUseriniFileName - the location of the entrust.ini filejava.io.FileNotFoundException - if iniFileName is not foundUserFatalException - if connections to the PKI or directory
failedRoamingException - if any required settings are missing
from the entrust.ini file.public byte[] getServerVersion(java.lang.String userid)
throws RoamingException,
java.io.IOException
The login method does not have to be called before
calling this method.
userid - the Roaming ID of the user performing the
request.byte array
java.io.IOException - if the query failed due to any communication
problemRoamingException - if the query operation failed for any other reason.public int login(java.lang.String userid,
SecureStringBuffer password)
throws RoamingException,
java.io.IOException,
java.security.cert.CertificateException,
UserBadPasswordException,
UserFatalException,
UserCertificateRevokedException
RoamingCredentialReader and
RoamingCredentialWriter should be used with a User
object to perform this function.The method performs the following steps:
userid - the user's login IDpassword - the user's passwordUser.login(com.entrust.toolkit.credentials.CredentialReader, com.entrust.toolkit.util.SecureStringBuffer) for details.java.io.IOException - if the communication with the Roaming Server
failed;java.security.cert.CertificateException - if the user has an invalid certifucate;UserBadPasswordException - if the password is not correct;UserFatalException - if the user failed to login;UserCertificateRevokedException - if the user's certificate has
been revoked;RoamingException - if the operation failed to retrieve the
user's profile from the Roaming Server.public byte[] getProfile()
throws UserNotLoggedInException
byte array.
String, use this
construction:
new String( roamingUser.getProfile() )
RoamingServer instance as a
byte array.UserNotLoggedInException - if the use is not logged in.public void logout()
throws UserNotLoggedInException
UserNotLoggedInException - if the user is not logged in.public void register(java.lang.String profilePath,
java.lang.String roamingUserID,
SecureStringBuffer password)
throws UserCertificateRevokedException,
UserFatalException,
UserBadPasswordException,
RoamingException,
java.io.IOException
The registration operation logs in the user before moving the user's supporting files to the Roaming Server. These files include ".epf", ".pab", ".erl", ".sla", ".ckl", ".eao", and ".cpb" files. It's application's responsibility to remove these files after the operation.
The method assumes that all the supporting files are located in the same directory as the user's profile.
profilePath - the path to the user's profile.roamingUserID - the Roaming ID of the user to be registered.password - the user's password.UserCertificateRevokedException - if the user's certificate has
been revoked;UserFatalException - if the user failed to login the profile;UserBadPasswordException - if the password is not valid;RoamingException - if the roaming registration failed;java.io.IOException - if the operation failed due to the communication
problem.public void deregister()
throws UserNotLoggedInException,
RoamingException,
java.io.IOException
RoamingCredentialReader.deregister() should
be used to perform this function.RoamingException - if removal of the user's roaming files failed.java.io.IOException - if the operation failed due to any communication problem.UserNotLoggedInException - if the user is not logged in.RoamingCredentialReader.deregister()public void create(java.lang.String userId,
SecureStringBuffer password,
CredentialCreator creator)
throws RoamingException,
java.io.IOException,
UserBadPasswordException,
UserFatalException,
UserCertificateRevokedException,
java.security.cert.CertificateException,
java.security.KeyException
CredentialCreator with a
RoamingCredentialWriter object to perform this task.userId - the ID of the new Roaming user.password - the password of the new Roaming user.creator - the credential creator used to create the user.
RoamingException - if the roaming protocol failed;java.io.IOException - if the communication connection failed;UserBadPasswordException - if the password is incorrect or
invalid;UserFatalException - if user creation failed;UserCertificateRevokedExceptionjava.security.cert.CertificateExceptionjava.security.KeyExceptionRoamingCredentialWriterpublic void recover(java.lang.String userId,
SecureStringBuffer password,
CredentialRecoverer recoverer)
throws RoamingException,
java.io.IOException,
UserBadPasswordException,
UserFatalException,
UserCertificateRevokedException,
java.security.cert.CertificateException,
java.security.KeyException
CredentialRecoverer with a
RoamingCredentialWriter object to perform this task.userId - the ID of the Roaming user to be recovered.password - the Roaming user's password.recoverer - the credential recoverer used to recover the
user.
RoamingException - if roaming protocol failed;java.io.IOException - if the communication connection failed;UserBadPasswordException - if the password is invalid;UserFatalException - if user recovery failed;UserCertificateRevokedExceptionjava.security.cert.CertificateExceptionjava.security.KeyExceptionRoamingCredentialWriterpublic void update(EntrustFiles files) throws RoamingException, java.io.IOException
login(java.lang.String, com.entrust.toolkit.util.SecureStringBuffer).
files - the files to be updated.java.io.IOException - if the operation failed due to any communication
problem;RoamingException - if the operation failed due to any other
reason.public void updateAnother(java.lang.String subjectDN,
EntrustFiles files)
throws RoamingException,
java.io.IOException,
UserNotLoggedInException
login(java.lang.String, com.entrust.toolkit.util.SecureStringBuffer).
The user requesting this operation must have privileges set that allow the user to perform the operation.
subjectDN - the DN of the user whose roaming files are
to be updated.files - the files to be updated.RoamingException - if the roaming protocol failed;java.io.IOException - if the communication connection failed;UserNotLoggedInException - if the user is not logged in.public void changePassword(SecureStringBuffer oldPassword, SecureStringBuffer newPassword) throws RoamingException, java.io.IOException, UserBadPasswordException, UserFatalException, UserNotLoggedInException
User.changePassword() with a
RoamingCredentialWriter object set to perform this task.login(java.lang.String, com.entrust.toolkit.util.SecureStringBuffer).
oldPassword - the user's current password.newPassword - the user's new password.RoamingException - if the roaming protocol failed;java.io.IOException - if the communication connection failed;UserBadPasswordException - if either old password is incorrect
or the new password is invalid;UserFatalException - if the password change failed;UserNotLoggedInException - if the user is not logged in.RoamingCredentialWriterpublic boolean updateSigningKeys()
throws UserNotLoggedInException,
UserFatalException,
UserBadPasswordException,
java.io.IOException,
RoamingException
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object, and let the User perform key management automtically.getProfile method
to obtain the updated profile.UserNotLoggedInException - if the user is not logged in;UserFatalException - if the key update failed;UserBadPasswordException - if the user password is invalid;java.io.IOException - if the communication connection failed;RoamingException - if the roaming protocol failed.RoamingCredentialReader,
RoamingCredentialWriterpublic boolean updateEncryptionKeys()
throws UserNotLoggedInException,
UserFatalException,
UserBadPasswordException,
java.io.IOException,
RoamingException
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object, and let the User perform key management automtically.UserNotLoggedInException - if the user is not logged in;UserFatalException - if the key update failed;UserBadPasswordException - if the user password is invalid;java.io.IOException - if the communication connection failed;RoamingException - if the roaming protocol failed.RoamingCredentialReader,
RoamingCredentialWriterpublic boolean signingKeyUpdateRequired()
throws UserNotLoggedInException,
UserBadPasswordException
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object for key management tasks.UserNotLoggedInException - if the user is not logged in;UserBadPasswordException - if the user password is invalid.RoamingCredentialReader,
RoamingCredentialWriterpublic boolean encryptionKeyUpdateRequired()
throws UserNotLoggedInException,
UserBadPasswordException
RoamingCredentialReader and
RoamingCredentialWriter object with a User
object for key management tasks.UserNotLoggedInException - if the user is not logged in;UserBadPasswordException - if the user password is invalid.RoamingCredentialReader,
RoamingCredentialWriterpublic boolean isLoggedIn()
boolean specifying the users logged in
statuspublic boolean sslLogEnabled()
public EntrustFiles getRequestedFiles()
EntrustFiles object from Roaming Server
during the login operation.
EntrustFiles object.public void enableSSLLog(boolean enable)
enable - true to enable and false to disable.
By default, it's false.