Class UsernamePasswordCredentials

  • All Implemented Interfaces:
    java.io.Serializable, Credentials

    @Contract(threading=IMMUTABLE)
    public class UsernamePasswordCredentials
    extends java.lang.Object
    implements Credentials, java.io.Serializable
    Simple Credentials representation based on a user name / password pair.
    Since:
    4.0
    See Also:
    Serialized Form
    • Field Detail

      • principal

        private final java.security.Principal principal
      • password

        private final char[] password
    • Constructor Detail

      • UsernamePasswordCredentials

        public UsernamePasswordCredentials​(java.security.Principal principal,
                                           char[] password)
        The constructor with the username and password arguments.
        Parameters:
        principal - the user principal
        password - the password
        Since:
        5.3
        See Also:
        BasicUserPrincipal, NTUserPrincipal
      • UsernamePasswordCredentials

        public UsernamePasswordCredentials​(java.lang.String username,
                                           char[] password)
        The constructor with the username and password arguments.
        Parameters:
        username - the user name
        password - the password
    • Method Detail

      • getUserName

        public java.lang.String getUserName()
      • getUserPassword

        public char[] getUserPassword()
        Since:
        5.3
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object