depot

package
v0.0.0-...-c3dd5ec Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2015 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	DefaultFileDepotDir = ".etcd-ca"
)

Variables

This section is empty.

Functions

func CheckCertificateAuthority

func CheckCertificateAuthority(d Depot) bool

func CheckCertificateAuthorityInfo

func CheckCertificateAuthorityInfo(d Depot) bool

func CheckCertificateHost

func CheckCertificateHost(d Depot, name string) bool

func CheckCertificateSigningRequest

func CheckCertificateSigningRequest(d Depot, name string) bool

func CheckEncryptedPrivateKeyAuthority

func CheckEncryptedPrivateKeyAuthority(d Depot) bool

func CheckEncryptedPrivateKeyHost

func CheckEncryptedPrivateKeyHost(d Depot, name string) bool

func CheckPrivateKeyAuthority

func CheckPrivateKeyAuthority(d Depot) bool

func CheckPrivateKeyHost

func CheckPrivateKeyHost(d Depot, name string) bool

func DeleteCertificateAuthority

func DeleteCertificateAuthority(d Depot) error

func DeleteCertificateAuthorityInfo

func DeleteCertificateAuthorityInfo(d Depot) error

func DeleteCertificateHost

func DeleteCertificateHost(d Depot, name string) error

func DeleteCertificateSigningRequest

func DeleteCertificateSigningRequest(d Depot, name string) error

func DeleteEncryptedPrivateKeyAuthority

func DeleteEncryptedPrivateKeyAuthority(d Depot) error

func DeleteEncryptedPrivateKeyHost

func DeleteEncryptedPrivateKeyHost(d Depot, name string) error

func DeletePrivateKeyAuthority

func DeletePrivateKeyAuthority(d Depot) error

func DeletePrivateKeyHost

func DeletePrivateKeyHost(d Depot, name string) error

func GetCertificateAuthority

func GetCertificateAuthority(d Depot) (crt *pkix.Certificate, err error)

func GetCertificateAuthorityInfo

func GetCertificateAuthorityInfo(d Depot) (info *pkix.CertificateAuthorityInfo, err error)

func GetCertificateHost

func GetCertificateHost(d Depot, name string) (crt *pkix.Certificate, err error)

func GetCertificateSigningRequest

func GetCertificateSigningRequest(d Depot, name string) (crt *pkix.CertificateSigningRequest, err error)

func GetEncryptedPrivateKeyAuthority

func GetEncryptedPrivateKeyAuthority(d Depot, passphrase []byte) (key *pkix.Key, err error)

func GetEncryptedPrivateKeyHost

func GetEncryptedPrivateKeyHost(d Depot, name string, passphrase []byte) (key *pkix.Key, err error)

func GetNameFromHostCrtTag

func GetNameFromHostCrtTag(tag *Tag) string

func GetPrivateKeyAuthority

func GetPrivateKeyAuthority(d Depot) (key *pkix.Key, err error)

func GetPrivateKeyHost

func GetPrivateKeyHost(d Depot, name string) (key *pkix.Key, err error)

func PutCertificateAuthority

func PutCertificateAuthority(d Depot, crt *pkix.Certificate) error

func PutCertificateAuthorityInfo

func PutCertificateAuthorityInfo(d Depot, info *pkix.CertificateAuthorityInfo) error

func PutCertificateHost

func PutCertificateHost(d Depot, name string, crt *pkix.Certificate) error

func PutCertificateSigningRequest

func PutCertificateSigningRequest(d Depot, name string, csr *pkix.CertificateSigningRequest) error

func PutEncryptedPrivateKeyAuthority

func PutEncryptedPrivateKeyAuthority(d Depot, key *pkix.Key, passphrase []byte) error

func PutEncryptedPrivateKeyHost

func PutEncryptedPrivateKeyHost(d Depot, name string, key *pkix.Key, passphrase []byte) error

func PutPrivateKeyAuthority

func PutPrivateKeyAuthority(d Depot, key *pkix.Key) error

func PutPrivateKeyHost

func PutPrivateKeyHost(d Depot, name string, key *pkix.Key) error

func UpdateCertificateAuthorityInfo

func UpdateCertificateAuthorityInfo(d Depot, info *pkix.CertificateAuthorityInfo) error

Types

type Depot

type Depot interface {
	Put(tag *Tag, data []byte) error
	Check(tag *Tag) bool
	Get(tag *Tag) ([]byte, error)
	Delete(tag *Tag) error
}

Depot is in charge of data storage

type File

type File struct {
	Info os.FileInfo
	Data []byte
}

type FileDepot

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

FileDepot is a implementation of Depot using file system

func NewFileDepot

func NewFileDepot(dir string) (*FileDepot, error)

func (*FileDepot) Check

func (d *FileDepot) Check(tag *Tag) bool

func (*FileDepot) Delete

func (d *FileDepot) Delete(tag *Tag) error

func (*FileDepot) Get

func (d *FileDepot) Get(tag *Tag) ([]byte, error)

func (*FileDepot) GetFile

func (d *FileDepot) GetFile(tag *Tag) (*File, error)

func (*FileDepot) List

func (d *FileDepot) List() []*Tag

func (*FileDepot) Put

func (d *FileDepot) Put(tag *Tag, data []byte) error

type Tag

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

Tag includes name and permission requirement Permission requirement is used in two ways: 1. Set the permission for data when Put 2. Check the permission required when Get It is set to prevent attacks from other users for FileDepot. For example, 'evil' creates file ca.key with 0666 file perm, 'core' reads it and uses it as ca.key. It may cause the security problem of fake certificate and key.

func AuthCrtInfoTag

func AuthCrtInfoTag() *Tag

func AuthCrtTag

func AuthCrtTag() *Tag

func AuthPrivKeyTag

func AuthPrivKeyTag() *Tag

func HostCrtTag

func HostCrtTag(name string) *Tag

func HostCsrTag

func HostCsrTag(name string) *Tag

func HostPrivKeyTag

func HostPrivKeyTag(name string) *Tag

Jump to

Keyboard shortcuts

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