/**
  * @param array $errors
  * @param array $options
  *
  * @internal param array $input
  */
 private function process_sso_options($input, &$errors, &$options)
 {
     if (empty($input[LaunchKey_WP_Options::OPTION_SSO_ENTITY_ID])) {
         $errors[] = $this->wp_facade->__('SSO Profile Entity ID is required', $this->language_domain);
     } else {
         $options[LaunchKey_WP_Options::OPTION_SSO_ENTITY_ID] = $input[LaunchKey_WP_Options::OPTION_SSO_ENTITY_ID];
     }
     if (empty($_FILES['sso_idp']['tmp_name']) && empty($options[LaunchKey_WP_Options::OPTION_SSO_CERTIFICATE])) {
         $errors[] = $this->wp_facade->__('SSO Profile File is required', $this->language_domain);
     } else {
         if (!empty($_FILES['sso_idp']['tmp_name'])) {
             try {
                 $idp_doc = SAML2_DOMDocumentFactory::fromString(file_get_contents($_FILES['sso_idp']['tmp_name']));
                 $helper = LaunchKey_WP_SSO_Config_Helper::from_DOM_document($idp_doc);
                 $options[LaunchKey_WP_Options::OPTION_SSO_CERTIFICATE] = $helper->get_X509_certificate();
                 $options[LaunchKey_WP_Options::OPTION_SSO_LOGIN_URL] = $helper->get_SSO_redirect();
                 $options[LaunchKey_WP_Options::OPTION_SSO_LOGOUT_URL] = $helper->get_SLO_redirect();
                 $options[LaunchKey_WP_Options::OPTION_SSO_ERROR_URL] = $helper->get_error_redirect();
             } catch (Exception $e) {
                 $errors[] = $this->wp_facade->__('The SSO Profile file provided had an error being parsed', $this->language_domain) . ": " . $e->getMessage();
             }
         }
     }
 }
 /**
  * @depends test_from_DOM_document_returns_instance
  * @param LaunchKey_WP_SSO_Config_Helper $helper
  */
 public function test_get_X509_certificate(LaunchKey_WP_SSO_Config_Helper $helper)
 {
     $expected = "-----BEGIN CERTIFICATE-----\n" . "MIIDfjCCAmagAwIBAQICJxAwDQYJKoZIhvcNAQEFBQAwgYExCzAJBgNVBAYTAlVT\r\n" . "MRIwEAYDVQQIEwlMYXMgVmVnYXMxEjAQBgNVBAcTCUxhcyBWZWdhczEYMBYGA1UE\r\n" . "ChMPTGF1bm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IN1AKwd9/6EQ3XbQPyXoXpW0TCBzs/OxGqnhiJD9rROCtVl1SJze\r\n" . "LWllWSmosQFhsXwSO5ZlnechO+SMaxN7OrV7POOv8aRcpQ==\r\n" . "-----END CERTIFICATE-----\n";
     $this->assertEquals($expected, $helper->get_X509_certificate());
 }