PHP Class OneLogin_Saml2_Metadata

ファイルを表示 Open project: onelogin/php-saml Class Usage Examples

Public Methods

Method Description
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

Method Details

addX509KeyDescriptors() public static method

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
return string Metadata with KeyDescriptors

builder() public static method

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
return string SAML Metadata XML

signMetadata() public static method

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
return string Signed Metadata