Base64
public struct Base64
There is no Base64 instances. Base64 exists to provide a namespace. It contains static functions for Base64 encoding and decoding.
-
PEM encodes a byte array
Declaration
Swift
public static func pemEncode(_ input: Bytes, _ pem: String) -> StringParameters
inputBytes to encode
pemThe PEM header- and footer string
Return Value
The Base64 PEM encoding of input
-
PEM decodes a string
Throws
A base64 exception or a pemStructure exception if the input is malformedDeclaration
Swift
public static func pemDecode(_ input: String, _ pem: String) throws -> BytesParameters
inputString to decode
pemThe expected PEM header- and footer string
Return Value
The Base64 PEM decoding of input
-
Base64 encodes a byte array
Declaration
Swift
public static func encode(_ input: Bytes, _ linesize: Int = 76) -> StringParameters
inputBytes to encode
linesizeNumber of characters per line - 76 is default
Return Value
The Base64 encoding of input
-
Base64 decodes a string
Throws
A base64 exception if the input is malformedDeclaration
Swift
public static func decode(_ input: String) throws -> BytesParameters
inputString to decode
Return Value
The Base64 decoding of input
Base64 Structure Reference