macula_quic_cert (macula v0.14.3)

View Source

Macula QUIC certificate utilities. Provides functions for generating and validating self-signed certificates for QUIC connections via OpenSSL command-line tool.

Summary

Functions

Generate a self-signed certificate and key in a temporary directory. Returns {ok, CertFile, KeyFile} with paths to generated files. The files are created in /tmp/macula_certs_PID for test isolation.

Generate a self-signed certificate and key in the given directory. Returns {ok, {CertFile, KeyFile}} with paths to generated files.

Generate a self-signed certificate with custom options. Options: subject - Certificate subject (default: "/CN=macula.local") validity_days - Validity period in days (default: 365)

Validate that both certificate and key files exist and are readable.

Functions

generate_self_signed()

-spec generate_self_signed() -> {ok, file:filename(), file:filename()} | {error, term()}.

Generate a self-signed certificate and key in a temporary directory. Returns {ok, CertFile, KeyFile} with paths to generated files. The files are created in /tmp/macula_certs_PID for test isolation.

generate_self_signed(Dir)

-spec generate_self_signed(file:filename()) ->
                              {ok, {file:filename(), file:filename()}} | {error, term()}.

Generate a self-signed certificate and key in the given directory. Returns {ok, {CertFile, KeyFile}} with paths to generated files.

generate_self_signed(Dir, Opts)

-spec generate_self_signed(file:filename(), map()) ->
                              {ok, {file:filename(), file:filename()}} | {error, term()}.

Generate a self-signed certificate with custom options. Options: subject - Certificate subject (default: "/CN=macula.local") validity_days - Validity period in days (default: 365)

validate_files(CertFile, KeyFile)

-spec validate_files(file:filename(), file:filename()) -> ok | {error, term()}.

Validate that both certificate and key files exist and are readable.