Class AccessRequestPap

All Implemented Interfaces:
AttributeHolder, NestedAttributeHolder, RadiusPacket, MessageAuthSupport<AccessRequest>

public class AccessRequestPap
extends AccessRequest
  • Constructor Details

  • Method Details

    • setPlaintextPassword

      public void setPlaintextPassword​(java.lang.String userPassword)
      Sets the plain-text user password.
      Parameters:
      userPassword - user password to set
    • getPlaintextPassword

      public java.lang.String getPlaintextPassword()
      Retrieves the plain-text user password.
      Returns:
      user password in plaintext if decoded
    • encodeAuthMechanism

      protected AccessRequestPap encodeAuthMechanism​(java.lang.String sharedSecret, byte[] newAuth) throws RadiusPacketException
      Sets and encodes the User-Password attribute.
      Specified by:
      encodeAuthMechanism in class AccessRequest
      Parameters:
      sharedSecret - shared secret that secures the communication with the other Radius server/client
      newAuth - authenticator to use to encode PAP password, nullable if using different auth protocol
      Returns:
      List of RadiusAttributes to override
      Throws:
      RadiusPacketException - if invalid or missing attributes
    • checkPassword

      public boolean checkPassword​(java.lang.String plaintext)
      Checks that the passed plain-text password matches the password (hash) send with this Access-Request packet.
      Parameters:
      plaintext - password to verify packet against
      Returns:
      true if the password is valid, false otherwise
    • verifyAuthMechanism

      protected void verifyAuthMechanism​(java.lang.String sharedSecret) throws RadiusPacketException
      Description copied from class: AccessRequest
      Verify packet for specific auth protocols
      Specified by:
      verifyAuthMechanism in class AccessRequest
      Parameters:
      sharedSecret - shared secret
      Throws:
      RadiusPacketException - if invalid or missing attributes
    • copy

      public AccessRequest copy()
      Specified by:
      copy in interface MessageAuthSupport<AccessRequest>
      Specified by:
      copy in interface RadiusPacket
      Specified by:
      copy in class AccessRequest
      Returns:
      AccessRequest implementation copy including intermediate/transient values and passwords