Back to godoc.org

Package storage

v0.2.2
Latest Go to latest
Published: May 30, 2020 | License: Apache-2.0 | Module: github.com/IPA-CyberLab/kmgm

Index

Package Files

Constants

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

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

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 VerifyProfileName

func VerifyProfileName(name string) 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

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

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

func (s *Storage) GeoIpCachePath() string

func (*Storage) Profile

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

func (*Storage) Profiles

func (s *Storage) Profiles() ([]*Profile, error)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier