cred

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultKey = []byte{0x24, 0x66, 0xDD, 0x87, 0x8B, 0x96, 0x3C, 0x9D}
View Source
var PasswordCipher = GetDefaultPasswordCipher()

Functions

func IsKeyEncrypted

func IsKeyEncrypted(keyPath string) bool

IsKeyEncrypted checks if supplied key content is encrypyed by password

Types

type Cipher

type Cipher interface {
	Encryptor
	Decryptor
}

func GetDefaultPasswordCipher

func GetDefaultPasswordCipher() Cipher

GetDefaultPasswordCipher return a default password cipher

func NewBlowfishCipher

func NewBlowfishCipher(key []byte) (Cipher, error)

type Config

type Config struct {
	Username          string `json:",omitempty"`
	Password          string `json:",omitempty"`
	EncryptedPassword string `json:",omitempty"`
	PrivateKeyPath    string `json:",omitempty"`

	//amazon cloud credential
	Key    string `json:",omitempty"`
	Secret string `json:",omitempty"`
	Region string `json:",omitempty"`

	//google cloud credential
	ClientEmail  string `json:"client_email,omitempty"`
	TokenURL     string `json:"token_uri,omitempty"`
	PrivateKey   string `json:"private_key,omitempty"`
	PrivateKeyID string `json:"private_key_id,omitempty"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(filename string) (*Config, error)

NewConfig create a new config for supplied file name

func (*Config) ClientConfig

func (c *Config) ClientConfig() (*ssh.ClientConfig, error)

ClientConfig returns a new instance of sshClientConfig

func (*Config) Load

func (c *Config) Load(filename string) error

func (*Config) LoadFromReader

func (c *Config) LoadFromReader(reader io.Reader, ext string) error

func (*Config) NewJWTConfig

func (c *Config) NewJWTConfig(scopes ...string) (*jwt.Config, error)

NewJWTConfig returns new JWT config for supplied scopes

func (*Config) SSHClientConfig

func (c *Config) SSHClientConfig() (*ssh.ClientConfig, error)

SSHClientConfig returns a new instance of sshClientConfig

func (*Config) Save

func (c *Config) Save(filename string) error

type Decryptor

type Decryptor interface {
	Decrypt(src []byte) []byte
}

type Encryptor

type Encryptor interface {
	Encrypt(src []byte) []byte
}

Jump to

Keyboard shortcuts

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