Cert


Object Hierarchy:

Object hierarchy for Cert

Description:

public class Cert : Object

The key and certificate files one program uses for HTTPS RPC.

Used by both ends: ollmfilesd makes the server's files, ollmapp makes the client's. Configure with construct properties, then call ensure once: it creates the files if needed and sets certificate (this program's own) and trust (the product CA the other end must be signed by). When ca_pem_path and ca_key_path are set the certificate is signed with that CA; otherwise it is self-signed.

ensure does not throw. Files that are missing or will not load are recreated; anything else (directory not creatable, CA files missing, cannot write) is a broken install and aborts with GLib.error.

Example

// server (ollmfilesd)
var server = new OLLMrpc.Transport.Cert() {
dir = tls_dir,
ca_pem_path = ca_pem,
ca_key_path = ca_key,
server_san = true,
};
server.ensure();
http.tls_certificate = server.certificate;

// device client (ollmapp)
var client = new OLLMrpc.Transport.Cert() {
dir = GLib.Path.build_filename(
GLib.Environment.get_user_data_dir(), "ollmchat"),
cert_pem = "client.pem",
key_pem = "client-key.pem",
cn = "ollmchat-device",
};
client.ensure();
var http = new OLLMrpc.Transport.HttpClient(url) {
bin_body = true,
tls_certificate = client.certificate,
tls_database = client.trust
};


Namespace: OLLMrpc.Transport
Package: ollmchat

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class GLib.Object