xref: /plugin/pureldap/vendor/freedsx/asn1/src/FreeDSx/Asn1/Encoders.php (revision dad993c57a70866aa1db59c43f043769c2eb7ed0)
1*0b3fd2d3SAndreas Gohr<?php
2*0b3fd2d3SAndreas Gohr/**
3*0b3fd2d3SAndreas Gohr * This file is part of the FreeDSx ASN1 package.
4*0b3fd2d3SAndreas Gohr *
5*0b3fd2d3SAndreas Gohr * (c) Chad Sikorra <Chad.Sikorra@gmail.com>
6*0b3fd2d3SAndreas Gohr *
7*0b3fd2d3SAndreas Gohr * For the full copyright and license information, please view the LICENSE
8*0b3fd2d3SAndreas Gohr * file that was distributed with this source code.
9*0b3fd2d3SAndreas Gohr */
10*0b3fd2d3SAndreas Gohr
11*0b3fd2d3SAndreas Gohrnamespace FreeDSx\Asn1;
12*0b3fd2d3SAndreas Gohr
13*0b3fd2d3SAndreas Gohruse FreeDSx\Asn1\Encoder\BerEncoder;
14*0b3fd2d3SAndreas Gohruse FreeDSx\Asn1\Encoder\DerEncoder;
15*0b3fd2d3SAndreas Gohr
16*0b3fd2d3SAndreas Gohr/**
17*0b3fd2d3SAndreas Gohr * Simple factory methods for easily getting an encoder instance for encoding / decoding.
18*0b3fd2d3SAndreas Gohr *
19*0b3fd2d3SAndreas Gohr * @author Chad Sikorra <Chad.Sikorra@gmail.com>
20*0b3fd2d3SAndreas Gohr */
21*0b3fd2d3SAndreas Gohrclass Encoders
22*0b3fd2d3SAndreas Gohr{
23*0b3fd2d3SAndreas Gohr    /**
24*0b3fd2d3SAndreas Gohr     * @param array $options
25*0b3fd2d3SAndreas Gohr     * @return BerEncoder
26*0b3fd2d3SAndreas Gohr     */
27*0b3fd2d3SAndreas Gohr    public static function ber(array $options = []): BerEncoder
28*0b3fd2d3SAndreas Gohr    {
29*0b3fd2d3SAndreas Gohr        return new BerEncoder($options);
30*0b3fd2d3SAndreas Gohr    }
31*0b3fd2d3SAndreas Gohr
32*0b3fd2d3SAndreas Gohr    /**
33*0b3fd2d3SAndreas Gohr     * @param array $options
34*0b3fd2d3SAndreas Gohr     * @return DerEncoder
35*0b3fd2d3SAndreas Gohr     */
36*0b3fd2d3SAndreas Gohr    public static function der(array $options = []): DerEncoder
37*0b3fd2d3SAndreas Gohr    {
38*0b3fd2d3SAndreas Gohr        return new DerEncoder($options);
39*0b3fd2d3SAndreas Gohr    }
40*0b3fd2d3SAndreas Gohr}
41