# OneLogin_Saml2_Metadata

Metadata lib of OneLogin PHP Toolkit

### Methods

## Generates the metadata of the SP based on the settings

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

static

### Arguments

#### $sp

`string`

The SP data

#### $authnsign

`string`

authnRequestsSigned attribute

#### $wsign

`string`

wantAssertionsSigned attribute

#### $validUntil

`\DateTime`

Metadata's valid time

#### $cacheDuration

`\Timestamp`

Duration of the cache in seconds

#### $contacts

`array`

Contacts info

#### $organization

`array`

Organization ingo

### Response

`string`

SAML Metadata XML

## Signs the metadata with the key/cert provided

    signMetadata(string $metadata, string $key, string $cert) : string

static

### Arguments

#### $metadata

`string`

SAML Metadata XML

#### $key

`string`

x509 key

#### $cert

`string`

x509 cert

### Response

`string`

Signed Metadata

## Adds the x509 descriptors (sign/encriptation) to the metadata The same cert will be used for sign/encrypt

    addX509KeyDescriptors(string $metadata, string $cert, boolean $wantsEncrypted) : string

static

### Arguments

#### $metadata

`string`

SAML Metadata XML

#### $cert

`string`

x509 cert

#### $wantsEncrypted

`boolean`

Whether to include the KeyDescriptor for encryption

### Response

`string`

Metadata with KeyDescriptors

### Constants

## TIME_VALID

    TIME_VALID

## TIME_CACHED

    TIME_CACHED