Class PasswordCredential


  • public class PasswordCredential
    extends Object
    This class holds the user password for the shared password realm and the realm name. This credential is added as a private credential to the JAAS subject.
    • Constructor Detail

      • PasswordCredential

        public PasswordCredential​(String user,
                                  char[] password,
                                  String realm)
        Construct a credential with the specified password and realm name.
        Parameters:
        the - password.
        the - realm name. The only value supported for now is "default".
      • PasswordCredential

        public PasswordCredential​(String user,
                                  char[] password,
                                  String realm,
                                  byte[] target_name)
        called by SecServerRequestInterceptor The object if created on the server side is readonly
    • Method Detail

      • getRealm

        public String getRealm()
        Return the realm name.
        Returns:
        the realm name. Only value supported for now is "default".
      • getUser

        public String getUser()
        Return the username.
        Returns:
        the user name.
      • setRealm

        public void setRealm​(String realm)
      • getPassword

        public char[] getPassword()
        Return the password.
        Returns:
        the password.
      • getTargetName

        public byte[] getTargetName()
        Return the target_name
        Returns:
        the target_name
      • equals

        public boolean equals​(Object o)
        Compare two instances of the credential and return true if they are the same and false otherwise.
        Overrides:
        equals in class Object
        Parameters:
        the - object that this instance is being compared to.
        Returns:
        true if the instances are equal, false otherwise
      • hashCode

        public int hashCode()
        Return the hashCode computed from the password and realm name.
        Overrides:
        hashCode in class Object
        Returns:
        the hash code.
      • toString

        public String toString()
        The string representation of the credential.
        Overrides:
        toString in class Object