Skip to content

Commit

Permalink
Words
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Bonnell committed Dec 28, 2023
1 parent 0b71315 commit 98a338c
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# pyasn1-fasder
# pyasn1-fasder


[![PyPI](https://img.shields.io/pypi/v/pyasn1-fasder)](https://pypi.org/project/pyasn1-fasder)
[![Python Versions](https://img.shields.io/pypi/pyversions/pyasn1-fasder)](https://pypi.org/project/pyasn1-fasder/)
[![Build status](https://github.com/cbonnell/pyasn1-fasder/actions/workflows/CI.yml/badge.svg)](https://github.com/cbonnell/pyasn1-fasder/actions/workflows/CI.yml)
[![GitHub license](https://img.shields.io/pypi/l/pyasn1-fasder)](https://raw.githubusercontent.com/cbonnell/pyasn1-fasder/main/LICENSE)

pyasn1-fasder is a DER decoder for pyasn1 with a focus on performance (relative to the decoder included with pyasn1) and
checking the correctness of encoding. This decoder is more pedantic than most other decoders in terms of flagging DER
encoding errors, and this behavior is unlikely to change.

## Installation

`pip install pyasn1-fasder`

## Usage

pyasn1-fasder exposes a single function: `decode_der`. The signature and return type are the same as the pyasn1 `decode` function, as it is intended to be a drop-in replacement of `pyasn1.codec.der.decoder.decode`.

## Limitations

* There is no encoding counterpart.
* Trailing octets present after the `substrate` TLV are not tolerated and will result in an exception being raised. In other words, the `rest` component of the tuple return value will always be an empty `bytes` object.
* Schemaless decoding is not supported. In other words, a non-`None` `asn1Spec` must be passed to `decode_der`.
* `Set`s with `namedValues` are not supported. These are (almost?) never used in cryptography standards, but support can be added if there are valid use cases.
* The pedantic checks for correctness of encoding cannot be disabled.

## Bugs?

Please create a Github issue.

## Contributing

Contributions for bug fixes and new features are welcome.
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,16 @@ build-backend = "maturin"
name = "pyasn1-fasder"
requires-python = ">=3.8"
classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = ["version"]

Expand Down

0 comments on commit 98a338c

Please sign in to comment.