gio.tls_certificate

Module for [TlsCertificate] class

Types 3

A certificate used for TLS authentication and encryption. This can represent either a certificate only (eg, the certificate received by a client from a server), or the combination of a certificate and a private key (which is needed when acting as a gio.tls_server_connection.TlsServerConnection).

Methods
GType _getGType() static nothrow
GType _gType() @property nothrow
TlsCertificate self() nothrowReturns `this`, for use in `with` statements.
TlsCertificateGidBuilder builder() static nothrowGet builder for [gio.tls_certificate.TlsCertificate] Returns: New builder object
string certificatePem() @property nothrowGet `certificatePem` property. Returns: The PEM (ASCII) encoded representation of the certificate. This property and the #GTlsCertificate:certificate property represent the same data, just in diffe...
gio.tls_certificate.TlsCertificate issuer() @property nothrowGet `issuer` property. Returns: A #GTlsCertificate representing the entity that issued this certificate. If null, this means that the certificate is either self-signed, or else the certificate of t...
string issuerName() @property nothrowGet `issuerName` property. Returns: The issuer from the certificate, null if unavailable.
glib.date_time.DateTime notValidAfter() @property nothrowGet `notValidAfter` property. Returns: The time at which this cert is no longer valid, null if unavailable.
glib.date_time.DateTime notValidBefore() @property nothrowGet `notValidBefore` property. Returns: The time at which this cert is considered to be valid, null if unavailable.
string pkcs11Uri() @property nothrowGet `pkcs11Uri` property. Returns: A URI referencing the [PKCS \#11](https://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/pkcs11-base-v3.0-os.html) objects containing an X.509 certificate and opt...
string privateKeyPem() @property nothrowGet `privateKeyPem` property. Returns: The PEM (ASCII) encoded representation of the certificate's private key in either [PKCS \#1 format](https://datatracker.ietf.org/doc/html/rfc8017) ("`BEGIN RS...
string privateKeyPkcs11Uri() @property nothrowGet `privateKeyPkcs11Uri` property. Returns: A URI referencing a [PKCS \#11](https://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/pkcs11-base-v3.0-os.html) object containing a private key.
string subjectName() @property nothrowGet `subjectName` property. Returns: The subject from the cert, null if unavailable.
gio.tls_certificate.TlsCertificate newFromFile(string file) staticCreates a #GTlsCertificate from the data in file.
gio.tls_certificate.TlsCertificate newFromFileWithPassword(string file, string password) staticCreates a #GTlsCertificate from the data in file.
gio.tls_certificate.TlsCertificate newFromFiles(string certFile, string keyFile) staticCreates a #GTlsCertificate from the PEM-encoded data in cert_file and key_file. The returned certificate will be the first certificate found in cert_file. As of GLib 2.44, if cert_file contains mor...
gio.tls_certificate.TlsCertificate newFromPem(string data) staticCreates a #GTlsCertificate from the PEM-encoded data in data. If data includes both a certificate and a private key, then the returned certificate will include the private key data as well. (See th...
gio.tls_certificate.TlsCertificate newFromPkcs11Uris(string pkcs11Uri, string privateKeyPkcs11Uri = null) staticCreates a #GTlsCertificate from a [PKCS \#11](https://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/pkcs11-base-v3.0-os.html) URI.
gio.tls_certificate.TlsCertificate newFromPkcs12(ubyte[] data, string password = null) staticCreates a #GTlsCertificate from the data in data. It must contain a certificate and matching private key.
gio.tls_certificate.TlsCertificate[] listNewFromFile(string file) staticCreates one or more #GTlsCertificates from the PEM-encoded data in file. If file cannot be read or parsed, the function will return null and set error. If file does not contain any PEM-encoded cert...
glib.bytes.Bytes[] getDnsNames() nothrowGets the value of #GTlsCertificate:dns-names. Returns: A #GPtrArray of #GBytes elements, or null if it's not available.
gio.inet_address.InetAddress[] getIpAddresses() nothrowGets the value of #GTlsCertificate:ip-addresses. Returns: A #GPtrArray of #GInetAddress elements, or null if it's not available.
gio.tls_certificate.TlsCertificate getIssuer() nothrowGets the #GTlsCertificate representing cert's issuer, if known Returns: The certificate of cert's issuer, or null if cert is self-signed or signed with an unknown certificate.
string getIssuerName() nothrowReturns the issuer name from the certificate. Returns: The issuer name, or null if it's not available.
glib.date_time.DateTime getNotValidAfter() nothrowReturns the time at which the certificate became or will become invalid. Returns: The not-valid-after date, or null if it's not available.
glib.date_time.DateTime getNotValidBefore() nothrowReturns the time at which the certificate became or will become valid. Returns: The not-valid-before date, or null if it's not available.
string getSubjectName() nothrowReturns the subject name from the certificate. Returns: The subject name, or null if it's not available.
bool isSame(gio.tls_certificate.TlsCertificate certTwo) nothrowCheck if two #GTlsCertificate objects represent the same certificate. The raw DER byte data of the two certificates are checked for equality. This has the effect that two certificates may compare e...
gio.types.TlsCertificateFlags verify(gio.socket_connectable.SocketConnectable identity = null, gio.tls_certificate.TlsCertificate trustedCa = null) nothrowThis verifies cert and returns a set of #GTlsCertificateFlags indicating any problems found with it. This can be used to verify a certificate outside the context of making a connection, or to check...
Constructors
this(void * ptr, Flag!"Take" take)

Fluent builder implementation template for gio.tls_certificate.TlsCertificate

Methods
T certificatePem(string propval) nothrowSet `certificatePem` property. Params: propval = The PEM (ASCII) encoded representation of the certificate. This property and the #GTlsCertificate:certificate property represent the same data, just...
T issuer(gio.tls_certificate.TlsCertificate propval) nothrowSet `issuer` property. Params: propval = A #GTlsCertificate representing the entity that issued this certificate. If null, this means that the certificate is either self-signed, or else the certifi...
T password(string propval) nothrowSet `password` property. Params: propval = An optional password used when constructed with GTlsCertificate:pkcs12-data. Returns: Builder instance for fluent chaining
T pkcs11Uri(string propval) nothrowSet `pkcs11Uri` property. Params: propval = A URI referencing the [PKCS \#11](https://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/pkcs11-base-v3.0-os.html) objects containing an X.509 certificat...
T privateKeyPem(string propval) nothrowSet `privateKeyPem` property. Params: propval = The PEM (ASCII) encoded representation of the certificate's private key in either [PKCS \#1 format](https://datatracker.ietf.org/doc/html/rfc8017) ("...
T privateKeyPkcs11Uri(string propval) nothrowSet `privateKeyPkcs11Uri` property. Params: propval = A URI referencing a [PKCS \#11](https://docs.oasis-open.org/pkcs11/pkcs11-base/v3.0/os/pkcs11-base-v3.0-os.html) object containing a private ke...
Methods
TlsCertificate build() nothrowCreate object from builder. Returns: New object