storage

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidCA = iota
	NotCA
	Broken
	Expired
)
View Source
const DefaultProfileName = "default"

The name of storage profile to be used as default if nothing was specified.

Variables

This section is empty.

Functions

func CheckFileNotExist

func CheckFileNotExist(path string) error

func DefaultStoragePath

func DefaultStoragePath() (string, error)

func ReadCertificateFile

func ReadCertificateFile(p string) (*x509.Certificate, error)

func ReadPrivateKeyFile

func ReadPrivateKeyFile(p string) (crypto.PrivateKey, error)

func WriteCertificateDerFile

func WriteCertificateDerFile(p string, certDer []byte) error

func WriteCertificateFile

func WriteCertificateFile(p string, cert *x509.Certificate) error

func WritePrivateKeyFile

func WritePrivateKeyFile(p string, priv crypto.PrivateKey) error

Types

type CAStatus

type CAStatus struct {
	Profile *Profile
	Code    CAStatusCode
	CACert  *x509.Certificate
	Err     error
}

func (*CAStatus) Error

func (s *CAStatus) Error() string

func (*CAStatus) Unwrap

func (s *CAStatus) Unwrap() error

type CAStatusCode

type CAStatusCode int

type Profile

type Profile struct {
	BaseDir string
}

func (*Profile) CACertPath

func (s *Profile) CACertPath() string

func (*Profile) CAPrivateKeyPath

func (s *Profile) CAPrivateKeyPath() string

func (*Profile) IssueDBPath

func (s *Profile) IssueDBPath() string

func (*Profile) Name added in v0.1.0

func (p *Profile) Name() string

func (*Profile) ReadCACertificate

func (s *Profile) ReadCACertificate() (*x509.Certificate, error)

func (*Profile) ReadCAPrivateKey

func (s *Profile) ReadCAPrivateKey() (crypto.PrivateKey, error)

func (*Profile) ReadServerCertificate

func (s *Profile) ReadServerCertificate() (*x509.Certificate, error)

func (*Profile) ReadServerPrivateKey

func (s *Profile) ReadServerPrivateKey() (crypto.PrivateKey, error)

func (*Profile) Status

func (s *Profile) Status(now time.Time) (st *CAStatus)

func (*Profile) String

func (p *Profile) String() string

func (*Profile) WriteCACertificateDer

func (s *Profile) WriteCACertificateDer(certDer []byte) error

func (*Profile) WriteCAPrivateKey

func (s *Profile) WriteCAPrivateKey(priv crypto.PrivateKey) error

func (*Profile) WriteServerCertificate

func (s *Profile) WriteServerCertificate(cert *x509.Certificate) error

func (*Profile) WriteServerPrivateKey

func (s *Profile) WriteServerPrivateKey(priv crypto.PrivateKey) error

type Storage

type Storage struct {
	BaseDir string
}

func New

func New(baseDir string) (*Storage, error)

func (*Storage) ClientCertPath

func (s *Storage) ClientCertPath() string

func (*Storage) ClientPrivateKeyPath

func (s *Storage) ClientPrivateKeyPath() string

func (*Storage) ConnectionInfoPath

func (s *Storage) ConnectionInfoPath() string

func (*Storage) GeoIpCachePath added in v0.1.0

func (s *Storage) GeoIpCachePath() string

func (*Storage) Profile

func (s *Storage) Profile(name string) (*Profile, error)

func (*Storage) Profiles added in v0.1.0

func (s *Storage) Profiles() ([]*Profile, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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