core/encoding/pem

pem

Types

3

Decode_Error

Decode_Error :: enum int { None = 0, Bad_Boundary = 1, // Invalid boundary line. Bad_Label = 2, // Invalid label in BEGIN/END boundary line. Bad_Data = 3, // Invalid base64 data. Label_Mismatch = 4, // Label in END boundary line does not match. Missing_End_Boundary = 5, // End of data without END boundary. }Source

Constants

9

Procedures

4

block_delete

block_delete :: proc(blk: ^Block)Source

block_delete frees a Block returned from decode.

Note: No allocator is specified as decode uses the same allocator for everything.

decode

decode :: proc(data: []u8, allocator: mem.Allocator = context.allocator) -> (blk: ^Block, remaining: []u8, err: Error)Source

decode decodes the first encountered PEM block, returning the resulting block, remaining data, and nil if and only if (⟺) the process was successful.

Note: No PEM blocks will result in this procedure returning all nils, and is not considered an error.

encode

encode :: proc(label: string, data: []u8, newline: untyped boolean = false, allocator: mem.Allocator = context.allocator) -> (res: []u8, err: runtime.Allocator_Error)Source

encode encodes the specified label and data into PEM format.

Reference search

Find anything

Documentation preferences

Settings

System theme variants

Used only while Theme is set to System.