CoreFiles by mySites.guru
RelativeDistinguishedName.php50 lines, 1,642 bytes, from Joomla_4.4.6-Stable-Full_Package.zip
Raw History Compare with 4.4.5
md5
c5ccbb830a429de0fe4f86e9949d1e7f
sha1
89c70c23472fa4a86e86637d79e1a0076ceece18
sha256
cfdf83caee58ad9fe72aa41c72365155c3451f986473407203b5f1d1d095a5d3
<?php
/*
 * This file is part of the PHPASN1 library.
 *
 * Copyright © Friedrich Große <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace FG\ASN1\Composite;

use FG\ASN1\Exception\NotImplementedException;
use FG\ASN1\ASNObject;
use FG\ASN1\Universal\Set;

class RelativeDistinguishedName extends Set
{
    /**
     * @param string|\FG\ASN1\Universal\ObjectIdentifier $objIdentifierString
     * @param \FG\ASN1\ASNObject $value
     */
    public function __construct($objIdentifierString, ASNObject $value)
    {
        // TODO: This does only support one element in the RelativeDistinguishedName Set but it it is defined as follows:
        // RelativeDistinguishedName ::= SET SIZE (1..MAX) OF AttributeTypeAndValue
        parent::__construct(new AttributeTypeAndValue($objIdentifierString, $value));
    }

    public function getContent()
    {
        /** @var \FG\ASN1\ASNObject $firstObject */
        $firstObject = $this->children[0];
        return $firstObject->__toString();
    }

    /**
     * At the current version this code can not work since the implementation of Construct requires
     * the class to support a constructor without arguments.
     *
     * @deprecated this function is not yet implemented! Feel free to submit a pull request on github
     * @param string $binaryData
     * @param int $offsetIndex
     * @throws NotImplementedException
     */
    public static function fromBinary(&$binaryData, &$offsetIndex = 0)
    {
        throw new NotImplementedException();
    }
}

The same content is in 137 releases, Joomla 4.0.0-beta to 5.0.0-beta2. See them all, or every version of this file.