pyopenssl API reference
92 public APIs from pyopenssl (pyca/pyopenssl) — 8 classes, 9 functions, 75 methods. Signatures extracted by static analysis of the actual source.
Repository: pyca/pyopenssl
| Kind | Count |
|---|---|
| Classes | 8 |
| Functions | 9 |
| Methods | 75 |
API list
method
src.OpenSSL.SSL.Connection.export_keying_material(label:bytes, olen:int, context:bytes | None=None) -> bytesObtain keying material for application use.
method
src.OpenSSL.SSL.Connection.get_alpn_proto_negotiated() -> bytesGet the protocol that was negotiated by ALPN.
method
src.OpenSSL.SSL.Connection.get_app_data() -> AnyRetrieve application data as set by :meth:`set_app_data`.
method
src.OpenSSL.SSL.Connection.get_cipher_name() -> str | NoneObtain the name of the currently used cipher.
method
src.OpenSSL.SSL.Connection.get_finished() -> bytes | NoneObtain the latest TLS Finished message that we sent.
method
src.OpenSSL.SSL.Connection.get_selected_srtp_profile() -> bytesGet the SRTP protocol which was negotiated.
method
src.OpenSSL.SSL.Connection.get_session() -> Session | NoneReturns the Session currently used.
method
src.OpenSSL.SSL.Connection.get_shutdown() -> intGet the shutdown state of the Connection.
method
src.OpenSSL.SSL.Connection.master_key() -> bytes | NoneRetrieve the value of the master key for this session.
method
src.OpenSSL.SSL.Connection.recv(bufsiz:int, flags:int | None=None) -> bytesReceive data on the connection.
method
src.OpenSSL.SSL.Connection.renegotiate() -> boolRenegotiate the session.
method
src.OpenSSL.SSL.Connection.send(buf:_Buffer, flags:int=0) -> intSend data on the connection.
method
src.OpenSSL.SSL.Connection.sendall(buf:_Buffer, flags:int=0) -> intSend "all" data on the connection.
method
src.OpenSSL.SSL.Connection.set_accept_state() -> NoneSet the connection to work in server mode.
method
src.OpenSSL.SSL.Connection.set_alpn_protos(protos:list[bytes]) -> NoneSpecify the client's ALPN protocol list.
method
src.OpenSSL.SSL.Connection.set_app_data(data:Any) -> NoneSet application data :param data: The application data :return: None
method
src.OpenSSL.SSL.Connection.set_connect_state() -> NoneSet the connection to work in client mode.
method
src.OpenSSL.SSL.Connection.set_context(context:Context) -> NoneSwitch this connection to a new session context.
method
src.OpenSSL.SSL.Connection.set_info_callback(callback:Callable[[Connection, int, int], None]) -> NoneSet the information callback to *callback*.
method
src.OpenSSL.SSL.Connection.set_options(options:int) -> intAdd options.
method
src.OpenSSL.SSL.Connection.set_shutdown(state:int) -> NoneSet the shutdown state of the Connection.
method
src.OpenSSL.SSL.Connection.shutdown() -> boolSend the shutdown message to the Connection.
method
src.OpenSSL.SSL.Connection.sock_shutdown(*args:Any, **kwargs:Any) -> NoneCall the :meth:`shutdown` method of the underlying socket.
method
src.OpenSSL.SSL.Connection.total_renegotiations() -> intFind out the total number of renegotiations.
method
src.OpenSSL.SSL.Context.get_cert_store() -> X509Store | NoneGet the certificate store for the context.
method
src.OpenSSL.SSL.Context.get_session_cache_mode() -> intGet the current session cache mode.
method
src.OpenSSL.SSL.Context.get_timeout() -> intRetrieve session timeout, as set by :meth:`set_timeout`.
method
src.OpenSSL.SSL.Context.load_client_ca(cafile:bytes) -> NoneLoad the trusted certificates that will be sent to the client.
method
src.OpenSSL.SSL.Context.set_cipher_list(cipher_list:bytes) -> NoneSet the list of ciphers to be used in this context.
method
src.OpenSSL.SSL.Context.set_info_callback(callback:Callable[[Connection, int, int], None]) -> NoneSet the information callback to *callback*.
method
src.OpenSSL.SSL.Context.set_keylog_callback(callback:Callable[[Connection, bytes], None]) -> NoneSet the TLS key logging callback to *callback*.
method
src.OpenSSL.SSL.Context.set_max_proto_version(version:int) -> NoneSet the maximum supported protocol version.
method
src.OpenSSL.SSL.Context.set_min_proto_version(version:int) -> NoneSet the minimum supported protocol version.
method
src.OpenSSL.SSL.Context.set_mode(mode:int) -> intAdd modes via bitmask.
method
src.OpenSSL.SSL.Context.set_options(options:int) -> intAdd options.
method
src.OpenSSL.SSL.Context.set_passwd_cb(callback:_PassphraseCallback[_T], userdata:_T | None=None) -> NoneSet the passphrase callback.
method
src.OpenSSL.SSL.Context.set_tls13_ciphersuites(ciphersuites:bytes) -> NoneSet the list of TLS 1.3 ciphers to be used in this context.
method
src.OpenSSL.SSL.Context.set_tlsext_use_srtp(profiles:bytes) -> NoneEnable support for negotiating SRTP keying material.
method
src.OpenSSL.SSL.Context.set_tmp_ecdh(curve:_EllipticCurve | ec.EllipticCurve) -> NoneSelect a curve to use for ECDHE key exchange.
method
src.OpenSSL.SSL.Context.use_certificate_chain_file(certfile:_StrOrBytesPath) -> NoneLoad a certificate chain from a file.
class
src.OpenSSL.SSL.ErrorAn error occurred in an `OpenSSL.SSL` API.
func
src.OpenSSL.SSL.OpenSSL_version(type:int) -> bytesReturn a string describing the version of OpenSSL in use.
class
src.OpenSSL.SSL.SessionA class representing an SSL session.
func
src.OpenSSL._util.exception_from_error_queue(exception_type:type[Exception]) -> NoReturnConvert an OpenSSL library failure into a Python exception.
func
src.OpenSSL._util.openssl_assert(ok:bool) -> NoneIf *ok* is not True, retrieve the error from OpenSSL and raise it.
func
src.OpenSSL._util.text(charp:Any) -> strGet a native string type representing of the given CFFI ``char*`` object.
class
src.OpenSSL.crypto.ErrorAn error occurred in an `OpenSSL.crypto` API.
class
src.OpenSSL.crypto.PKeyA class representing an DSA or RSA public key or key pair.
method
src.OpenSSL.crypto.PKey.check() -> boolCheck the consistency of an RSA private key.
method
src.OpenSSL.crypto.PKey.from_cryptography_key(crypto_key:_Key) -> PKeyConstruct based on a ``cryptography`` *crypto_key*.
method
src.OpenSSL.crypto.PKey.generate_key(type:int, bits:int) -> NoneGenerate a key pair of the given type, with the given number of bits.
method
src.OpenSSL.crypto.PKey.to_cryptography_key() -> _KeyExport as a ``cryptography`` key.
method
src.OpenSSL.crypto.PKey.type() -> intReturns the type of the key :return: The type of the key.
class
src.OpenSSL.crypto.X509An X.509 certificate.
method
src.OpenSSL.crypto.X509.digest(digest_name:str) -> bytesReturn the digest of the X509 object.
method
src.OpenSSL.crypto.X509.from_cryptography(crypto_cert:x509.Certificate) -> X509Construct based on a ``cryptography`` *crypto_cert*.
method
src.OpenSSL.crypto.X509.get_extension_count() -> intGet the number of extensions on this certificate.
method
src.OpenSSL.crypto.X509.get_issuer() -> X509NameReturn the issuer of this certificate.
method
src.OpenSSL.crypto.X509.get_notAfter() -> bytes | NoneGet the timestamp at which the certificate stops being valid.
method
src.OpenSSL.crypto.X509.get_pubkey() -> PKeyGet the public key of the certificate.
method
src.OpenSSL.crypto.X509.get_serial_number() -> intReturn the serial number of this certificate.
method
src.OpenSSL.crypto.X509.get_signature_algorithm() -> bytesReturn the signature algorithm used in the certificate.
method
src.OpenSSL.crypto.X509.get_subject() -> X509NameReturn the subject of this certificate.
method
src.OpenSSL.crypto.X509.get_version() -> intReturn the version number of the certificate.
method
src.OpenSSL.crypto.X509.gmtime_adj_notAfter(amount:int) -> NoneAdjust the time stamp on which the certificate stops being valid.
method
src.OpenSSL.crypto.X509.gmtime_adj_notBefore(amount:int) -> NoneAdjust the timestamp on which the certificate starts being valid.
method
src.OpenSSL.crypto.X509.has_expired() -> boolCheck whether the certificate has expired.
method
src.OpenSSL.crypto.X509.set_issuer(issuer:X509Name) -> NoneSet the issuer of this certificate.
method
src.OpenSSL.crypto.X509.set_notAfter(when:bytes) -> NoneSet the timestamp at which the certificate stops being valid.
method
src.OpenSSL.crypto.X509.set_notBefore(when:bytes) -> NoneSet the timestamp at which the certificate starts being valid.
method
src.OpenSSL.crypto.X509.set_pubkey(pkey:PKey) -> NoneSet the public key of the certificate.
method
src.OpenSSL.crypto.X509.set_serial_number(serial:int) -> NoneSet the serial number of the certificate.
method
src.OpenSSL.crypto.X509.set_subject(subject:X509Name) -> NoneSet the subject of this certificate.
method
src.OpenSSL.crypto.X509.set_version(version:int) -> NoneSet the version number of the certificate.
method
src.OpenSSL.crypto.X509.sign(pkey:PKey, digest:str) -> NoneSign the certificate with this key and digest type.
method
src.OpenSSL.crypto.X509.subject_name_hash() -> intReturn the hash of the X509 subject.
method
src.OpenSSL.crypto.X509.to_cryptography() -> x509.CertificateExport as a ``cryptography`` certificate.
class
src.OpenSSL.crypto.X509NameAn X.509 Distinguished Name.
method
src.OpenSSL.crypto.X509Name.der() -> bytesReturn the DER encoding of this name.
class
src.OpenSSL.crypto.X509StoreAn X.509 store.
method
src.OpenSSL.crypto.X509Store.add_cert(cert:X509) -> NoneAdds a trusted certificate to this store.
method
src.OpenSSL.crypto.X509Store.add_crl(crl:x509.CertificateRevocationList) -> NoneAdd a certificate revocation list to this store.
method
src.OpenSSL.crypto.X509Store.set_flags(flags:int) -> NoneSet verification flags to this store.
method
src.OpenSSL.crypto.X509Store.set_time(vfy_time:datetime.datetime) -> NoneSet the time against which the certificates are verified.
class
src.OpenSSL.crypto.X509StoreContextAn X.509 store context.
method
src.OpenSSL.crypto.X509StoreContext.set_store(store:X509Store) -> NoneSet the context's X.509 store.
method
src.OpenSSL.crypto.X509StoreContext.verify_certificate() -> NoneVerify a certificate in a context.
func
src.OpenSSL.crypto.dump_publickey(type:int, pkey:PKey) -> bytesDump a public key to a buffer.
func
src.OpenSSL.crypto.get_elliptic_curve(name:str) -> _EllipticCurveReturn a single curve object selected by name.
func
src.OpenSSL.crypto.load_publickey(type:int, buffer:str | bytes) -> PKeyLoad a public key from a buffer.
func
src.OpenSSL.rand.add(buffer:bytes, entropy:int) -> NoneMix bytes from *string* into the PRNG state.
func
src.OpenSSL.rand.status() -> intCheck whether the PRNG has been seeded with enough data.
About this data
These signatures were extracted from the public source of pyca/pyopenssl
using Python's ast module. Argument names, default values,
type annotations and return types are taken verbatim from the code.
Implementation bodies are never stored. See
how it works for details.