keyStore

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2016 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Config

type Config struct {
	// @default generated
	//
	// Defines the type of instance keyStore.
	Type Type `json:"type" yaml:"type"`

	// @default ""
	//
	// Defines the pemFile which contains the key and certificate to use.
	// This have to be of type PEM and have to contain the certificate and private key.
	// Currently the private key is only supported of type RSA.
	//
	// This property is only evaluated and required if {@ref #Type type} is set to
	// {@ref .Type#FromFile fromFile}.
	PemFile String `json:"pemFile,omitempty" yaml:"pemFile"`

	// @default "algorithm:`rsa` bits:`1024`"
	//
	// Defines some hints for instance store in format “[<key:`value`>...]“.
	// Possible hints are:
	//
	// * “algorithm“: Algorithm to use for creation of new keys. Currently only “rsa“ is supported.
	// * “bits“: Number of bits to create a new key with.
	Hints String `json:"hints,omitempty" yaml:"hints"`

	// @default ""
	//
	// File where trusted certificates are stored in. This have to be in PEM format.
	CaFile String `json:"caFile,omitempty" yaml:"caFile"`
}

Description

Defines the keyStore of caretakerd.

func NewConfig

func NewConfig() Config

func (Config) GetKeyArgument

func (instance Config) GetKeyArgument(key string) string

func (Config) Validate

func (instance Config) Validate() error

type KeyStore

type KeyStore struct {
	// contains filtered or unexported fields
}

func NewKeyStore

func NewKeyStore(enabled bool, conf Config) (*KeyStore, error)

func (KeyStore) Ca

func (instance KeyStore) Ca() []*x509.Certificate

func (KeyStore) Config

func (instance KeyStore) Config() Config

func (KeyStore) GeneratePem

func (instance KeyStore) GeneratePem(name string) ([]byte, *x509.Certificate, error)

func (KeyStore) IsCA

func (instance KeyStore) IsCA() bool

func (KeyStore) IsEnabled

func (instance KeyStore) IsEnabled() bool

func (KeyStore) LoadCertificateFromFile

func (instance KeyStore) LoadCertificateFromFile(filename string) (*x509.Certificate, error)

func (KeyStore) Pem

func (instance KeyStore) Pem() []byte

func (KeyStore) Type

func (instance KeyStore) Type() Type

type Type

type Type int

Description

Represents the type of the keyStore.

const (
	// @id generated
	// Indicates that caretakerd have to generate its own keyStore on startup.
	// This is the best solution in most cases.
	Generated Type = 0

	// @id fromFile
	// Load keyStore from a provided PEM file.
	// If instance type is selected instance file have to be provided.
	FromFile Type = 1

	// @id fromEnvironment
	// Load keyStore from the environment variable “CTD_PEM“ in PEM format.
	// If instance type is selected instance variable have to be provided.
	FromEnvironment Type = 2
)

func (Type) CheckedString

func (i Type) CheckedString() (string, error)

func (Type) IsConsumingCaFile

func (i Type) IsConsumingCaFile() bool

func (Type) IsGenerating

func (i Type) IsGenerating() bool

func (Type) IsTakingFilename

func (i Type) IsTakingFilename() bool

func (Type) MarshalJSON

func (i Type) MarshalJSON() ([]byte, error)

func (Type) MarshalYAML

func (i Type) MarshalYAML() (interface{}, error)

func (*Type) Set

func (i *Type) Set(value string) error

func (Type) String

func (i Type) String() string

func (*Type) UnmarshalJSON

func (i *Type) UnmarshalJSON(b []byte) error

func (*Type) UnmarshalYAML

func (i *Type) UnmarshalYAML(unmarshal func(interface{}) error) error

func (Type) Validate

func (i Type) Validate() error

Jump to

Keyboard shortcuts

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