CoreFiles by mySites.guru
X400Address.php48 lines, 1,159 bytes, from Joomla_5.3.0-beta2-Beta-Full_Package.zip
Raw History Compare with 5.3.0-beta1
md5
4a4a57195dc66661f53909de6ba55d63
sha1
af1ffa7ebb16d153416faf9074fdf33795f74615
sha256
6fce773acfdeea764f21b28320cce397ae5cdd0153b5ffc022222239f8676ffe
<?php

declare(strict_types=1);

namespace SpomkyLabs\Pki\X509\GeneralName;

use SpomkyLabs\Pki\ASN1\Type\Constructed\Sequence;
use SpomkyLabs\Pki\ASN1\Type\Tagged\ImplicitlyTaggedType;
use SpomkyLabs\Pki\ASN1\Type\TaggedType;
use SpomkyLabs\Pki\ASN1\Type\UnspecifiedType;

/**
 * Implements *x400Address* CHOICE type of *GeneralName*.
 *
 * Currently acts as a parking object for decoding.
 *
 * @see https://tools.ietf.org/html/rfc5280#section-4.2.1.6
 *
 * @todo Implement ORAddress type
 */
final class X400Address extends GeneralName
{
    protected function __construct(
        private readonly Sequence $element
    ) {
        parent::__construct(self::TAG_X400_ADDRESS);
    }

    public static function create(Sequence $element): self
    {
        return new self($element);
    }

    public static function fromChosenASN1(UnspecifiedType $el): self
    {
        return self::create($el->asSequence());
    }

    public function string(): string
    {
        return bin2hex($this->element->toDER());
    }

    protected function choiceASN1(): TaggedType
    {
        return ImplicitlyTaggedType::create($this->tag, $this->element);
    }
}

The same content is in 158 releases, Joomla 5.0.0-alpha1 to 6.3.0-alpha1. See them all, or every version of this file.