本文整理汇总了PHP中SAML2_Utils::decryptElement方法的典型用法代码示例。如果您正苦于以下问题:PHP SAML2_Utils::decryptElement方法的具体用法?PHP SAML2_Utils::decryptElement怎么用?PHP SAML2_Utils::decryptElement使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SAML2_Utils
的用法示例。
在下文中一共展示了SAML2_Utils::decryptElement方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: decryptAttributes
public function decryptAttributes($key, array $blacklist = array())
{
if ($this->encryptedAttribute === null) {
return;
}
$attributes = $this->encryptedAttribute;
foreach ($attributes as $attributeEnc) {
/*Decrypt node <EncryptedAttribute>*/
$attribute = SAML2_Utils::decryptElement($attributeEnc->getElementsByTagName('EncryptedData')->item(0), $key, $blacklist);
if (!$attribute->hasAttribute('Name')) {
throw new Exception('Missing name on <saml:Attribute> element.');
}
$name = $attribute->getAttribute('Name');
if ($attribute->hasAttribute('NameFormat')) {
$nameFormat = $attribute->getAttribute('NameFormat');
} else {
$nameFormat = SAML2_Const::NAMEFORMAT_UNSPECIFIED;
}
if ($firstAttribute) {
$this->nameFormat = $nameFormat;
$firstAttribute = FALSE;
} else {
if ($this->nameFormat !== $nameFormat) {
$this->nameFormat = SAML2_Const::NAMEFORMAT_UNSPECIFIED;
}
}
if (!array_key_exists($name, $this->attributes)) {
$this->attributes[$name] = array();
}
$values = SAML2_Utils::xpQuery($attribute, './saml_assertion:AttributeValue');
foreach ($values as $value) {
$this->attributes[$name][] = trim($value->textContent);
}
}
}
示例2: getAssertion
/**
* Retrieve the assertion.
*
* @param XMLSecurityKey $inputKey The key we should use to decrypt the assertion.
* @param array $blacklist Blacklisted decryption algorithms.
* @return SAML2_Assertion The decrypted assertion.
*/
public function getAssertion(XMLSecurityKey $inputKey, array $blacklist = array())
{
$assertionXML = SAML2_Utils::decryptElement($this->encryptedData, $inputKey, $blacklist);
SAML2_Utils::getContainer()->debugMessage($assertionXML, 'decrypt');
return new SAML2_Assertion($assertionXML);
}
示例3: getAssertion
/**
* Retrieve the assertion.
*
* @param XMLSecurityKey $key The key we should use to decrypt the assertion.
* @return SAML2_Assertion The decrypted assertion.
*/
public function getAssertion(XMLSecurityKey $inputKey)
{
$assertionXML = SAML2_Utils::decryptElement($this->encryptedData, $inputKey);
return new SAML2_Assertion($assertionXML);
}
示例4: decryptNameId
/**
* Decrypt the NameID in the LogoutRequest.
*
* @param XMLSecurityKey $key The decryption key.
* @param array $blacklist Blacklisted decryption algorithms.
*/
public function decryptNameId(XMLSecurityKey $key, array $blacklist = array())
{
if ($this->encryptedNameId === NULL) {
/* No NameID to decrypt. */
return;
}
$nameId = SAML2_Utils::decryptElement($this->encryptedNameId, $key, $blacklist);
SAML2_Utils::getContainer()->debugMessage($nameId, 'decrypt');
$this->nameId = SAML2_Utils::parseNameId($nameId);
$this->encryptedNameId = NULL;
}
示例5: decryptNameId
/**
* Decrypt the NameID in the LogoutRequest.
*
* @param XMLSecurityKey $key The decryption key.
*/
public function decryptNameId(XMLSecurityKey $key)
{
if ($this->encryptedNameId === NULL) {
/* No NameID to decrypt. */
return;
}
$nameId = SAML2_Utils::decryptElement($this->encryptedNameId, $key);
$this->nameId = SAML2_Utils::parseNameId($nameId);
$this->encryptedNameId = NULL;
}
示例6: getAssertion
/**
* Retrieve the assertion.
*
* @param XMLSecurityKey $key The key we should use to decrypt the assertion.
* @return SAML2_Assertion The decrypted assertion.
*/
public function getAssertion(XMLSecurityKey $inputKey)
{
$assertionXML = SAML2_Utils::decryptElement($this->encryptedData, $inputKey);
SimpleSAML_Utilities::debugMessage($assertionXML, 'decrypt');
return new SAML2_Assertion($assertionXML);
}