Documentation
¶
Overview ¶
Package gpgagent interacts with the local GPG Agent.
Index ¶
- Constants
- Variables
- func AddRecipientAction(recipient string)
- func CreateAction(recipients []string)
- func DecryptAsymmetricPGP(encryptedData []byte, passphrase string) ([]byte, error)
- func DelAction(key string)
- func DiscoverVersion(d []byte, mapping map[string]VersionMatcher) string
- func DownloadUsingGist(dsn *dsn.Dsn) (err error)
- func DownloadUsingS3(dsn *dsn.Dsn) error
- func DownloadUsingScp(dsn *dsn.Dsn, privateKey string) (err error)
- func EncryptAsymmetricPGP(plainData []byte, recipients []string) ([]byte, error)
- func ExportAction(to string, plain bool)
- func GetAction(key string, filepath string)
- func GetPassphrase() (passphrase string)
- func GetStorePath() string
- func ImportAction(from string, strategy ImportStrategy, plain bool)
- func ImportStore(src, dest *Store, strategy ImportStrategy) error
- func InferStorePath() string
- func KeysAction()
- func ListRecipientsAction()
- func MetaAction()
- func PathExists(path string) bool
- func PromptForPassword() string
- func PullAction(source string, sshPrivateKey string, askPassword bool)
- func PushAction(destination string, sshPrivateKey string, askPassword bool)
- func RemoveRecipientAction(recipient string)
- func RenameAction(src, dest string, overwrite bool)
- func SetAction(key, value, file string)
- func SetStorePath(storePath string)
- func ShowAction()
- func UpgradeAction(yes, noBackup bool)
- func UpgradeFrom(startVersion string, d []byte, mapping map[string]UpgradeClosure) ([]byte, error)
- func UploadUsingGist(dsn *dsn.Dsn) (err error)
- func UploadUsingS3(dsn *dsn.Dsn) error
- func UploadUsingScp(dsn *dsn.Dsn, privateKey string) (err error)
- type Conn
- type CryptoAlgorithm
- type CryptoType
- type ImportStrategy
- type KVStore
- func (kvs *KVStore) Del(key string)
- func (kvs *KVStore) Get(key string) (interface{}, error)
- func (kvs *KVStore) Items() map[string]interface{}
- func (kvs *KVStore) Keys() []string
- func (kvs *KVStore) Rename(src, dest string, overwrite bool) error
- func (kvs *KVStore) Set(key string, value interface{})
- type Meta
- type PassphraseRequest
- type Store
- type Trousseau
- type UpgradeClosure
- type VersionMatcher
Constants ¶
const ( CONFIG_KEY_RECIPIENTS = "recipients" CONFIG_KEY_PASSWORD = "password" )
const ( ENV_TROUSSEAU_STORE = "TROUSSEAU_STORE" ENV_PASSPHRASE_KEY = "TROUSSEAU_PASSPHRASE" ENV_KEYRING_SERVICE_KEY = "TROUSSEAU_KEYRING_SERVICE" ENV_KEYRING_USER_KEY = "USER" ENV_MASTER_GPG_ID_KEY = "TROUSSEAU_MASTER_GPG_ID" ENV_SSH_PRIVATE_KEY = "TROUSSEAU_PRIVATE_KEY" )
const ( IMPORT_YOURS = 0x0 IMPORT_THEIRS = 0x1 IMPORT_OVERWRITE = 0x2 )
Import strategies enumeration
const (
DEFAULT_STORE_FILENAME = ".trousseau"
)
const TROUSSEAU_VERSION = "0.3.4"
Variables ¶
var ( S3Defaults map[string]string = map[string]string{ "Path": "trousseau.tsk", } ScpDefaults map[string]string = map[string]string{ "Id": os.Getenv("USER"), "Port": "22", "Path": "trousseau.tsk", } )
Global variables defining default values for S3 and scp uploads/downloads
var ( ErrNoAgent = errors.New("GPG_AGENT_INFO not set in environment") ErrNoData = errors.New("GPG_ERR_NO_DATA cache miss") ErrCancel = errors.New("gpgagent: Cancel") )
var ErrorLogger = log.New(os.Stderr, "Error: ", 0)
var GnupgHome = path.Join(os.Getenv("HOME"), ".gnupg")
Gnupg variables
var GnupgPubring func() string = func() string { return path.Join(GnupgHome, "pubring.gpg") }
var GnupgSecring func() string = func() string { return path.Join(GnupgHome, "secring.gpg") }
var InfoLogger = log.New(os.Stdout, "", 0)
var UpgradeClosures map[string]UpgradeClosure = map[string]UpgradeClosure{
"0.3.0": upgradeZeroDotThreeToNext,
}
var VersionDiscoverClosures map[string]VersionMatcher = map[string]VersionMatcher{
"0.3.0": isVersionZeroDotThreeDotZero,
"0.3.1": isVersionZeroDotThreeDotOne,
}
Functions ¶
func AddRecipientAction ¶
func AddRecipientAction(recipient string)
func CreateAction ¶
func CreateAction(recipients []string)
func DecryptAsymmetricPGP ¶
DecryptAsymmetricPGP decrypts an OpenPGP message using GnuPG.
func DiscoverVersion ¶
func DiscoverVersion(d []byte, mapping map[string]VersionMatcher) string
func DownloadUsingGist ¶
downloadUsingGist executes the whole process of pulling the trousseau data store file from gist remote storage using the provided scheme informations.
func DownloadUsingS3 ¶
downloadUsingS3 executes the whole process of pulling the trousseau data store file from s3 remote storage using the provided environment.
func DownloadUsingScp ¶
downloadUsingScp executes the whole process of pulling the trousseau data store file from scp remote storage using the provided environment.
func EncryptAsymmetricPGP ¶
func ExportAction ¶
func GetPassphrase ¶
func GetPassphrase() (passphrase string)
GetPassphrase attemps to retrieve the user's gpg master key passphrase using multiple methods. First it will attempt to retrieve it from the environment, then it will try to fetch it from the system keyring manager, ultimately it will try to get it from a running gpg-agent daemon.
func GetStorePath ¶
func GetStorePath() string
func ImportAction ¶
func ImportAction(from string, strategy ImportStrategy, plain bool)
func ImportStore ¶
func ImportStore(src, dest *Store, strategy ImportStrategy) error
ImportStore imports the src encrypted data store content into dest data store, respecting the provided import strategy.
func InferStorePath ¶
func InferStorePath() string
func KeysAction ¶
func KeysAction()
func ListRecipientsAction ¶
func ListRecipientsAction()
func MetaAction ¶
func MetaAction()
func PathExists ¶
exists returns whether the given file or directory exists or not
func PromptForPassword ¶
func PromptForPassword() string
func PullAction ¶
func PushAction ¶
func RemoveRecipientAction ¶
func RemoveRecipientAction(recipient string)
func RenameAction ¶
func SetStorePath ¶
func SetStorePath(storePath string)
func ShowAction ¶
func ShowAction()
func UpgradeAction ¶
func UpgradeAction(yes, noBackup bool)
func UpgradeFrom ¶
func UploadUsingGist ¶
uploadUsingGist executes the whole process of pushing the trousseau data store file to gist remote storage using the provided dsn informations.
func UploadUsingS3 ¶
uploadUsingS3 executes the whole process of pushing the trousseau data store file to s3 remote storage using the provided environment.
Types ¶
type Conn ¶
type Conn struct {
// contains filtered or unexported fields
}
Conn is a connection to the GPG agent.
func NewGpgAgentConn ¶
NewGpgAgentConn connects to the GPG Agent as described in the GPG_AGENT_INFO environment variable.
func (*Conn) GetPassphrase ¶
func (c *Conn) GetPassphrase(pr *PassphraseRequest) (passphrase string, outerr error)
func (*Conn) RemoveFromCache ¶
type CryptoAlgorithm ¶
type CryptoAlgorithm int
Declare available encryption algorithms
const ( GPG_ENCRYPTION CryptoAlgorithm = 0 AES_256_ENCRYPTION CryptoAlgorithm = 1 )
type CryptoType ¶
type CryptoType int
Declare encryption types
const ( SYMMETRIC_ENCRYPTION CryptoType = 0 ASYMMETRIC_ENCRYPTION CryptoType = 1 )
type ImportStrategy ¶
type ImportStrategy uint32
func (*ImportStrategy) FromCliContext ¶
func (s *ImportStrategy) FromCliContext(c *cli.Context) error
TODO : remove
type KVStore ¶
type KVStore map[string]interface{}
type Meta ¶
type Meta struct { CreatedAt string `json:"created_at"` LastModifiedAt string `json:"last_modified_at"` Recipients []string `json:"recipients"` TrousseauVersion string `json:"version"` }
func (*Meta) AddRecipient ¶
func (*Meta) ListRecipients ¶
func (*Meta) RemoveRecipient ¶
type PassphraseRequest ¶
type PassphraseRequest struct {
CacheKey, Error, Prompt, Desc string
// If the option --no-ask is used and the passphrase is not in
// the cache the user will not be asked to enter a passphrase
// but the error code GPG_ERR_NO_DATA is returned. (ErrNoData)
NoAsk bool
}
PassphraseRequest is a request to get a passphrase from the GPG Agent.
type Trousseau ¶
type Trousseau struct { // Crypto public configuration attributes CryptoType CryptoType `json:"crypto_type"` CryptoAlgorithm CryptoAlgorithm `json:"crypto_algorithm"` // Encrypted data private attribute Data []byte `json:"_data"` // contains filtered or unexported fields }
func OpenTrousseau ¶
type UpgradeClosure ¶
type VersionMatcher ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Godeps
|
|
_workspace/src/code.google.com/p/go.crypto/cast5
Package cast5 implements CAST5, as defined in RFC 2144.
|
Package cast5 implements CAST5, as defined in RFC 2144. |
_workspace/src/code.google.com/p/go.crypto/openpgp
Package openpgp implements high level operations on OpenPGP messages.
|
Package openpgp implements high level operations on OpenPGP messages. |
_workspace/src/code.google.com/p/go.crypto/openpgp/armor
Package armor implements OpenPGP ASCII Armor, see RFC 4880.
|
Package armor implements OpenPGP ASCII Armor, see RFC 4880. |
_workspace/src/code.google.com/p/go.crypto/openpgp/clearsign
Package clearsign generates and processes OpenPGP, clear-signed data.
|
Package clearsign generates and processes OpenPGP, clear-signed data. |
_workspace/src/code.google.com/p/go.crypto/openpgp/elgamal
Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," IEEE Transactions on Information Theory, v.
|
Package elgamal implements ElGamal encryption, suitable for OpenPGP, as specified in "A Public-Key Cryptosystem and a Signature Scheme Based on Discrete Logarithms," IEEE Transactions on Information Theory, v. |
_workspace/src/code.google.com/p/go.crypto/openpgp/errors
Package errors contains common error types for the OpenPGP packages.
|
Package errors contains common error types for the OpenPGP packages. |
_workspace/src/code.google.com/p/go.crypto/openpgp/packet
Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880.
|
Package packet implements parsing and serialization of OpenPGP packets, as specified in RFC 4880. |
_workspace/src/code.google.com/p/go.crypto/openpgp/s2k
Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1.
|
Package s2k implements the various OpenPGP string-to-key transforms as specified in RFC 4800 section 3.7.1. |
_workspace/src/code.google.com/p/goauth2/oauth
The oauth package provides support for making OAuth2-authenticated HTTP requests.
|
The oauth package provides support for making OAuth2-authenticated HTTP requests. |
_workspace/src/code.google.com/p/goauth2/oauth/example
This program makes a call to the specified API, authenticated with OAuth2.
|
This program makes a call to the specified API, authenticated with OAuth2. |
_workspace/src/code.google.com/p/goauth2/oauth/jwt
The jwt package provides support for creating credentials for OAuth2 service account requests.
|
The jwt package provides support for creating credentials for OAuth2 service account requests. |
_workspace/src/code.google.com/p/goauth2/oauth/jwt/example
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2.
|
This program makes a read only call to the Google Cloud Storage API, authenticated with OAuth2. |
_workspace/src/code.google.com/p/gosshold/ssh
Package ssh implements an SSH client and server.
|
Package ssh implements an SSH client and server. |
_workspace/src/code.google.com/p/gosshold/ssh/terminal
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems.
|
Package terminal provides support functions for dealing with terminals, as commonly found on UNIX systems. |
_workspace/src/code.google.com/p/gosshold/ssh/test
This package contains integration tests for the code.google.com/p/gosshold/ssh package.
|
This package contains integration tests for the code.google.com/p/gosshold/ssh package. |
_workspace/src/github.com/codegangsta/cli
Package cli provides a minimal framework for creating and organizing command line Go applications.
|
Package cli provides a minimal framework for creating and organizing command line Go applications. |
_workspace/src/github.com/crowdmob/goamz/aws
goamz - Go packages to interact with the Amazon Web Services.
|
goamz - Go packages to interact with the Amazon Web Services. |
_workspace/src/github.com/google/go-github/github
Package github provides a client for using the GitHub API.
|
Package github provides a client for using the GitHub API. |
_workspace/src/github.com/google/go-querystring/query
Package query implements encoding of structs into URL query parameters.
|
Package query implements encoding of structs into URL query parameters. |
_workspace/src/github.com/guelfey/go.dbus
Package dbus implements bindings to the D-Bus message bus system.
|
Package dbus implements bindings to the D-Bus message bus system. |
_workspace/src/github.com/guelfey/go.dbus/introspect
Package introspect provides some utilities for dealing with the DBus introspection format.
|
Package introspect provides some utilities for dealing with the DBus introspection format. |
_workspace/src/github.com/guelfey/go.dbus/prop
Package prop provides the Properties struct which can be used to implement org.freedesktop.DBus.Properties.
|
Package prop provides the Properties struct which can be used to implement org.freedesktop.DBus.Properties. |
_workspace/src/github.com/howeyc/gopass
Reads password from terminal.
|
Reads password from terminal. |
_workspace/src/github.com/oleiade/reflections
Package reflections provides high level abstractions above the reflect library.
|
Package reflections provides high level abstractions above the reflect library. |
_workspace/src/github.com/oleiade/tempura
Package tempura provides temporary files creation and manipulation helpers for the purposes of enhancing tests involving files creation.
|
Package tempura provides temporary files creation and manipulation helpers for the purposes of enhancing tests involving files creation. |
_workspace/src/github.com/tmc/keyring
Package keyring provides a cross-platform interface to keychains for password management Currently implemented: * OSX * SecretService * gnome-keychain (via "gnome_keyring" build flag) Usage Example usage: err := keyring.Set("libraryFoo", "jack", "sacrifice") password, err := keyring.Get("libraryFoo", "jack") fmt.Println(password) Output: sacrifice TODO * Write Windows provider
|
Package keyring provides a cross-platform interface to keychains for password management Currently implemented: * OSX * SecretService * gnome-keychain (via "gnome_keyring" build flag) Usage Example usage: err := keyring.Set("libraryFoo", "jack", "sacrifice") password, err := keyring.Get("libraryFoo", "jack") fmt.Println(password) Output: sacrifice TODO * Write Windows provider |
_workspace/src/github.com/tmc/keyring/keyring-example
Shows example use of the keyring package May need to be built with a platform-specific build flag to specify a provider.
|
Shows example use of the keyring package May need to be built with a platform-specific build flag to specify a provider. |
cmd
|
|