Package 

Class LongTermCredentialSession

  • All Implemented Interfaces:
    org.ice4j.security.CredentialsAuthority

    
    public class LongTermCredentialSession
     implements CredentialsAuthority
                        

    Represents a use of a LongTermCredential and implements CredentialsAuthority for it.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private Array<byte> nonce
      private final Array<byte> realm
    • Constructor Summary

      Constructors 
      Constructor Description
      LongTermCredentialSession(LongTermCredential longTermCredential, Array<byte> realm) Initializes a new LongTermCredentialSession instance which is to represent a use of a specific LongTermCredential in a specific realm.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Array<byte> getNonce() Gets the value of the NONCE attribute currently associated with the use of the LongTermCredential represented by this instance.
      void setNonce(Array<byte> nonce) Sets the value of the NONCE attribute to be associated with the use of the LongTermCredential represented by this instance.
      Array<byte> getRealm() Gets the realm (i.e.
      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
      Array<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.
      Array<byte> getPassword() Gets the password of the LongTermCredential used by this instance.
      Array<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.
      Array<byte> getUsername() Gets the username of the LongTermCredential used by this instance.
      boolean realmEquals(Array<byte> realm) Determines whether the realm of this LongTermCredentialSession is equal to a specific realm.
      boolean usernameEquals(Array<byte> username) Determines whether the username of the LongTermCredential used by this instance is equal to a specific username.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LongTermCredentialSession

        LongTermCredentialSession(LongTermCredential longTermCredential, Array<byte> realm)
        Initializes a new LongTermCredentialSession instance which is to represent a use of a specific LongTermCredential in a specific realm.
        Parameters:
        longTermCredential - the LongTermCredential a use of which is to be represented by the new instance
        realm - the realm in which the specified LongTermCredential is to be used
    • Method Detail

      • getNonce

         Array<byte> getNonce()

        Gets the value of the NONCE attribute currently associated with the use of the LongTermCredential represented by this instance.

      • setNonce

         void setNonce(Array<byte> nonce)

        Sets the value of the NONCE attribute to be associated with the use of the LongTermCredential represented by this instance.

        Parameters:
        nonce - the value of the NONCE attribute to be associated with the use of the LongTermCredential represented by this instance
      • getRealm

         Array<byte> getRealm()

        Gets the realm (i.e. the value of the REALM attribute) in which this instance uses the LongTermCredential associated with it.

      • addAttributes

         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.

        Parameters:
        request - the Request in which the Attributesupporting the STUN long-term credential mechanism are to be added
      • checkLocalUserName

         boolean checkLocalUserName(String username)

        Determines whether username is currently known to this authority

        Parameters:
        username - the user name whose validity we'd like to check
      • getLocalKey

         Array<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.

        Parameters:
        username - the local user name or user frag whose credentials we'd like to obtain
      • getPassword

         Array<byte> getPassword()

        Gets the password of the LongTermCredential used by this instance.

      • getRemoteKey

         Array<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.

        Parameters:
        username - the remote user name or user frag whose credentials we'd like to obtain
        media - not used
      • getUsername

         Array<byte> getUsername()

        Gets the username of the LongTermCredential used by this instance.

      • realmEquals

         boolean realmEquals(Array<byte> realm)

        Determines whether the realm of this LongTermCredentialSession is equal to a specific realm.

        Parameters:
        realm - the realm to compare for equality to the realm of this LongTermCredentialSession
      • usernameEquals

         boolean usernameEquals(Array<byte> username)

        Determines whether the username of the LongTermCredential used by this instance is equal to a specific username.

        Parameters:
        username - the username to compare for equality to the username of the LongTermCredential used by this instance