Skip to content
This repository has been archived by the owner on Dec 30, 2020. It is now read-only.

JKU and X5U key sets added #144

Merged
merged 4 commits into from
Oct 17, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Documentation updated
  • Loading branch information
Spomky committed Oct 17, 2016
commit 8f13413f9521d376f8034821bc5dd41d8cde9b96
19 changes: 16 additions & 3 deletions doc/object/jwkset.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,24 @@ To avoid calls to a server each time you need a certificate, the `createFromJKU`
use Jose\Factory\JWKFactory;

$cacheItemPool = YourValidCacheItemPool //An instance of a class that implements Psr\Cache\CacheItemPoolInterface
$ttl = 300; //Cache lifetime in seconds. Default is 86400 = 24 hrs.
$ttl = 300; //Cache lifetime in seconds. Default is 86400 = 24 hrs. 0 means the cache never expires (not recommended).

$jwk_set = JWKFactory::createFromJKU('http://www.example.com/certs', false, $cacheItemPool, $ttl);
```

### HTTP Connection Support

During tests for example, it is useful to retrieve keys using a non-encrypted connection (HTTP).
From the version 6.1 of this library, it is possible to allow URLs with the `http://` scheme.

You just have to set the last argument as `true`.

```php
use Jose\Factory\JWKFactory;

$jwk_set = JWKFactory::createFromJKU('http://www.example.com/certs', false, null, 0, true);
```


## Create a Key from a X509 Certificate Url (`x5u`)

Expand All @@ -140,9 +153,9 @@ use Jose\Factory\JWKFactory;
$jwk_set = JWKFactory::createFromX5U('https://www.googleapis.com/oauth2/v1/certs');
```

### Unsecured Connections and Caching Support
### Unsecured, HTTP Connections and Caching Support

The method `createFromX5U` supports the same arguments as the method `createFromJKU` for unsecured connections or caching support.
The method `createFromX5U` supports the same arguments as the method `createFromJKU` for unsecured, HTTP connections or caching support.

## Create a Key Set with Random keys

Expand Down