License
BSD-3-Clause
PEM encoding and decoding helpers.
Provides Base64 encode/decode (RFC 4648), PEM armor wrapping/unwrapping, and standard PEM label constants for cryptographic objects.
A decoded PEM block.
string labelThe PEM label (e.g. "RSA PRIVATE KEY").ubyte[] derDataThe decoded DER bytes.Standard PEM label constants for cryptographic objects.
int base64CharValue(char c) pure @safe nothrowReturns the 6-bit value for a valid Base64 character, or -1 if invalid.size_t findStr(string haystack, string needle, size_t start = 0) pure @safe nothrowFinds the first occurrence of `needle` in `haystack` starting at `start`. Returns the index, or `size_t.max` if not found.string base64Encode(const(ubyte)[] data) pure @safeEncodes raw bytes to a Base64 string (RFC 4648).string pemEncode(string label, const(ubyte)[] derData) @safeEncodes raw DER bytes into PEM format.BASE64_ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"Standard Base64 alphabet (RFC 4648, Table 1).