public function __construct($error)
 {
     parent::__construct();
     $this[OpenIdProtocol::OpenIDProtocol_Error] = $error;
     $this[OpenIdProtocol::OpenIDProtocol_ErrorCode] = 'unsupported-type';
     $this[OpenIdProtocol::OpenIDProtocol_SessionType] = OpenIdProtocol::AssociationSessionTypeDHSHA256;
     $this[OpenIdProtocol::OpenIDProtocol_AssocType] = OpenIdProtocol::SignatureAlgorithmHMAC_SHA256;
 }
 /** Common Response Parameters
  * @param $assoc_handle
  *        The association handle is used as a key to refer to this association in subsequent messages.
  *        A string 255 characters or less in length. It MUST consist only of ASCII characters in the
  *        range 33-126 inclusive (printable non-whitespace characters).
  * @param $session_type
  *        The value of the "openid.session_type" parameter from the request. If the OP is unwilling
  *        or unable to support this association type, it MUST return an unsuccessful response.
  * @param $assoc_type
  *        The value of the "openid.assoc_type" parameter from the request. If the OP is unwilling or
  *        unable to support this association type, it MUST return an unsuccessful response.
  * @param $expires_in
  *        The lifetime, in seconds, of this association. The Relying Party MUST NOT use
  *        the association after this time has passed.
  *        An integer, represented in base 10 ASCII.
  */
 public function __construct($assoc_handle, $session_type, $assoc_type, $expires_in)
 {
     parent::__construct();
     $this[OpenIdProtocol::OpenIDProtocol_AssocHandle] = $assoc_handle;
     $this[OpenIdProtocol::OpenIDProtocol_SessionType] = $session_type;
     $this[OpenIdProtocol::OpenIDProtocol_AssocType] = $assoc_type;
     $this[OpenIdProtocol::OpenIdProtocol_ExpiresIn] = $expires_in;
 }
 /**
  * 11.4.2.2. Response Parameters
  *  ns :As specified in Section 5.1.2.
  *  is_valid
  *  Value: "true" or "false"; asserts whether the signature of the verification
  *  request is valid.
  *  invalidate_handle
  *  Value: (optional) The "invalidate_handle" value sent in the verification request,
  *  if the OP confirms it is invalid.
  *  Description: If present in a verification response with "is_valid" set to "true",
  *  the Relying Party SHOULD remove the corresponding association from its store and
  *  SHOULD NOT send further authentication requests with this handle.
  *  Note: This two-step process for invalidating associations is necessary to prevent an attacker from invalidating an association at will by adding "invalidate_handle" parameters to an authentication response.
  * @param $is_valid
  * @param null $invalidate_handle
  */
 public function __construct($is_valid, $invalidate_handle = null)
 {
     parent::__construct();
     $this[OpenIdProtocol::OpenIDProtocol_IsValid] = $is_valid;
     if (!is_null($invalidate_handle) && !empty($invalidate_handle)) {
         $this[OpenIdProtocol::OpenIDProtocol_InvalidateHandle] = $invalidate_handle;
     }
 }
 /**
  * @param $error :  A human-readable message indicating the cause of the error.
  * @param null $contact : (optional) Contact address for the administrator of the sever.
  *                        The contact address may take any form, as it is intended to be
  *                        displayed to a person.
  * @param null $reference :  (optional) A reference token, such as a support ticket number
  *                          or a URL to a news blog, etc.
  */
 public function __construct($error, $contact = null, $reference = null)
 {
     parent::__construct();
     $this->setHttpCode(self::HttpErrorResponse);
     $this[OpenIdProtocol::OpenIDProtocol_Error] = $error;
     //opt values
     if (!is_null($contact)) {
         $this[OpenIdProtocol::OpenIDProtocol_Contact] = $contact;
     }
     if (!is_null($reference)) {
         $this[OpenIdProtocol::OpenIDProtocol_Reference] = $reference;
     }
 }