Class DigestCredentials

java.lang.Object
io.inverno.mod.security.http.digest.DigestCredentials
All Implemented Interfaces:
Credentials, PrincipalCredentials

public class DigestCredentials extends Object implements PrincipalCredentials

HTTP Digest specific credentials as defined by RFC 7616 Section 3.4.

Since:
1.5
Author:
Jeremy Kuhn
  • Constructor Details

    • DigestCredentials

      public DigestCredentials(String method, String uri, String realm, String username, boolean userhash, String algorithm, String qop, String nc, String cnonce, String nonce, String response) throws MalformedCredentialsException

      Creates digest credentials.

      Parameters:
      method - the HTTP method
      uri - the URI
      realm - the realm
      username - the username
      userhash - the user hash
      algorithm - the algorithm
      qop - the quality of protection
      nc - the nonce count
      cnonce - the client nonce
      nonce - the server nonce
      response - the digest response
      Throws:
      MalformedCredentialsException - if specified parameters and therefore credentials are incorrect
  • Method Details

    • getDigest

      public MessageDigest getDigest()

      Returns the message digest.

      Returns:
      the message digest
    • getResponse

      public String getResponse()

      Returns the digest response

      Returns:
      the digest response
    • getUsername

      public String getUsername()
      Description copied from interface: PrincipalCredentials

      Returns the unique username associated to the entity.

      Specified by:
      getUsername in interface PrincipalCredentials
      Returns:
      a username
    • getRealm

      public String getRealm()

      Returns the realm.

      Returns:
      the realm
    • isUserhash

      public boolean isUserhash()

      Returns the user hash.

      Returns:
      the user hash
    • getMethod

      public String getMethod()

      Returns the HTTP method.

      Returns:
      the HTTP method
    • getUri

      public String getUri()

      Returns the URI.

      Returns:
      the URI
    • getQop

      public String getQop()

      Returns the quality of protection.

      Returns:
      the qop
    • getCnonce

      public String getCnonce()

      Returns the client nonce.

      Returns:
      the client nonce
    • getNc

      public String getNc()

      Returns the nonce count.

      Returns:
      the nonce count
    • getNonce

      public String getNonce()

      Returns the server nonce.

      Returns:
      the server nonce
    • getNonceExpire

      public long getNonceExpire()

      Returns the server nonce expire timestamp.

      Returns:
      the server nonce expire timestamp
    • getNonceHash

      public String getNonceHash()

      Returns the server nonce hash.

      Returns:
      the server nonce hash