package pgp
import "github.com/purpleidea/mgmt/pgp"
Package pgp contains the code related to both code and host signing and encryption.
Index ¶
- Constants
- Variables
- func ParseIdentity(identity string) (name, comment, email string, err error)
- type PGP
- func Generate(name, comment, email string, hash *crypto.Hash) (*PGP, error)
- func Import(privKeyPath string) (*PGP, error)
- func (obj *PGP) Decrypt(encString string) (string, error)
- func (obj *PGP) Encrypt(to *openpgp.Entity, msg string) (string, error)
- func (obj *PGP) EncryptMsg(to *openpgp.Entity, msg string) (*bytes.Buffer, error)
- func (obj *PGP) GetIdentities() (string, error)
- func (obj *PGP) SaveKey(path string) error
- func (obj *PGP) WriteFile(path string, buff *bytes.Buffer) error
Constants ¶
const DefaultKeyringFile = "keyring.pgp"
DefaultKeyringFile is the default file name for keyrings.
Variables ¶
CONFIG set default Hash.
Functions ¶
func ParseIdentity ¶
ParseIdentity parses an identity into name, comment and email components.
Types ¶
type PGP ¶
PGP contains base entity.
func Generate ¶
Generate creates new key pair. This key pair must be saved or it will be lost.
func Import ¶
Import private key from defined path.
func (*PGP) Decrypt ¶
Decrypt an encrypted msg.
func (*PGP) Encrypt ¶
Encrypt message for specified entity.
func (*PGP) EncryptMsg ¶
EncryptMsg encrypts the message.
func (*PGP) GetIdentities ¶
GetIdentities return the first identities from current object.
func (*PGP) SaveKey ¶
SaveKey writes the whole entity (including private key!) to a .gpg file.
func (*PGP) WriteFile ¶
WriteFile from given buffer in specified path.
Source Files ¶
- Version
- v0.0.0-20250322185616-c50a578426f1 (latest)
- Published
- Mar 22, 2025
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 4 days ago –
Tools for package owners.