From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Mon, 27 May 2024 13:08:29 +0200 Subject: 2024-02-19 upstream --- .../lib/ASN1/Composite/AttributeTypeAndValue.php | 70 +++++++-------- .../phpasn1/lib/ASN1/Composite/RDNString.php | 74 +++++++-------- .../ASN1/Composite/RelativeDistinguishedName.php | 100 ++++++++++----------- 3 files changed, 122 insertions(+), 122 deletions(-) (limited to 'vendor/fgrosse/phpasn1/lib/ASN1/Composite') diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php index 3f4027c..a80e1a3 100644 --- a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/AttributeTypeAndValue.php @@ -1,35 +1,35 @@ - - * - * 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\ASNObject; -use FG\ASN1\Universal\Sequence; -use FG\ASN1\Universal\ObjectIdentifier; - -class AttributeTypeAndValue extends Sequence -{ - /** - * @param ObjectIdentifier|string $objIdentifier - * @param \FG\ASN1\ASNObject $value - */ - public function __construct($objIdentifier, ASNObject $value) - { - if ($objIdentifier instanceof ObjectIdentifier == false) { - $objIdentifier = new ObjectIdentifier($objIdentifier); - } - parent::__construct($objIdentifier, $value); - } - - public function __toString() - { - return $this->children[0].': '.$this->children[1]; - } -} + + * + * 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\ASNObject; +use FG\ASN1\Universal\Sequence; +use FG\ASN1\Universal\ObjectIdentifier; + +class AttributeTypeAndValue extends Sequence +{ + /** + * @param ObjectIdentifier|string $objIdentifier + * @param \FG\ASN1\ASNObject $value + */ + public function __construct($objIdentifier, ASNObject $value) + { + if ($objIdentifier instanceof ObjectIdentifier == false) { + $objIdentifier = new ObjectIdentifier($objIdentifier); + } + parent::__construct($objIdentifier, $value); + } + + public function __toString() + { + return $this->children[0].': '.$this->children[1]; + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php index e95e7ac..774c7d9 100644 --- a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RDNString.php @@ -1,37 +1,37 @@ - - * - * 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\Universal\PrintableString; -use FG\ASN1\Universal\IA5String; -use FG\ASN1\Universal\UTF8String; - -class RDNString extends RelativeDistinguishedName -{ - /** - * @param string|\FG\ASN1\Universal\ObjectIdentifier $objectIdentifierString - * @param string|\FG\ASN1\ASNObject $value - */ - public function __construct($objectIdentifierString, $value) - { - if (PrintableString::isValid($value)) { - $value = new PrintableString($value); - } else { - if (IA5String::isValid($value)) { - $value = new IA5String($value); - } else { - $value = new UTF8String($value); - } - } - - parent::__construct($objectIdentifierString, $value); - } -} + + * + * 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\Universal\PrintableString; +use FG\ASN1\Universal\IA5String; +use FG\ASN1\Universal\UTF8String; + +class RDNString extends RelativeDistinguishedName +{ + /** + * @param string|\FG\ASN1\Universal\ObjectIdentifier $objectIdentifierString + * @param string|\FG\ASN1\ASNObject $value + */ + public function __construct($objectIdentifierString, $value) + { + if (PrintableString::isValid($value)) { + $value = new PrintableString($value); + } else { + if (IA5String::isValid($value)) { + $value = new IA5String($value); + } else { + $value = new UTF8String($value); + } + } + + parent::__construct($objectIdentifierString, $value); + } +} diff --git a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php index 4185f41..c9a23cb 100644 --- a/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php +++ b/vendor/fgrosse/phpasn1/lib/ASN1/Composite/RelativeDistinguishedName.php @@ -1,50 +1,50 @@ - - * - * 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(); - } -} + + * + * 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(); + } +} -- cgit v1.2.3