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 _gType() @property
TlsCertificate self()Returns `this`, for use in `with` statements.
TlsCertificateGidBuilder builder()Get builder for [gio.tls_certificate.TlsCertificate] Returns: New builder object
string certificatePem() @propertyGet `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() @propertyGet `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() @propertyGet `issuerName` property. Returns: The issuer from the certificate, null if unavailable.
glib.date_time.DateTime notValidAfter() @propertyGet `notValidAfter` property. Returns: The time at which this cert is no longer valid, null if unavailable.
glib.date_time.DateTime notValidBefore() @propertyGet `notValidBefore` property. Returns: The time at which this cert is considered to be valid, null if unavailable.
string pkcs11Uri() @propertyGet `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() @propertyGet `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() @propertyGet `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() @propertyGet `subjectName` property. Returns: The subject from the cert, null if unavailable.
gio.tls_certificate.TlsCertificate newFromFile(string file)Creates a #GTlsCertificate from the data in file.
gio.tls_certificate.TlsCertificate newFromFileWithPassword(string file, string password)Creates a #GTlsCertificate from the data in file.
gio.tls_certificate.TlsCertificate newFromFiles(string certFile, string keyFile)Creates a #GTlsCertificate from the PEM-encoded data in certfile and keyfile. The returned certificate will be the first certificate found in certfile. As of GLib 2.44, if certfile contains more ce...
gio.tls_certificate.TlsCertificate newFromPem(string data)Creates 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)Creates 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)Creates a #GTlsCertificate from the data in data. It must contain a certificate and matching private key.
gio.tls_certificate.TlsCertificate[] listNewFromFile(string file)Creates 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()Gets the value of #GTlsCertificate:dns-names. Returns: A #GPtrArray of #GBytes elements, or null if it's not available.
gio.inet_address.InetAddress[] getIpAddresses()Gets the value of #GTlsCertificate:ip-addresses. Returns: A #GPtrArray of #GInetAddress elements, or null if it's not available.
gio.tls_certificate.TlsCertificate getIssuer()Gets 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()Returns the issuer name from the certificate. Returns: The issuer name, or null if it's not available.
glib.date_time.DateTime getNotValidAfter()Returns 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()Returns 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()Returns the subject name from the certificate. Returns: The subject name, or null if it's not available.
bool isSame(gio.tls_certificate.TlsCertificate certTwo)Check 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)This 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)
Methods
T certificatePem(string propval)Set `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)Set `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)Set `password` property. Params: propval = An optional password used when constructed with GTlsCertificate:pkcs12-data. Returns: Builder instance for fluent chaining
T pkcs11Uri(string propval)Set `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)Set `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)Set `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...

Fluent builder for [gio.tls_certificate.TlsCertificate]