chevronlib

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeKeyPassword

func ChangeKeyPassword(keyData, currentPassword, newPassword string) (newKeyData string, err error)

ChangeKeyPassword re-encrypts the input key using newPassword

func CopyFiles

func CopyFiles(src, dst string) error

func FolderExists

func FolderExists(folder string) bool

func GPG2Quanto

func GPG2Quanto(signature, fingerprint, hash string) string

GPG2Quanto converts a GPG Signature to Quanto Format

func GenerateKey

func GenerateKey(password, identifier string, bits int) (result string, err error)

GenerateKey generates a new key using specified bits and identifier and encrypts it using the specified password

func GetFingerprintFromKey

func GetFingerprintFromKey(armored string) (string, error)

GetFingerprintFromKey returns the main fingerprint from key or error if key is invalid

func GetKeyFingerprints

func GetKeyFingerprints(keyData string) (fps []string, err error)

GetKeyFingerprints returns all fingerprints in a ASCII Armored PGP Keychain

func GetPublicKey

func GetPublicKey(fingerprint string) (keyData string, err error)

GetPublicKey returns the cached public key from the specified fingerprint

func LoadKey

func LoadKey(keyData string) (loadedPrivateKeys int, err error)

LoadKey loads a private or public key into the memory keyring export LoadKey

func MakeKeyRingManager

func MakeKeyRingManager(log slog.Instance) interfaces.KeyRingManager

MakeKeyRingManager creates a new instance of Key Ring Manager log instance can be nil

func MakePGPManager

func MakePGPManager(log slog.Instance, storage interfaces.StorageBackend, keyRingManager interfaces.KeyRingManager) interfaces.PGPManager

MakePGPManager creates a new instance of PGP Operations Manager log instance can be nil

func MakeSaveToDiskBackend

func MakeSaveToDiskBackend(log slog.Instance, keysFolder, prefix string) interfaces.StorageBackend

MakeSaveToDiskBackend creates an instance of a StorageBackend that saves the keys in the specified folder with the specified prefix log instance can be nil

func Quanto2GPG

func Quanto2GPG(signature string) string

GPG2Quanto converts a Quanto Signature to GPG

func QuantoSignBase64Data

func QuantoSignBase64Data(b64data, fingerprint string) (result string, err error)

QuantoSignBase64Data signs the data using a already loaded and unlocked private key and returning in Quanto Signature format.

The b64data is a raw binary data encoded in base64 string

func QuantoSignData

func QuantoSignData(data []byte, fingerprint string) (result string, err error)

QuantoSignData signs the data using a already loaded and unlocked private key and returning in Quanto PGP Signature format

func QuantoVerifyBase64DataSignature

func QuantoVerifyBase64DataSignature(b64data, signature string) (result bool, err error)

QuantoVerifyBase64DataSignature verifies a signature using a already loaded public key. The b64data is a raw binary data encoded in base64 string export VerifyBase64DataSignature

func QuantoVerifySignature

func QuantoVerifySignature(data []byte, signature string) (result bool, err error)

QuantoVerifySignature verifies a signature in Quanto Signature Format using a already loaded public key export VerifySignature

func SignBase64Data

func SignBase64Data(b64data, fingerprint string) (result string, err error)

SignBase64Data signs data using a already loaded and unlocked private key. The b64data is a raw binary data encoded in base64 string export SignBase64Data

func SignData

func SignData(data []byte, fingerprint string) (result string, err error)

SignData signs data using a already loaded and unlocked private key export SignData

func UnlockKey

func UnlockKey(fingerprint, password string) (err error)

UnlockKey unlocks a private key to be used export UnlockKey

func VerifyBase64DataSignature

func VerifyBase64DataSignature(b64data, signature string) (result bool, err error)

VerifyBase64DataSignature verifies a signature using a already loaded public key. The b64data is a raw binary data encoded in base64 string export VerifyBase64DataSignature

func VerifySignature

func VerifySignature(data []byte, signature string) (result bool, err error)

VerifySignature verifies a signature using a already loaded public key export VerifySignature

Types

This section is empty.

Jump to

Keyboard shortcuts

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