forked from Spomky-Labs/jose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
VerifierInterface.php
55 lines (49 loc) · 2.27 KB
/
VerifierInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2017 Spomky-Labs
*
* This software may be modified and distributed under the terms
* of the MIT license. See the LICENSE file for details.
*/
namespace Jose;
/**
* Verifier Interface.
*/
interface VerifierInterface
{
/**
/**
* Signer constructor.
*
* @param string[]|\Jose\Algorithm\SignatureAlgorithmInterface[] $signature_algorithms
*
* @return \Jose\VerifierInterface
*/
public static function createVerifier(array $signature_algorithms);
/**
* @return string[]
*/
public function getSupportedSignatureAlgorithms();
/**
* Verify the signature of the input.
* The input must be a valid JWS. This method is usually called after the "load" method.
*
* @param \Jose\Object\JWSInterface $input a JWS object
* @param \Jose\Object\JWKInterface $jwk The signature will be verified using keys in the key set
* @param null|string $detached_payload If not null, the value must be the detached payload encoded in Base64 URL safe. If the input contains a payload, throws an exception.
* @param null|int $signature_index If the JWS has been verified, an integer that represents the ID of the signature is set
*/
public function verifyWithKey(Object\JWSInterface $input, Object\JWKInterface $jwk, $detached_payload = null, &$signature_index = null);
/**
* Verify the signature of the input.
* The input must be a valid JWS. This method is usually called after the "load" method.
*
* @param \Jose\Object\JWSInterface $jws a JWS object
* @param \Jose\Object\JWKSetInterface $jwk_set The signature will be verified using keys in the key set
* @param null|string $detached_payload If not null, the value must be the detached payload encoded in Base64 URL safe. If the input contains a payload, throws an exception.
* @param null|int $signature_index If the JWS has been verified, an integer that represents the ID of the signature is set
*/
public function verifyWithKeySet(Object\JWSInterface $jws, Object\JWKSetInterface $jwk_set, $detached_payload = null, &$signature_index = null);
}