<?php
 declare(strict_types=1); namespace SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\Cipher; use SpomkyLabs\Pki\ASN1\Type\UnspecifiedType; use SpomkyLabs\Pki\CryptoTypes\AlgorithmIdentifier\SpecificAlgorithmIdentifier; use UnexpectedValueException; final class AES256CBCAlgorithmIdentifier extends AESCBCAlgorithmIdentifier { protected function __construct(?string $iv = null) { parent::__construct(self::OID_AES_256_CBC, $iv); } public static function create(?string $iv = null): self { return new self($iv); } public static function fromASN1Params(?UnspecifiedType $params = null): SpecificAlgorithmIdentifier { if (! isset($params)) { throw new UnexpectedValueException('No parameters.'); } $iv = $params->asOctetString() ->string(); return new static($iv); } public function name(): string { return 'aes256-CBC'; } public function keySize(): int { return 32; } } 