CoreFiles by mySites.guru
Signature1.php45 lines, 1,065 bytes, from Joomla_6.2.1-Stable-Full_Package.zip
Raw History Compare with 6.2.0
md5
b3a484f88bbecdd0d8268e0c670ed770
sha1
57f67978cd07fe40cb3ba5ae16f52e92b0feed45
sha256
3cccd8d929a1d7c949d96ecb068315ebbfe2a46b580cea68728d6b76da45b835
<?php

declare(strict_types=1);

namespace Cose\Signature;

use CBOR\ByteStringObject;
use CBOR\ListObject;
use CBOR\TextStringObject;
use Stringable;

final class Signature1 implements Stringable
{
    public function __construct(
        private readonly ByteStringObject $protectedHeader,
        private readonly ByteStringObject $payload
    ) {
    }

    public function __toString(): string
    {
        $structure = new ListObject();
        $structure->add(new TextStringObject('Signature1'));
        $structure->add($this->protectedHeader);
        $structure->add(new ByteStringObject(''));
        $structure->add($this->payload);

        return (string) $structure;
    }

    public static function create(ByteStringObject $protectedHeader, ByteStringObject $payload): self
    {
        return new self($protectedHeader, $payload);
    }

    public function getProtectedHeader(): ByteStringObject
    {
        return $this->protectedHeader;
    }

    public function getPayload(): ByteStringObject
    {
        return $this->payload;
    }
}

The same content is in 30 releases, Joomla 6.1.0-alpha3 to 6.2.1. See them all, or every version of this file.