public class JonasIdentity extends Identity
Modifier and Type | Field and Description |
---|---|
private static String |
JAAS_ENTRY_NAME
Name used in the JOnAS JAAS config file.
|
private static String |
KEYSTORE_ALIAS |
private static String |
KEYSTORE_FILE |
private static String |
KEYSTORE_PASS |
private LoginContext |
loginContext |
private String |
principal |
private PublicKey |
publickey |
private static long |
serialVersionUID
Define serialVersionUID for interoperability.
|
private Subject |
subject |
private static String |
UNSORT_ROLES |
private static String |
UNTESTED_SIGNATURE |
Constructor and Description |
---|
JonasIdentity() |
Modifier and Type | Method and Description |
---|---|
boolean |
check(Identity identity)
check the identity.
|
private String |
getPrincipal() |
private PublicKey |
getPublicKey() |
private Object[] |
getRoles() |
private byte[] |
getSignature() |
String |
getUserName()
Get the user name.
|
private void |
initPublicKey() |
void |
readFrom(InputStream is)
The object implements the readFrom method to restore its contents from
the input stream.
|
void |
setIdentity(String user,
String passwd)
set the identity.
|
void |
setIdentity(String user,
String passwd,
String pJaasEntryName)
sets the identity based on the user, password and the JAAS entry name.
|
void |
setUserName(String userName)
set user name.
|
String |
toString() |
private boolean |
validate(JonasIdentity identity) |
private boolean |
validate(PublicKey publickey,
JonasIdentity identity) |
void |
writeTo(OutputStream os)
The object implements the writeTo method to write its contents to
the output stream.
|
getRootIdentityClass, getRootName, read, readExternal, write, writeExternal
private static final long serialVersionUID
private static final String JAAS_ENTRY_NAME
private static final String KEYSTORE_FILE
private static final String KEYSTORE_PASS
private static final String KEYSTORE_ALIAS
private static final String UNTESTED_SIGNATURE
private static final String UNSORT_ROLES
private String principal
private Subject subject
private LoginContext loginContext
private PublicKey publickey
public void setIdentity(String user, String passwd) throws Exception
Identity
setIdentity
in class Identity
Exception
public void setIdentity(String user, String passwd, String pJaasEntryName) throws Exception
user
- the usernamepasswd
- the passwordpJaasEntryName
- the JAAS entry name (within the JAAS configuration file).Exception
- if an error occurs while trying to authenticate.public String getUserName()
Identity
getUserName
in class Identity
public void setUserName(String userName)
Identity
setUserName
in class Identity
private String getPrincipal()
private Object[] getRoles()
private byte[] getSignature()
private boolean validate(JonasIdentity identity) throws Exception
Exception
private boolean validate(PublicKey publickey, JonasIdentity identity) throws Exception
Exception
public boolean check(Identity identity) throws Exception
Identity
public void readFrom(InputStream is) throws IOException
Streamable
is
- the stream to read data from in order to restore the objectIOException
public void writeTo(OutputStream os) throws IOException
Streamable
os
- the stream to write the object toIOException
Copyright © 2015 ScalAgent D.T.. All Rights Reserved.