Documentation ¶
Overview ¶
Package gpg provides encrypted files
Index ¶
- func CollectGPGPubKeys(fp string) (*openpgp.EntityList, error)
- func Encrypt(d []byte, encryptionKeys *openpgp.EntityList, useArmor bool) ([]byte, error)
- func EncryptToWithCmd(cmd *cobra.Command) (*openpgp.EntityList, error)
- func KeyTypeCompletion(_ *cobra.Command, _ []string, _ string) ([]string, cobra.ShellCompDirective)
- func NewKeyFilesWithPair(kp *KeyPair, dest string) ([]string, error)
- func ReadEntity(name string) (*openpgp.Entity, error)
- type FileInfo
- type KeyOpts
- type KeyPair
- type KeyType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CollectGPGPubKeys ¶
func CollectGPGPubKeys(fp string) (*openpgp.EntityList, error)
CollectGPGPubKeys returns an EntityList from a place of pub keys
func Encrypt ¶
Encrypt the provided bytes for the provided encryption keys recipients. Returns the encrypted content bytes.
func EncryptToWithCmd ¶
func EncryptToWithCmd(cmd *cobra.Command) (*openpgp.EntityList, error)
EncryptToWithCmd uses a cobra.Command to create an EntityList
func KeyTypeCompletion ¶ added in v0.11.0
KeyTypeCompletion returns shell completion
func NewKeyFilesWithPair ¶
NewKeyFilesWithPair Given a keypair object, write the contents to a public and private key file, returning those paths
Types ¶
type FileInfo ¶
FileInfo is information about a GPGFile
func NewFileInfo ¶
NewFileInfo returns a new FileInfo
type KeyPair ¶
KeyPair represents both the public and private keys
func NewKeyPair ¶
NewKeyPair generates a new gpg private and public key
type KeyType ¶ added in v0.11.0
type KeyType int
KeyType represents the different types of GPG keys supported
const ( // NullKeyType is the unset value for this type NullKeyType KeyType = iota // RSAKeyType represents and RSA key. This is the most commonly used option RSAKeyType // X25519Type is an elliptic curve Diffie-Hellman key exchange using // Curve25519. It allows two parties to jointly agree on a shared secret // using an insecure channel. X25519Type )
func (*KeyType) MarshalJSON ¶ added in v0.11.0
MarshalJSON ensures that json conversions use the string value here, not the int value