Download the PHP package afk11/phpasn1 without Composer
On this page you can find all versions of the php package afk11/phpasn1. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download afk11/phpasn1
More information about afk11/phpasn1
Files in afk11/phpasn1
Package phpasn1
Short Description A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules.
License MIT
Homepage https://github.com/FGrosse/PHPASN1
Informations about the package phpasn1
PHPASN1
A PHP Framework that allows you to encode and decode arbitrary ASN.1 structures using the ITU-T X.690 Encoding Rules. This encoding is very frequently used in X.509 PKI environments or the communication between heterogeneous computer systems.
The API allows you to encode ASN.1 structures to create binary data such as certificate signing requests (CSR), X.509 certificates or certificate revocation lists (CRL). PHPASN1 can also read BER encoded binary data into separate PHP objects that can be manipulated by the user and reencoded afterwards.
The changelog can now be found at CHANGELOG.md.
Dependencies
PHPASN1 requires at least PHP 7.0
and either the gmp
or bcmath
extension.
Support for older PHP versions (i.e. PHP 5.6) was dropped starting with v2.0
.
If you must use an outdated PHP version consider using PHPASN v1.5.
For the loading of object identifier names directly from the web curl is used.
Installation
The preferred way to install this library is to rely on Composer:
Usage
Encoding ASN.1 Structures
PHPASN1 offers you a class for each of the implemented ASN.1 universal types. The constructors should be pretty self explanatory so you should have no big trouble getting started. All data will be encoded using DER encoding
Decoding binary data
Decoding BER encoded binary data is just as easy as encoding it:
If you already know exactly how your expected data should look like you can use the FG\ASN1\TemplateParser
:
You can use this function to make sure your data has exactly the format you are expecting.
Navigating decoded data
All constructed classes (i.e. Sequence
and Set
) can be navigated by array access or using an iterator.
You can find examples
here,
here and
here.
Give me more examples!
To see some example usage of the API classes or some generated output check out the examples.
How do I contribute?
If you found an issue or have a question submit a github issue with detailed information.
In case you already know what caused the issue and feel in the mood to fix it, your code contributions are always welcome. Just fork the repository, implement your changes and make sure that you covered everything with tests. Afterwards submit a pull request via github and be a little patient :) I usually try to comment and/or merge as soon as possible.
Mailing list
New features or questions can be discussed in this google group/mailing list.
Thanks
To all contributors so far!
License
This library is distributed under the MIT License.
All versions of phpasn1 with dependencies
ext-gmp Version *