Gcr.CertificateChain.prototype.build_async

function build_async(purpose: String, peer: String, flags: Number(guint), cancellable: Gio.Cancellable, callback: Gio.AsyncReadyCallback): void {
    // Gjs wrapper for gcr_certificate_chain_build_async()
}
  

Complete a certificate chain. Once a certificate chain has been built its status can be examined.

This will lookup missing certificates in PKCS\#11 modules and also that each certificate in the chain is the signer of the previous one. If a trust anchor, pinned certificate, or self-signed certificate is found, then the chain is considered built. Any extra certificates are removed from the chain.

It's important to understand that building of a certificate chain does not constitute verifying that chain. This is merely the first step towards trust verification.

The purpose is a string like %GCR_PURPOSE_CLIENT_AUTH and is the purpose for which the certificate chain will be used. Trust anchors are looked up for this purpose. This argument is required.

The peer is usually the host name of the peer whith which this certificate chain is being used. It is used to look up pinned certificates that have been stored for this peer. If null then no pinned certificates will be considered.

If the Gcr.CertificateChainFlags.no_lookups flag is specified then no lookups for anchors or pinned certificates are done, and the resulting chain will be neither anchored or pinned. Additionally no missing certificate authorities are looked up in PKCS\#11

When the operation is finished, callback will be called. You can then call Gcr.CertificateChain.prototype.build_finish to get the result of the operation.

purpose

the purpose the certificate chain will be used for

peer

the peer the certificate chain will be used with, or null

flags

chain completion flags

cancellable

a Gio.Cancellable or null

callback

this will be called when the operation completes.