package org.restcomm.connect.testsuite.telephony.security;

import javax.sip.header.AuthorizationHeader;
import javax.sip.message.Request;

public interface AuthenticationMethod {

    /**
     * Get the authentication scheme
     */
    public String getScheme();

    /**
     * Initialize the authentication method. This has to be done outside the constructor as the constructor is generic (created
     * from the class name specified in the authentication method).
     */
    public void initialize();

    /**
     * Get the authentication realm.
     */
    public String getRealm(String resource);

    /**
     * get the authentication domain.
     */
    public String getDomain();

    /**
     * Get the authentication Algorithm
     */
    public String getAlgorithm();

    /**
     * Generate the challenge string.
     */
    public String generateNonce();

    /**
     * Check the response and answer true if authentication succeeds. Not all of these fields are relevant for every method - a
     * basic scheme may simply do a username password check.
     * 
     * @param username is the username and password.
     * @param authorizationHeader is the authorization header from the SIP request.
     */
    public boolean doAuthenticate(String username, String password, AuthorizationHeader authorizationHeader, Request request);

}
