Submit
Path:
~
/
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
platform360
/
vendor
/
web-token
/
jwt-library
/
KeyManagement
/
File Content:
X5UFactory.php
<?php declare (strict_types=1); namespace Platform360\Jose\Component\KeyManagement; use Platform360\Jose\Component\Core\JWK; use Platform360\Jose\Component\Core\JWKSet; use Platform360\Jose\Component\Core\Util\JsonConverter; use Platform360\Jose\Component\KeyManagement\KeyConverter\KeyConverter; use RuntimeException; use function assert; use function is_array; use function is_string; class X5UFactory extends UrlKeySetFactory { /** * This method will try to fetch the url a retrieve the key set. Throws an exception in case of failure. * * @param array<string, string|string[]> $header */ public function loadFromUrl(string $url, array $header = []) : JWKSet { $content = $this->getContent($url, $header); $data = JsonConverter::decode($content); if (!is_array($data)) { throw new RuntimeException('Invalid content.'); } $keys = []; foreach ($data as $kid => $cert) { assert(is_string($cert), 'Invalid content.'); if (!\str_contains($cert, '-----BEGIN CERTIFICATE-----')) { $cert = '-----BEGIN CERTIFICATE-----' . "\n" . $cert . "\n" . '-----END CERTIFICATE-----'; } $jwk = KeyConverter::loadKeyFromCertificate($cert); if (is_string($kid)) { $jwk['kid'] = $kid; $keys[$kid] = new JWK($jwk); } else { $keys[] = new JWK($jwk); } } return new JWKSet($keys); } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
INFO
Name
Size
Permission
Action
Analyzer
---
0755
KeyConverter
---
0755
JKUFactory.php
741 bytes
0644
JWKFactory.php
9531 bytes
0644
UrlKeySetFactory.php
2040 bytes
0644
X5UFactory.php
1524 bytes
0644
N4ST4R_ID | Naxtarrr