xref: /plugin/pureldap/vendor/freedsx/sasl/src/FreeDSx/Sasl/Challenge/ChallengeInterface.php (revision 0b3fd2d31e4d1997548a8fbc53fa771027c4a47f)
1*0b3fd2d3SAndreas Gohr<?php
2*0b3fd2d3SAndreas Gohr
3*0b3fd2d3SAndreas Gohr/**
4*0b3fd2d3SAndreas Gohr * This file is part of the FreeDSx SASL package.
5*0b3fd2d3SAndreas Gohr *
6*0b3fd2d3SAndreas Gohr * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
7*0b3fd2d3SAndreas Gohr *
8*0b3fd2d3SAndreas Gohr * For the full copyright and license information, please view the LICENSE
9*0b3fd2d3SAndreas Gohr * file that was distributed with this source code.
10*0b3fd2d3SAndreas Gohr */
11*0b3fd2d3SAndreas Gohr
12*0b3fd2d3SAndreas Gohrnamespace FreeDSx\Sasl\Challenge;
13*0b3fd2d3SAndreas Gohr
14*0b3fd2d3SAndreas Gohruse FreeDSx\Sasl\Exception\SaslException;
15*0b3fd2d3SAndreas Gohruse FreeDSx\Sasl\SaslContext;
16*0b3fd2d3SAndreas Gohr
17*0b3fd2d3SAndreas Gohr/**
18*0b3fd2d3SAndreas Gohr * The challenge / response interface.
19*0b3fd2d3SAndreas Gohr *
20*0b3fd2d3SAndreas Gohr * @author Chad Sikorra <Chad.Sikorra@gmail.com>
21*0b3fd2d3SAndreas Gohr */
22*0b3fd2d3SAndreas Gohrinterface ChallengeInterface
23*0b3fd2d3SAndreas Gohr{
24*0b3fd2d3SAndreas Gohr    /**
25*0b3fd2d3SAndreas Gohr     * Generate the next response to send in the challenge. It takes two optional parameters:
26*0b3fd2d3SAndreas Gohr     *
27*0b3fd2d3SAndreas Gohr     *  - The last message received. Null if no message has been received yet.
28*0b3fd2d3SAndreas Gohr     *  - An array of options used for generating the next message.
29*0b3fd2d3SAndreas Gohr     *
30*0b3fd2d3SAndreas Gohr     * The SaslContext returned indicates various aspects of the state of the challenge, including the response.
31*0b3fd2d3SAndreas Gohr     *
32*0b3fd2d3SAndreas Gohr     * @throws SaslException
33*0b3fd2d3SAndreas Gohr     */
34*0b3fd2d3SAndreas Gohr    public function challenge(?string $received = null, array $options = []): SaslContext;
35*0b3fd2d3SAndreas Gohr}
36