コード例 #1
0
ファイル: AssociationTest.php プロジェクト: shupp/openid
 /**
  * testNoSignedKeys
  * 
  * @return void
  */
 public function testNoSignedKeys()
 {
     $message = new OpenID_Message();
     $message->set('openid.assoc_handle', $this->object->assocHandle);
     $message->set('openid.op_endpoint', 'http://example.com');
     $this->assertFalse($this->object->checkMessageSignature($message));
 }
コード例 #2
0
ファイル: Assertion.php プロジェクト: shupp/openid
 /**
  * Verifies the signature of this message association.
  * 
  * @param OpenID_Association $assoc Association to use for checking the signature
  * 
  * @return bool result of OpenID_Association::checkMessageSignature()
  * @see OpenID_Association::checkMessageSignature()
  */
 public function verifySignature(OpenID_Association $assoc)
 {
     return $assoc->checkMessageSignature($this->message);
 }
コード例 #3
0
ファイル: AssertionTest.php プロジェクト: shupp/openid
 /**
  * testVerifySignature 
  * 
  * @return void
  */
 public function testVerifySignature()
 {
     $opEndpoint = new OpenID_ServiceEndpoint();
     $opEndpoint->setURIs(array($this->opEndpointURL));
     $opEndpoints = new OpenID_ServiceEndpoints($this->claimedID, $opEndpoint);
     $this->discover = $this->getMock('OpenID_Discover', array('__get'), array($this->claimedID));
     $this->discover->expects($this->once())->method('__get')->will($this->returnValue($opEndpoints));
     $this->store->expects($this->once())->method('getDiscover')->will($this->returnValue($this->discover));
     $this->store->expects($this->once())->method('getNonce')->will($this->returnValue(false));
     $this->createObjects();
     $association = new OpenID_Association(array('uri' => $this->opEndpointURL, 'expiresIn' => 600, 'created' => time(), 'assocType' => 'HMAC-SHA1', 'assocHandle' => '12345', 'sharedSecret' => '6789'));
     $this->message->set('openid.assoc_handle', '12345');
     $association->signMessage($this->message);
     $this->assertTrue($this->assertion->verifySignature($association));
     $this->message->set('openid.sig', 'foo');
     $this->assertFalse($this->assertion->verifySignature($association));
 }