Class UserPasswordAttribute


  • public class UserPasswordAttribute
    extends Attribute
    Class representing the User Password Attribute as defined in section 5.2 of RFC 2865. It's use follows one of two patterns. When readying an access request packet to be sent this class is instantiated via by passing the clear text password, request authenticator, and shared secret and the on-the-wire bytes are extracted via the super class's getOctets() method. When receiving an access request packet this class is instantiated with the full on-the-wire octets and the password is then extracted using the extractPassword method passing the received request authenticator and shared secret.
    • Constructor Detail

      • UserPasswordAttribute

        public UserPasswordAttribute​(byte[] octets)
        Instantiates attribute with on-the-wire bytes for decrypting cypher text to restore clear text password.
        Parameters:
        octets - the on-the-wire bytes representing the attribute
      • UserPasswordAttribute

        public UserPasswordAttribute​(Authenticator ra,
                                     String secret,
                                     String password)
        Instantiates attribute with clear text password for creation of cipher text.
        Parameters:
        ra - the Request Authenticator used for the encrypting the first 16 characters of the password.
        secret - the shared secret between the client and the server used for the creation of the cipher text.
        password - The plain text password.
    • Method Detail

      • extractPassword

        public String extractPassword​(Authenticator a,
                                      String secret)
                               throws IOException
        Extracts the plain text password from the cipher text for instances created from on-the-wire octets.
        Parameters:
        a - pseudo-random Request Authenticator
        secret - the shared secret between the client and server used for cipher text generation.
        Returns:
        Clear text password
        Throws:
        IOException - if unable to correctly determine secret, authenticator, or if invalid values are given for cipher text.
      • toStringImpl

        public String toStringImpl()
        Used by super class to log the attribute's contents when packet logging is enabled.
        Overrides:
        toStringImpl in class Attribute
        Returns:
        content representation for traffic logging