OneLogin_Saml2_Settings::getSPcert PHP 메소드

getSPcert() 공개 메소드

Returns the x509 public cert of the SP.
public getSPcert ( ) : string
리턴 string SP public cert
    public function getSPcert()
    {
        $cert = null;
        if (isset($this->_sp['x509cert']) && !empty($this->_sp['x509cert'])) {
            $cert = $this->_sp['x509cert'];
        } else {
            $certFile = $this->_paths['cert'] . 'sp.crt';
            if (file_exists($certFile)) {
                $cert = file_get_contents($certFile);
            }
        }
        return $cert;
    }

Usage Example

예제 #1
0
 /**
  * Tests the checkSPCerts method of the OneLogin_Saml2_Settings
  *
  * @covers OneLogin_Saml2_Settings::checkSPCerts
  * @covers OneLogin_Saml2_Settings::getSPcert
  * @covers OneLogin_Saml2_Settings::getSPkey
  */
 public function testCheckSPCerts()
 {
     $settings = new OneLogin_Saml2_Settings();
     $this->assertTrue($settings->checkSPCerts());
     $settingsDir = TEST_ROOT . '/settings/';
     include $settingsDir . 'settings2.php';
     $settings2 = new OneLogin_Saml2_Settings($settingsInfo);
     $this->assertTrue($settings2->checkSPCerts());
     $this->assertEquals($settings2->getSPkey(), $settings->getSPkey());
     $this->assertEquals($settings2->getSPcert(), $settings->getSPcert());
 }
All Usage Examples Of OneLogin_Saml2_Settings::getSPcert