pki

package
v1.0.640 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 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
	// contains filtered or unexported fields
}

Pki pki info

func New

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

New returns a pki object and an error

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 expands tilde paths and validates against directory traversal

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