Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for converting multiple JWKs #5

Merged
merged 3 commits into from
Mar 1, 2020

Conversation

musa11971
Copy link
Contributor

This PR introduces a new convenience method that converts an array of JWKs to PEM, called multipleToPem.

Here's a quick look at how it works:

use CoderCat\JWKToPEM\JWKConverter;

// Retrieve Apple's public keys in JWK format
$appleKeys = json_decode(file_get_contents('https://appleid.apple.com/auth/keys'), true);

// Convert the keys to PEM
$converter = new JWKConverter();
$pems = $converter->multipleToPem($appleKeys['keys']);

// $pems is now an array of (string) PEMs

@acodercat acodercat merged commit 2113579 into acodercat:master Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants