pki

package
v1.0.620 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: MIT Imports: 13 Imported by: 3

Documentation

Overview

Package pki handles PGP for pillar content

Index

Constants

View Source
const PGPHeader string = "-----BEGIN PGP MESSAGE-----"

PGPHeader header const

Variables

This section is empty.

Functions

This section is empty.

Types

type Pki

type Pki struct {
	PublicKey     *openpgp.Entity
	SecretKey     *openpgp.Entity
	PubRing       *openpgp.EntityList
	SecRing       *openpgp.EntityList
	PublicKeyRing string
	SecretKeyRing string
	PgpKeyName    string
}

Pki pki info

func New

func New(pgpKeyName string, publicKeyRing string, secretKeyRing string) Pki

New returns a pki object

func (*Pki) DecryptSecret

func (p *Pki) DecryptSecret(cipherText string) (plainText string, err error)

DecryptSecret returns decrypted cipherText

func (*Pki) EncryptSecret

func (p *Pki) EncryptSecret(plainText string) (string, error)

EncryptSecret returns encrypted plainText

func (*Pki) ExpandTilde

func (p *Pki) ExpandTilde(path string) (string, error)

ExpandTilde does exactly what it says on the tin

func (*Pki) GetKeyByID

func (p *Pki) GetKeyByID(keyring *openpgp.EntityList, id interface{}) *openpgp.Entity

GetKeyByID returns a keyring by the given ID

func (*Pki) KeyUsedForEncryptedFile

func (p *Pki) KeyUsedForEncryptedFile(file string) (string, error)

KeyUsedForEncryptedFile gets the key used to encrypt a file

Jump to

Keyboard shortcuts

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