Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions X509CertificateStore.loadBundleFromPem

1
2
3
4
5
6
7
module juptune.data.x509.store;

Result loadBundleFromPem(
    const char[] pem, 
    bool ignoreAsn1DecodingErrors = false, 
    bool hasImplicitTrust = false
);

Documentation

Loads a certificate bundle from the given PEM encoded data.

Notes

This function is not fully atomic (yet at least), if a certificate generates an error, any previous certificates will have been succesfully loaded into the store, and any following certificates will not be loaded.

Since unfortunately not all certificates in a bundle will be DER encoded (but instead BER), you may set ignoreAsn1DecodingErrorsto true in order to continue loading certificates even if some certificates in the bundle are not DER encoded.

This function does not expect nor detect certificate chains within the given bundle - it will load (and optionally validate) all certificates as individual, standalone certificates.

Data from pemis copied - the caller is allowed to free/reuse pemafter this function without fear.

Params

Throws

Anything that loadFromCopyingDerBytescan throw.

Anything that PemParser.parseNextcan throw.

X509StoreError.wrongPemLabelif any item within the PEM data is not a "CERTIFICATE".

Returns

A Resultindicating if an error occurred or not.