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\Security; 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 security layer interface. Security layers are responsible for any integrity / confidentiality provided by the 19*0b3fd2d3SAndreas Gohr * specific mechanisms. 20*0b3fd2d3SAndreas Gohr * 21*0b3fd2d3SAndreas Gohr * @author Chad Sikorra <Chad.Sikorra@gmail.com> 22*0b3fd2d3SAndreas Gohr */ 23*0b3fd2d3SAndreas Gohrinterface SecurityLayerInterface 24*0b3fd2d3SAndreas Gohr{ 25*0b3fd2d3SAndreas Gohr /** 26*0b3fd2d3SAndreas Gohr * Wraps / Installs the security layer for a specific SASL context over a data stream. 27*0b3fd2d3SAndreas Gohr * 28*0b3fd2d3SAndreas Gohr * @throws SaslException 29*0b3fd2d3SAndreas Gohr */ 30*0b3fd2d3SAndreas Gohr public function wrap(string $data, SaslContext $context): string; 31*0b3fd2d3SAndreas Gohr 32*0b3fd2d3SAndreas Gohr /** 33*0b3fd2d3SAndreas Gohr * Unwraps / uninstalls the security layer for a specific SASL context from a data stream. 34*0b3fd2d3SAndreas Gohr * 35*0b3fd2d3SAndreas Gohr * @throws SaslException 36*0b3fd2d3SAndreas Gohr */ 37*0b3fd2d3SAndreas Gohr public function unwrap(string $data, SaslContext $context): string; 38*0b3fd2d3SAndreas Gohr} 39