# \OneLogin_Saml2_Metadata

Metadata lib of PHP Toolkit

## Summary

Methods
Properties
Constants
builder()
signMetadata()
addX509KeyDescriptors()
No public properties found
TIME_VALID
TIME_CACHED
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

File
  Metadata.php
Package
  Default
Class hierarchy
  \OneLogin_Saml2_Metadata

## Tags

None found

## Constants

### TIME_VALID

    TIME_VALID

#

## Tags

None found

### TIME_CACHED

    TIME_CACHED

#

## Tags

None found

## Methods

### builder()

    builder(array  $sp, boolean|string  $authnsign = false, boolean|string  $wsign = false, \DateTime|null  $validUntil = null, integer|null  $cacheDuration = null, array  $contacts = array(), array  $organization = array(), array  $attributes = array()) : string

Generates the metadata of the SP based on the settings

#### Parameters

array | $sp | The SP data
boolean|string | $authnsign | authnRequestsSigned attribute
boolean|string | $wsign | wantAssertionsSigned attribute
\DateTime|null | $validUntil | Metadata's valid time
integer|null | $cacheDuration | Duration of the cache in seconds
array | $contacts | Contacts info
array | $organization | Organization ingo
array | $attributes |

#### Returns

string —

SAML Metadata XML

#

static

## Tags

None found

### signMetadata()

    signMetadata(string  $metadata, string  $key, string  $cert, string  $signAlgorithm = \XMLSecurityKey::RSA_SHA1, string  $digestAlgorithm = \XMLSecurityDSig::SHA1) : string

Signs the metadata with the key/cert provided

#### Parameters

string | $metadata | SAML Metadata XML
string | $key | x509 key
string | $cert | x509 cert
string | $signAlgorithm | Signature algorithm method
string | $digestAlgorithm | Digest algorithm method

#### Throws

\Exception

#### Returns

string —

Signed Metadata

#

static

## Tags

None found

### addX509KeyDescriptors()

    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

#### Parameters

string | $metadata | SAML Metadata XML
string | $cert | x509 cert
boolean | $wantsEncrypted | Whether to include the KeyDescriptor for encryption

#### Throws

\Exception

#### Returns

string —

Metadata with KeyDescriptors

#

static

## Tags

None found

### Metadata.php