Skip to content

Commit

Permalink
Update reference.rst:load_der_x509_certificate to note ValueError rai…
Browse files Browse the repository at this point in the history
…sed (#12364)

* Update reference.rst:load_der_x509_certificate to note error raised

It raises the error and therefore should be noted in the documentation.

```
>>> x509.load_der_x509_certificate(b64.b64decode("foobar".encode()))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: error parsing asn1 value: ParseError { kind: InvalidLength }
```

* Update docs/x509/reference.rst

Thanks!

Co-authored-by: Alex Gaynor <[email protected]>

---------

Co-authored-by: Alex Gaynor <[email protected]>
  • Loading branch information
ohemorange and alex authored Jan 30, 2025
1 parent fac5a99 commit 3b689ce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/x509/reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ Loading Certificates

:returns: An instance of :class:`~cryptography.x509.Certificate`.

:raises ValueError: If a certificate cannot be parsed from the provided
data.

Loading Certificate Revocation Lists
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 3b689ce

Please sign in to comment.