armor

package
v3.0.0-alpha.2-proton Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package armor contains a set of helper methods for armoring and unarmoring data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArmorKey

func ArmorKey(input []byte) (string, error)

ArmorKey armors input as a public key.

func ArmorPGPMessage

func ArmorPGPMessage(signature []byte) (string, error)

func ArmorPGPMessageBytes

func ArmorPGPMessageBytes(signature []byte) ([]byte, error)

func ArmorPGPSignature

func ArmorPGPSignature(signature []byte) (string, error)

func ArmorPGPSignatureBinary

func ArmorPGPSignatureBinary(signature []byte) ([]byte, error)

func ArmorReader

func ArmorReader(in io.Reader) (io.Reader, error)

ArmorReader returns a io.Reader which, when read, reads unarmored data from in.

func ArmorWithType

func ArmorWithType(input []byte, armorType string) (string, error)

ArmorWithType armors input with the given armorType.

func ArmorWithTypeAndCustomHeaders

func ArmorWithTypeAndCustomHeaders(input []byte, armorType, version, comment string) (string, error)

ArmorWithTypeAndCustomHeaders armors input with the given armorType and headers.

func ArmorWithTypeAndCustomHeadersBytes

func ArmorWithTypeAndCustomHeadersBytes(input []byte, armorType, version, comment string) ([]byte, error)

ArmorWithTypeAndCustomHeadersBytes armors input with the given armorType and headers.

func ArmorWithTypeBytes

func ArmorWithTypeBytes(input []byte, armorType string) ([]byte, error)

ArmorWithTypeBytes armors input with the given armorType.

func ArmorWriterWithType

func ArmorWriterWithType(w io.Writer, armorType string) (io.WriteCloser, error)

ArmorWriterWithType returns a io.WriteCloser which, when written to, writes armored data to w with the given armorType.

func ArmorWriterWithTypeAndCustomHeaders

func ArmorWriterWithTypeAndCustomHeaders(w io.Writer, armorType, version, comment string) (io.WriteCloser, error)

ArmorWriterWithTypeAndCustomHeaders returns a io.WriteCloser, which armors input with the given armorType and headers.

func IsPGPArmored

func IsPGPArmored(in io.Reader) (io.Reader, bool)

IsPGPArmored reads a prefix from the reader and checks if it is equal to a pgp armored message prefix. Returns an io.Reader that is reset to the state of the in reader, and a bool that indicates if there is a match. If reading from the reader fails, the returned bool is set to false.

func Unarmor

func Unarmor(input string) ([]byte, error)

Unarmor unarmors an armored input into a byte array.

func UnarmorBytes

func UnarmorBytes(input []byte) ([]byte, error)

UnarmorBytes unarmors an armored input into a byte array.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL