|
4 | 4 |
|
5 | 5 | namespace SimpleSAML\OpenID\Jws\Factories; |
6 | 6 |
|
| 7 | +use SimpleSAML\OpenID\Algorithms\SignatureAlgorithmEnum; |
7 | 8 | use SimpleSAML\OpenID\Decorators\DateIntervalDecorator; |
8 | 9 | use SimpleSAML\OpenID\Factories\ClaimFactory; |
9 | 10 | use SimpleSAML\OpenID\Helpers; |
| 11 | +use SimpleSAML\OpenID\Jwk\JwkDecorator; |
10 | 12 | use SimpleSAML\OpenID\Jwks\Factories\JwksDecoratorFactory; |
11 | 13 | use SimpleSAML\OpenID\Jws\JwsDecoratorBuilder; |
12 | 14 | use SimpleSAML\OpenID\Jws\JwsVerifierDecorator; |
@@ -41,4 +43,31 @@ public function fromToken(string $token): ParsedJws |
41 | 43 | $this->claimFactory, |
42 | 44 | ); |
43 | 45 | } |
| 46 | + |
| 47 | + /** |
| 48 | + * @param array<non-empty-string,mixed> $payload |
| 49 | + * @param array<non-empty-string,mixed> $header |
| 50 | + * @throws \SimpleSAML\OpenID\Exceptions\JwsException |
| 51 | + */ |
| 52 | + public function fromData( |
| 53 | + JwkDecorator $signingKey, |
| 54 | + SignatureAlgorithmEnum $signatureAlgorithm, |
| 55 | + array $payload, |
| 56 | + array $header, |
| 57 | + ): ParsedJws { |
| 58 | + return new ParsedJws( |
| 59 | + $this->jwsDecoratorBuilder->fromData( |
| 60 | + $signingKey, |
| 61 | + $signatureAlgorithm, |
| 62 | + $payload, |
| 63 | + $header, |
| 64 | + ), |
| 65 | + $this->jwsVerifierDecorator, |
| 66 | + $this->jwksDecoratorFactory, |
| 67 | + $this->jwsSerializerManagerDecorator, |
| 68 | + $this->timestampValidationLeeway, |
| 69 | + $this->helpers, |
| 70 | + $this->claimFactory, |
| 71 | + ); |
| 72 | + } |
44 | 73 | } |
0 commit comments