1<?php
2/**
3 * This file is part of the FreeDSx LDAP package.
4 *
5 * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
6 *
7 * For the full copyright and license information, please view the LICENSE
8 * file that was distributed with this source code.
9 */
10
11namespace FreeDSx\Ldap\Protocol\Queue;
12
13use FreeDSx\Sasl\Exception\SaslException;
14use FreeDSx\Socket\Queue\Buffer;
15
16/**
17 * Used to wrap / unwrap messages after ASN.1 encoding, or prior to ASN.1 decoding.
18 *
19 * @author Chad Sikorra <Chad.Sikorra@gmail.com>
20 */
21interface MessageWrapperInterface
22{
23    /**
24     * Wrap the message after it is encode to ASN.1.
25     *
26     * @param string $message
27     * @return string
28     * @throws SaslException
29     */
30    public function wrap(string $message): string;
31
32    /**
33     * Unwrap the message before it is decoded to ASN.1.
34     *
35     * @param string $message
36     * @return Buffer
37     * @throws SaslException
38     */
39    public function unwrap(string $message): Buffer;
40}
41