TlsCertificate.newFromFile

gio.tls_certificate.TlsCertificate newFromFile(string file)

Creates a #GTlsCertificate from the data in file.

As of 2.72, if the filename ends in .p12 or .pfx the data is loaded by [gio.tls_certificate.TlsCertificate.newFromPkcs12] otherwise it is loaded by [gio.tls_certificate.TlsCertificate.newFromPem]. See those functions for exact details.

If file cannot be read or parsed, the function will return null and set error.

Parameters

filefile containing a certificate to import

Returns

the new certificate, or null on error

Throws

[ErrorWrap]