Class SecretKeyAuthenticationInfo

java.lang.Object
net.handle.hdllib.AuthenticationInfo
net.handle.hdllib.SecretKeyAuthenticationInfo

public class SecretKeyAuthenticationInfo extends AuthenticationInfo
  • Constructor Summary

    Constructors
    Constructor
    Description
    SecretKeyAuthenticationInfo(byte[] userIDHandle, int userIDIndex, byte[] secretKey)
    Construct a SecretKeyAuthenticationInfo object using the given user ID handle with the given key at the given handle index.
    SecretKeyAuthenticationInfo(byte[] userIDHandle, int userIDIndex, byte[] secretKey, boolean hash)
    Construct a SecretKeyAuthenticationInfo object using the given user ID handle with the given key at the given handle index.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Sign the given nonce and requestDigest given as a challenge to the given request.
    boolean
     
    byte[]
    Get the identifier for the type of authentication performed.
    byte[]
    Return the byte-encoded representation of the secret key.
    byte[]
    Get the name of the handle that identifies the user that is represented by this authentication object.
    int
    Get the index of the handle value that identifies this user.
    int
     
     

    Methods inherited from class net.handle.hdllib.AuthenticationInfo

    getUserValueReference

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • SecretKeyAuthenticationInfo

      public SecretKeyAuthenticationInfo(byte[] userIDHandle, int userIDIndex, byte[] secretKey)
      Construct a SecretKeyAuthenticationInfo object using the given user ID handle with the given key at the given handle index. This does not use a hash of the given password
    • SecretKeyAuthenticationInfo

      public SecretKeyAuthenticationInfo(byte[] userIDHandle, int userIDIndex, byte[] secretKey, boolean hash) throws Exception
      Construct a SecretKeyAuthenticationInfo object using the given user ID handle with the given key at the given handle index. If the hash parameter is true then the authentication will use a lower case hex encoded copy of the given secret key.
      Throws:
      Exception
  • Method Details

    • getAuthType

      public byte[] getAuthType()
      Get the identifier for the type of authentication performed. In this case, the authentication type is AT_SECRET_KEY.
      Specified by:
      getAuthType in class AuthenticationInfo
    • authenticate

      public byte[] authenticate(ChallengeResponse challenge, AbstractRequest request) throws HandleException
      Sign the given nonce and requestDigest given as a challenge to the given request. The implementation of this method should also probably verify that the client did in fact send the specified request, and that the associated digest is a valid digest of the request.
      Specified by:
      authenticate in class AuthenticationInfo
      Returns:
      a digest of the concatenation of secret key, nonce, requestDigest, and secret key.
      Throws:
      HandleException
    • getUserIdHandle

      public byte[] getUserIdHandle()
      Get the name of the handle that identifies the user that is represented by this authentication object.
      Specified by:
      getUserIdHandle in class AuthenticationInfo
    • getUserIdIndex

      public int getUserIdIndex()
      Get the index of the handle value that identifies this user. The returned index value of the handle that identifies this user should contain a value with a type (public key, secret key, etc) that corresponds to the way that this user is authenticating.
      Specified by:
      getUserIdIndex in class AuthenticationInfo
    • getSecretKey

      public byte[] getSecretKey()
      Return the byte-encoded representation of the secret key.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object