示例#1
0
 /**
  * @param string               $msg
  * @param SignatureWriter|null $signature
  */
 protected function addSignatureToUrl(&$msg, SignatureWriter $signature = null)
 {
     /** @var $key XMLSecurityKey */
     $key = $signature ? $signature->getXmlSecurityKey() : null;
     if (null != $key) {
         $msg .= '&SigAlg=' . urlencode($key->type);
         $signature = $key->signData($msg);
         $msg .= '&Signature=' . urlencode(base64_encode($signature));
     }
 }
示例#2
0
 public function test_returns_set_key()
 {
     $writer = new SignatureWriter();
     $writer->setXmlSecurityKey($key = TestHelper::getXmlSecurityKeyMock($this));
     $this->assertSame($key, $writer->getXmlSecurityKey());
 }