当前位置: 首页>>代码示例>>PHP>>正文


PHP SAML2_Utils::createKeyDescriptor方法代码示例

本文整理汇总了PHP中SAML2_Utils::createKeyDescriptor方法的典型用法代码示例。如果您正苦于以下问题:PHP SAML2_Utils::createKeyDescriptor方法的具体用法?PHP SAML2_Utils::createKeyDescriptor怎么用?PHP SAML2_Utils::createKeyDescriptor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SAML2_Utils的用法示例。


在下文中一共展示了SAML2_Utils::createKeyDescriptor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addX509KeyDescriptor

 /**
  * Add a KeyDescriptor with an X509 certificate.
  *
  * @param SAML2_XML_md_RoleDescriptor $rd  The RoleDescriptor the certificate should be added to.
  * @param string $use  The value of the use-attribute.
  * @param string $x509data  The certificate data.
  */
 private function addX509KeyDescriptor(SAML2_XML_md_RoleDescriptor $rd, $use, $x509data)
 {
     assert('in_array($use, array("encryption", "signing"), TRUE)');
     assert('is_string($x509data)');
     $keyDescriptor = SAML2_Utils::createKeyDescriptor($x509data);
     $keyDescriptor->use = $use;
     $rd->KeyDescriptor[] = $keyDescriptor;
 }
开发者ID:hooplad,项目名称:saml-20-single-sign-on,代码行数:15,代码来源:SAMLBuilder.php

示例2: array

    $kd = SAML2_Utils::createKeyDescriptor($certData);
    $kd->use = 'encryption';
    $sp->KeyDescriptor[] = $kd;
    $keys[] = array('type' => 'X509Certificate', 'signing' => TRUE, 'encryption' => TRUE, 'X509Certificate' => $certInfo['certData']);
} else {
    $hasNewCert = FALSE;
}
$certInfo = SimpleSAML_Utilities::loadPublicKey($spconfig);
if ($certInfo !== NULL && array_key_exists('certData', $certInfo)) {
    $certData = $certInfo['certData'];
    $kd = SAML2_Utils::createKeyDescriptor($certData);
    $kd->use = 'signing';
    $sp->KeyDescriptor[] = $kd;
    if (!$hasNewCert) {
        /* Don't include the old certificate for encryption when we have a newer certificate. */
        $kd = SAML2_Utils::createKeyDescriptor($certData);
        $kd->use = 'encryption';
        $sp->KeyDescriptor[] = $kd;
    }
    $keys[] = array('type' => 'X509Certificate', 'signing' => TRUE, 'encryption' => $hasNewCert ? FALSE : TRUE, 'X509Certificate' => $certInfo['certData']);
} else {
    $certData = NULL;
}
$name = $spconfig->getLocalizedString('name', NULL);
$attributes = $spconfig->getArray('attributes', array());
if ($name !== NULL && !empty($attributes)) {
    /* We have everything necessary to add an AttributeConsumingService. */
    $acs = new SAML2_XML_md_AttributeConsumingService();
    $sp->AttributeConsumingService[] = $acs;
    $acs->index = 0;
    $acs->ServiceName = $name;
开发者ID:filonuse,项目名称:fedlab,代码行数:31,代码来源:metadata.php


注:本文中的SAML2_Utils::createKeyDescriptor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。