lib/3rdParty/composer/spomky-labs/pki-framework/src/X501/MatchingRule/CaseIgnoreMatch.php
raw symbols SCIP| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace SpomkyLabs\Pki\X501\MatchingRule; |
| 6 | |
| 7 | use SpomkyLabs\Pki\X501\StringPrep\StringPreparer; |
| 8 | |
| 9 | /** |
| 10 | * Implements 'caseIgnoreMatch' matching rule. |
| 11 | * |
| 12 | * @see https://tools.ietf.org/html/rfc4517#section-4.2.11 |
| 13 | */ |
| 14 | final class CaseIgnoreMatch extends StringPrepMatchingRule |
| 15 | { |
| 16 | /** |
| 17 | * @param int $stringType ASN.1 string type tag |
| 18 | */ |
| 19 | private function __construct(int $stringType) |
| 20 | { |
| 21 | parent::__construct( |
| 22 | StringPreparer::forStringType($stringType)->withCaseFolding(true) |
| 23 | ); |
| 24 | } |
| 25 | |
| 26 | public static function create(int $stringType): self |
| 27 | { |
| 28 | return new self($stringType); |
| 29 | } |
| 30 | } |