PHP Класс OneLogin_Saml2_Metadata

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
addX509KeyDescriptors ( string $metadata, string $cert, boolean $wantsEncrypted = true ) : string Adds the x509 descriptors (sign/encriptation) to the metadata The same cert will be used for sign/encrypt
builder ( array $sp, boolean | string $authnsign = false, boolean | string $wsign = false, DateTime | null $validUntil = null, integer | null $cacheDuration = null, array $contacts = [], array $organization = [], array $attributes = [] ) : string Generates the metadata of the SP based on the settings
signMetadata ( string $metadata, string $key, string $cert, $signAlgorithm = XMLSecurityKey::RSA_SHA1 ) : string Signs the metadata with the key/cert provided

Описание методов

addX509KeyDescriptors() публичный статический Метод

Adds the x509 descriptors (sign/encriptation) to the metadata The same cert will be used for sign/encrypt
public static addX509KeyDescriptors ( string $metadata, string $cert, boolean $wantsEncrypted = true ) : string
$metadata string SAML Metadata XML
$cert string x509 cert
$wantsEncrypted boolean Whether to include the KeyDescriptor for encryption
Результат string Metadata with KeyDescriptors

builder() публичный статический Метод

Generates the metadata of the SP based on the settings
public static builder ( array $sp, boolean | string $authnsign = false, boolean | string $wsign = false, DateTime | null $validUntil = null, integer | null $cacheDuration = null, array $contacts = [], array $organization = [], array $attributes = [] ) : string
$sp array The SP data
$authnsign boolean | string authnRequestsSigned attribute
$wsign boolean | string wantAssertionsSigned attribute
$validUntil DateTime | null Metadata's valid time
$cacheDuration integer | null Duration of the cache in seconds
$contacts array Contacts info
$organization array Organization ingo
$attributes array
Результат string SAML Metadata XML

signMetadata() публичный статический Метод

Signs the metadata with the key/cert provided
public static signMetadata ( string $metadata, string $key, string $cert, $signAlgorithm = XMLSecurityKey::RSA_SHA1 ) : string
$metadata string SAML Metadata XML
$key string x509 key
$cert string x509 cert
Результат string Signed Metadata