public class LongTermCredentialSession extends Object implements CredentialsAuthority
Modifier and Type | Field and Description |
---|---|
private LongTermCredential |
longTermCredential
The LongTermCredential a use of which is represented by this
instance.
|
private byte[] |
nonce
The value of the NONCE attribute currently associated with the use of
longTermCredential represented by this instance. |
private byte[] |
realm
The realm (i.e.
|
Constructor and Description |
---|
LongTermCredentialSession(LongTermCredential longTermCredential,
byte[] realm)
Initializes a new LongTermCredentialSession instance which
is to represent a use of a specific LongTermCredential in a
specific realm.
|
Modifier and Type | Method and Description |
---|---|
void |
addAttributes(Request request)
Adds the Attributes to a specific Request which support
the long-term credential mechanism using the LongTermCredential
associated with this instance.
|
boolean |
checkLocalUserName(String username)
Determines whether username is currently known to this authority
|
byte[] |
getLocalKey(String username)
Returns the key (password) that corresponds to the specified local
username or user frag, an empty array if there was no password for
that username or null if the username is not a local user
name recognized by this CredentialsAuthority.
|
byte[] |
getNonce()
Gets the value of the NONCE attribute currently associated with the use
of the LongTermCredential represented by this instance.
|
byte[] |
getPassword()
Gets the password of the LongTermCredential used by this
instance.
|
byte[] |
getRealm()
Gets the realm (i.e.
|
byte[] |
getRemoteKey(String username,
String media)
Returns the key (password) that corresponds to the specified remote
username or user frag, an empty array if there was no password for
that username or null if the username is not a remote user
name recognized by this CredentialsAuthority.
|
byte[] |
getUsername()
Gets the username of the LongTermCredential used by this
instance.
|
boolean |
realmEquals(byte[] realm)
Determines whether the realm of this LongTermCredentialSession
is equal to a specific realm.
|
void |
setNonce(byte[] nonce)
Sets the value of the NONCE attribute to be associated with the use of
the LongTermCredential represented by this instance.
|
boolean |
usernameEquals(byte[] username)
Determines whether the username of the LongTermCredential used
by this instance is equal to a specific username.
|
private final LongTermCredential longTermCredential
private byte[] nonce
longTermCredential
represented by this instance.private final byte[] realm
longTermCredential
is represented by this instance.public LongTermCredentialSession(LongTermCredential longTermCredential, byte[] realm)
longTermCredential
- the LongTermCredential a use of
which is to be represented by the new instancerealm
- the realm in which the specified
LongTermCredential is to be usedpublic void addAttributes(Request request) throws StunException
request
- the Request in which the Attribute
supporting the STUN long-term credential mechanism are to be addedStunException
- if anything goes wrong while adding the
Attributes to request which support the STUN long-term
credential mechanismpublic boolean checkLocalUserName(String username)
checkLocalUserName
in interface CredentialsAuthority
username
- the user name whose validity we'd like to checkCredentialsAuthority.checkLocalUserName(String)
public byte[] getLocalKey(String username)
getLocalKey
in interface CredentialsAuthority
username
- the local user name or user frag whose credentials
we'd like to obtainCredentialsAuthority.getLocalKey(String)
public byte[] getNonce()
public byte[] getPassword()
public byte[] getRealm()
public byte[] getRemoteKey(String username, String media)
getRemoteKey
in interface CredentialsAuthority
username
- the remote user name or user frag whose credentials
we'd like to obtainmedia
- not usedCredentialsAuthority.getRemoteKey(String, String)
public byte[] getUsername()
public boolean realmEquals(byte[] realm)
realm
- the realm to compare for equality to the realm of this
LongTermCredentialSessionpublic void setNonce(byte[] nonce)
nonce
- the value of the NONCE attribute to be associated with the
use of the LongTermCredential represented by this instancepublic boolean usernameEquals(byte[] username)
username
- the username to compare for equality to the username of
the LongTermCredential used by this instanceCopyright © 2018. All rights reserved.