tlslite.x509 module¶
Class representing an X.509 certificate.
-
class
tlslite.x509.
X509
¶ Bases:
object
This class represents an X.509 certificate.
- Variables
-
__init__
()¶ Create empty certificate object.
-
getFingerprint
()¶ Get the hex-encoded fingerprint of this certificate.
- Return type
- Returns
A hex-encoded fingerprint.
-
parse
(s)¶ Parse a PEM-encoded X.509 certificate.
- Parameters
s (str) – A PEM-encoded X.509 certificate (i.e. a base64-encoded certificate wrapped with “—–BEGIN CERTIFICATE—–” and “—–END CERTIFICATE—–” tags).
-
parseBinary
(cert_bytes)¶ Parse a DER-encoded X.509 certificate.
- Parameters
bytes (L{str} (in python2) or L{bytearray} of unsigned bytes) – A DER-encoded X.509 certificate.
-
writeBytes
()¶ Serialise object to a DER encoded string.
-
tlslite.x509.
bytes_to_int
(bytes, byteorder, *, signed=False)¶ Return the integer represented by the given array of bytes.
- bytes
Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.
- byteorder
The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value.
- signed
Indicates whether two’s complement is used to represent the integer.