Class DigestUtilities


  • public class DigestUtilities
    extends java.lang.Object
    DigestUtilities.java - A class supporting the HTTP DIGEST authentication (see RFC 2617).
    Since:
    MINA 2.0.0-M3
    Author:
    Apache MINA Project
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String SESSION_HA1
      The Session digest attribute name
      static java.lang.String[] SUPPORTED_QOPS
      The supported qualities of protections.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String computeResponseValue​(IoSession session, java.util.Map<java.lang.String,​java.lang.String> map, java.lang.String method, java.lang.String pwd, java.lang.String charsetName, java.lang.String body)
      Computes the response to the DIGEST challenge.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • SESSION_HA1

        public static final java.lang.String SESSION_HA1
        The Session digest attribute name
      • SUPPORTED_QOPS

        public static final java.lang.String[] SUPPORTED_QOPS
        The supported qualities of protections.
    • Method Detail

      • computeResponseValue

        public static java.lang.String computeResponseValue​(IoSession session,
                                                            java.util.Map<java.lang.String,​java.lang.String> map,
                                                            java.lang.String method,
                                                            java.lang.String pwd,
                                                            java.lang.String charsetName,
                                                            java.lang.String body)
                                                     throws javax.security.sasl.AuthenticationException,
                                                            java.io.UnsupportedEncodingException
        Computes the response to the DIGEST challenge.
        Parameters:
        session - the current session
        map - the map holding the directives sent by the proxy
        method - the HTTP verb
        pwd - the password
        charsetName - the name of the charset used for the challenge
        body - the html body to be hashed for integrity calculations
        Returns:
        The response
        Throws:
        javax.security.sasl.AuthenticationException - if we weren't able to find a directive value in the map
        java.io.UnsupportedEncodingException - If we weren't able to encode to ISO 8859_1 the username or realm, or if we weren't able to encode the charsetName