certs

package
v1.17.4 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidPairCertificate = errors.New("invalid pair certificate")
	ErrInvalidCertificate     = errors.New("invalid certificate")
	ErrInvalidPrivateKey      = errors.New("invalid private key")
)

Functions

func ViperDecoderHook

func ViperDecoderHook() libmap.DecodeHookFuncType

Types

type Cert

type Cert interface {
	encoding.TextMarshaler
	encoding.TextUnmarshaler
	encoding.BinaryMarshaler
	encoding.BinaryUnmarshaler
	json.Marshaler
	json.Unmarshaler
	yaml.Marshaler
	yaml.Unmarshaler
	toml.Marshaler
	toml.Unmarshaler
	cbor.Marshaler
	cbor.Unmarshaler
	fmt.Stringer

	TLS() tls.Certificate
	Model() Certif

	IsChain() bool
	IsPair() bool

	IsFile() bool
	GetCerts() []string
}

func Parse

func Parse(chain string) (Cert, error)

func ParsePair

func ParsePair(key, pub string) (Cert, error)

type Certif

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

func (*Certif) Cert

func (o *Certif) Cert() Cert

func (*Certif) Chain

func (o *Certif) Chain() (string, error)

func (*Certif) GetCerts

func (o *Certif) GetCerts() []string

func (*Certif) IsChain

func (o *Certif) IsChain() bool

func (*Certif) IsFile

func (o *Certif) IsFile() bool

func (*Certif) IsPair

func (o *Certif) IsPair() bool

func (*Certif) MarshalBinary

func (o *Certif) MarshalBinary() (data []byte, err error)

func (*Certif) MarshalCBOR

func (o *Certif) MarshalCBOR() ([]byte, error)

func (*Certif) MarshalJSON

func (o *Certif) MarshalJSON() ([]byte, error)

func (*Certif) MarshalTOML

func (o *Certif) MarshalTOML() ([]byte, error)

func (*Certif) MarshalText

func (o *Certif) MarshalText() (text []byte, err error)

func (*Certif) MarshalYAML

func (o *Certif) MarshalYAML() (interface{}, error)

func (*Certif) Model

func (o *Certif) Model() Certif

func (*Certif) Pair

func (o *Certif) Pair() (pub string, key string, err error)

func (*Certif) String

func (o *Certif) String() string

func (*Certif) TLS

func (o *Certif) TLS() tls.Certificate

func (*Certif) UnmarshalBinary

func (o *Certif) UnmarshalBinary(data []byte) error

func (*Certif) UnmarshalCBOR

func (o *Certif) UnmarshalCBOR(bytes []byte) error

func (*Certif) UnmarshalJSON

func (o *Certif) UnmarshalJSON(bytes []byte) error

func (*Certif) UnmarshalTOML

func (o *Certif) UnmarshalTOML(i interface{}) error

func (*Certif) UnmarshalText

func (o *Certif) UnmarshalText(text []byte) error

func (*Certif) UnmarshalYAML

func (o *Certif) UnmarshalYAML(value *yaml.Node) error

type Config

type Config interface {
	Cert() (*tls.Certificate, error)

	IsChain() bool
	IsPair() bool

	IsFile() bool
	GetCerts() []string
}

type ConfigChain

type ConfigChain string

func (*ConfigChain) Cert

func (c *ConfigChain) Cert() (*tls.Certificate, error)

func (*ConfigChain) GetCerts

func (c *ConfigChain) GetCerts() []string

func (*ConfigChain) IsChain

func (c *ConfigChain) IsChain() bool

func (*ConfigChain) IsFile

func (c *ConfigChain) IsFile() bool

func (*ConfigChain) IsPair

func (c *ConfigChain) IsPair() bool

type ConfigPair

type ConfigPair struct {
	Key string `mapstructure:"key" json:"key" yaml:"key" toml:"key"`
	Pub string `mapstructure:"pub" json:"pub" yaml:"pub" toml:"pub"`
}

func (*ConfigPair) Cert

func (c *ConfigPair) Cert() (*tls.Certificate, error)

func (*ConfigPair) GetCerts

func (c *ConfigPair) GetCerts() []string

func (*ConfigPair) IsChain

func (c *ConfigPair) IsChain() bool

func (*ConfigPair) IsFile

func (c *ConfigPair) IsFile() bool

func (*ConfigPair) IsPair

func (c *ConfigPair) IsPair() bool

Jump to

Keyboard shortcuts

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