armor

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2024 License: MIT Imports: 6 Imported by: 3

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 ArmorPGPMessageBytesChecksum

func ArmorPGPMessageBytesChecksum(signature []byte, checksum bool) ([]byte, error)

func ArmorPGPMessageChecksum

func ArmorPGPMessageChecksum(signature []byte, checksum bool) (string, 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 ArmorWithTypeAndCustomHeadersChecksum

func ArmorWithTypeAndCustomHeadersChecksum(input []byte, armorType, version, comment string, checksum bool) (string, error)

ArmorWithTypeAndCustomHeadersChecksum armors input with the given armorType and headers and checksum option.

func ArmorWithTypeBytes

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

ArmorWithTypeBytes armors input with the given armorType.

func ArmorWithTypeBytesChecksum

func ArmorWithTypeBytesChecksum(input []byte, armorType string, checksum bool) ([]byte, error)

ArmorWithTypeBytesChecksum armors input with the given armorType and checksum option.

func ArmorWithTypeChecksum

func ArmorWithTypeChecksum(input []byte, armorType string, checksum bool) (string, error)

ArmorWithTypeChecksum armors input with the given armorType. The checksum option determines if an armor checksum is written at the end.

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 ArmorWriterWithTypeChecksum

func ArmorWriterWithTypeChecksum(w io.Writer, armorType string, checksum bool) (io.WriteCloser, error)

ArmorWriterWithTypeChecksum returns a io.WriteCloser which, when written to, writes armored data to w with the given armorType. The checksum determines if an armor checksum is written at the end.

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