CoreFiles by mySites.guru
SerialNumberValue.php35 lines, 923 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
f3fc1460f72ee27e36f8b0354a0b58f8
sha1
fc1b0722a873f1582281e0c85f87eb89bce653ca
sha256
ccd5b70f8c1e4a8641696a061781467ae813b0ac4a57abfb4af570819e548e60
<?php

declare(strict_types=1);

namespace SpomkyLabs\Pki\X501\ASN1\AttributeValue;

use SpomkyLabs\Pki\ASN1\Type\UnspecifiedType;
use SpomkyLabs\Pki\X501\ASN1\AttributeType;
use SpomkyLabs\Pki\X501\ASN1\AttributeValue\Feature\PrintableStringValue;

/**
 * 'serialNumber' attribute value.
 *
 * @see https://www.itu.int/ITU-T/formal-language/itu-t/x/x520/2012/SelectedAttributeTypes.html#SelectedAttributeTypes.serialNumber
 */
final class SerialNumberValue extends PrintableStringValue
{
    /**
     * @param string $value String value
     */
    protected function __construct(string $value)
    {
        parent::__construct(AttributeType::OID_SERIAL_NUMBER, $value);
    }

    public static function create(string $value): self
    {
        return new self($value);
    }

    public static function fromASN1(UnspecifiedType $el): self
    {
        return self::create($el->asPrintableString()->string());
    }
}

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.