<?php
namespace Fifa\ConnectServiceBus\Sdk\Encryption;

use Fifa\ConnectServiceBus\Sdk\Encryption\Model\EncryptionResult;
use Fifa\ConnectServiceBus\Sdk\Exception\CryptographyException;
use Fifa\ConnectServiceBus\Sdk\Message\Message;

/**
 * Interface CryptographyAlgorithmInterface
 * @package Fifa\ConnectServiceBus\Sdk\Encryption
 */
interface CryptographyAlgorithmInterface
{
    /**
     * Algorithm version
     *
     * @return string
     */
    public function version(): string;

    /**
     * Encrypts data for specific queueIdentifier
     *
     * @param string|null $data - Data for encryption
     * @param string $queueIdentifier
     * @return EncryptionResult
     * @throws CryptographyException
     */
    public function encrypt(?string $data, string $queueIdentifier): EncryptionResult;

    /**
     * Decrypts data
     *
     * @param Message $message - Service Bus message with encrypted content
     * @return string
     * @throws CryptographyException
     */
    public function decrypt(Message $message): string;
}