CoreFiles by mySites.guru
ECDHSS.php44 lines, 1,072 bytes, from Joomla_6.2.0-rc1-Release_Candidate-Full_Package.zip
Raw History Compare with 6.1.4-rc1
md5
6c6eb8e900354047425f8a37a21e40b3
sha1
871616be813970e16b1d4d9f720db6417cce5697
sha256
4dcfca53373a73c6bfe2d536534232dbc5b444bb5a867548b5ef113b6134f889
<?php

declare(strict_types=1);

namespace Jose\Component\Encryption\Algorithm\KeyEncryption;

use Jose\Component\Core\JWK;
use LogicException;

final class ECDHSS extends AbstractECDH
{
    public function name(): string
    {
        return 'ECDH-SS';
    }

    /**
     * @param array<string, mixed> $complete_header
     * @param array<string, mixed> $additional_header_values
     */
    public function getAgreementKey(
        int $encryptionKeyLength,
        string $algorithm,
        JWK $recipientKey,
        ?JWK $senderKey,
        array $complete_header = [],
        array &$additional_header_values = []
    ): string {
        if ($senderKey === null) {
            throw new LogicException('The sender key shall be set');
        }
        $agreedKey = parent::getAgreementKey(
            $encryptionKeyLength,
            $algorithm,
            $recipientKey,
            $senderKey,
            $complete_header,
            $additional_header_values
        );
        unset($additional_header_values['epk']);

        return $agreedKey;
    }
}

The same content is in 135 releases, Joomla 5.1.0-beta1 to 6.2.1. See them all, or every version of this file.