v0.3.0 Latest Latest

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 17 Imported by: 0




View Source
const DefaultProfileName = "default"

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

View Source
const InlinePrefix = "inline:"


This section is empty.


func CheckFileNotExist

func CheckFileNotExist(path string) error

func DefaultStoragePath

func DefaultStoragePath() (string, error)

func KubernetesSecretFromCertAndKey added in v0.3.0

func KubernetesSecretFromCertAndKey(name, namespace string, cacertPem, certPem, keyPem []byte) []byte

KubernetesSecretFromCertAndKey creates a k8s secret yaml from given cert and key.

func ReadCertificateFile

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

func ReadFileOrInlineText added in v0.2.3

func ReadFileOrInlineText(p string) ([]byte, error)

func ReadPrivateKeyFile

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

func VerifyProfileName added in v0.2.2

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
const (
	ValidCA CAStatusCode = iota
	MaxCAStatusCode = Expired

func (CAStatusCode) String added in v0.2.3

func (c CAStatusCode) String() string

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)


Path Synopsis

Jump to

Keyboard shortcuts

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