Address code review regarding style and gc
- Use keyword arguments for x509.BasicConstraints in several places
- Use SHA256 instead of SHA1 in documented examples
- Give function variables meaningful names in _encode_asn1_str
- Accept a x509.BasicConstraints object in _encode_basic_constraints
- Properly garbage-collect some things
- Raise a NotImplementedError instead of a ValueError
diff --git a/docs/x509.rst b/docs/x509.rst
index 0f55e8e..aa8e259 100644
--- a/docs/x509.rst
+++ b/docs/x509.rst
@@ -491,18 +491,14 @@
... x509.NameAttribute(x509.OID_COMMON_NAME, 'cryptography.io'),
... ]))
>>> buidlder = builder.add_extension(
- ... x509.BasicConstraints(False, None), critical=True,
+ ... x509.BasicConstraints(ca=False, path_length=None), critical=True,
... )
>>> request = builder.sign(
- ... default_backend(), private_key, hashes.SHA1()
+ ... default_backend(), private_key, hashes.SHA256()
... )
>>> isinstance(request, x509.CertificateSigningRequest)
True
- .. method:: __init__()
-
- Creates an empty certificate signing request.
-
.. method:: subject_name(name)
:param name: The :class:`~cryptography.x509.Name` of the certificate