storage

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NotCA = iota
	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 {
	Code          CAStatusCode
	UnderlyingErr 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) ReadCACertificate

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

func (*Profile) ReadCAPrivateKey

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

func (*Profile) ReadCASubject

func (s *Profile) ReadCASubject() (*dname.Config, 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() *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) Profile

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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