certbotbot
Reference documentation for a modular Bash project
Loading...
Searching...
No Matches
Functions
identity.bash File Reference

Validates a primary and additional DNS identities for one lineage. More...

Functions

int certbotbot_dns_valid (String name)
 Validates canonical ASCII DNS names, optionally wildcard-prefixed.
 
int certbotbot_identity_shortest (String arg)
 Chooses one safe, shortest textual Certbot lineage from canonical SANs.
 
int certbotbot_identity_resolve ()
 Computes the bounded multi-SAN set and stable lineage identifier.
 

Detailed Description

Validates a primary and additional DNS identities for one lineage.

All explicit names are checked before calling external tools. Each primary and additional name gains its complementary apex/wildcard only when enabled; derived names never recurse. Global first-occurrence deduplication produces a bounded, ordered set, including DNS names from unrelated zones. Derived names and certificate identities remain deterministic across runners. Names from SANs are checked for safe non-wildcard lineage usage before S3 retrieval or issuance; lexical ties are resolved using ASCII ordering.

Function Documentation

◆ certbotbot_dns_valid()

int certbotbot_dns_valid ( String  name)

Validates canonical ASCII DNS names, optionally wildcard-prefixed.

Parameters
namePrimary name or SAN.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
Return values
0The DNS name is valid.
1The DNS name is invalid.

◆ certbotbot_identity_resolve()

int certbotbot_identity_resolve ( )

Computes the bounded multi-SAN set and stable lineage identifier.

Accepts one primary and zero or more additional literal DNS identities, normalizes ASCII case, validates each name, and optionally adds each name's single complementary wildcard/apex. The resolved list preserves the first occurrence of each name and contains no more than 100 unique SANs. The explicit CERT_NAME is independent of SAN membership; absent an override, the existing shortest-string and ASCII lexical tie rule still applies.

STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
Non-sensitive diagnostics.
Return values
0Selected identity is valid.
64Identity or certificate name is invalid.

◆ certbotbot_identity_shortest()

int certbotbot_identity_shortest ( String  arg)

Chooses one safe, shortest textual Certbot lineage from canonical SANs.

Compares full SAN lengths, including the wildcard prefix, using an ASCII lexical tie-break independent of the invoking process's locale. This is an internal selector, not an additional-SAN public interface. It rejects a wildcard-only derived lineage instead of passing a wildcard to Certbot.

Parameters
argOne or more canonical DNS SAN candidates.
STDIN
Nothing is read from STDIN.
STDOUT
Nothing is written to STDOUT.
STDERR
Nothing is written to STDERR.
Returns
Selected lineage in REPLY on success; empty on failure.
Return values
0A safe non-wildcard lineage was selected.
1No candidates, malformed SAN, or derived wildcard lineage.