Documentation
¶
Index ¶
- Constants
- Variables
- func CertificateIssuerHash(certFile string) (string, error)
- func CertificateSubjectHash(certFile string) (string, error)
- func CheckErr(err error)
- func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)
- func CobraInit(cobraRootCmd CobraCommand)
- func ConfigDir() string
- func ConfigEdit()
- func ConfigInit(allowClobber bool) string
- func ConfigString(header bool) string
- func Confirm(prompt string) bool
- func Expand(value string) string
- func Fatal(err error) error
- func Fatalf(format string, args ...interface{}) error
- func FormatJSON(v any) string
- func FormatYAML(value any) string
- func HexDump(data []byte) string
- func Init(name, version, configFile string)
- func IsDir(path string) bool
- func IsFile(pathname string) bool
- func OptionInt(cobraCmd CobraCommand, name, flag string, defaultValue int, description string)
- func OptionKey(cobraCmd CobraCommand, key string) string
- func OptionString(cobraCmd CobraCommand, name, flag, defaultValue, description string)
- func OptionSwitch(cobraCmd CobraCommand, name, flag, description string)
- func ProgramName() string
- func ProgramVersion() string
- func ReadCertificate(certFile string) (*x509.Certificate, error)
- func Shutdown()
- func TildePath(path string) (string, error)
- func ViperGet(key string) any
- func ViperGetBool(key string) bool
- func ViperGetInt(key string) int
- func ViperGetInt64(key string) int64
- func ViperGetString(key string) string
- func ViperGetStringMapString(key string) map[string]string
- func ViperGetStringSlice(key string) []string
- func ViperKey(key string) string
- func ViperSet(key string, value any)
- func ViperSetDefault(key string, value any)
- func Warning(format string, args ...interface{})
- type APIClient
- type CertFactory
- func (c *CertFactory) CertificatePair(subjectName, duration, certFile, keyFile string) (string, string, error)
- func (c *CertFactory) Chain(pathname string) (string, error)
- func (c *CertFactory) Intermediate(pathname string) (string, error)
- func (c *CertFactory) Root(pathname string) (string, error)
- func (c *CertFactory) SetKeyType(keyType KeyType)
- type CobraCommand
- type KeyType
- type KeymasterConfig
- type Sendmail
- type StepConfig
- type SubjHash
Constants ¶
View Source
const ( KeyTypeRSA = iota KeyTypeECURVE KeyTypeED25519 )
View Source
const Version = "0.2.16"
Variables ¶
View Source
var ErrInvalidCertificate = errors.New("invalid certificate")
ErrInvalidCertificate is returned when an invalid certificate is supplied.
Functions ¶
func CertificateIssuerHash ¶ added in v0.2.15
func CertificateSubjectHash ¶ added in v0.2.15
func CobraAddCommand ¶ added in v0.2.1
func CobraAddCommand(cobraRootCmd, parentCmd, cobraCmd CobraCommand)
func CobraInit ¶ added in v0.2.1
func CobraInit(cobraRootCmd CobraCommand)
func ConfigEdit ¶ added in v0.2.1
func ConfigEdit()
func ConfigInit ¶ added in v0.2.1
func ConfigString ¶ added in v0.2.1
func FormatJSON ¶ added in v0.2.1
func FormatYAML ¶ added in v0.2.10
func OptionInt ¶ added in v0.2.4
func OptionInt(cobraCmd CobraCommand, name, flag string, defaultValue int, description string)
func OptionKey ¶ added in v0.2.1
func OptionKey(cobraCmd CobraCommand, key string) string
func OptionString ¶ added in v0.2.1
func OptionString(cobraCmd CobraCommand, name, flag, defaultValue, description string)
func OptionSwitch ¶ added in v0.2.1
func OptionSwitch(cobraCmd CobraCommand, name, flag, description string)
func ProgramName ¶ added in v0.2.1
func ProgramName() string
func ProgramVersion ¶ added in v0.2.1
func ProgramVersion() string
func ReadCertificate ¶ added in v0.2.15
func ReadCertificate(certFile string) (*x509.Certificate, error)
func ViperGetBool ¶ added in v0.2.1
func ViperGetInt ¶ added in v0.2.1
func ViperGetInt64 ¶ added in v0.2.1
func ViperGetString ¶ added in v0.2.1
func ViperGetStringMapString ¶ added in v0.2.1
func ViperGetStringSlice ¶ added in v0.2.1
func ViperSetDefault ¶ added in v0.2.1
Types ¶
type APIClient ¶ added in v0.2.1
type APIClient interface {
Close()
Get(path string, response interface{}) (string, error)
Post(path string, request, response interface{}, headers *map[string]string) (string, error)
Put(path string, request, response interface{}, headers *map[string]string) (string, error)
Delete(path string, response interface{}) (string, error)
}
type CertFactory ¶
type CertFactory struct {
Version string
Debug bool
Verbose bool
Raw bool
TTY bool
Overwrite bool
StepBinary string
DefaultDuration string
StepTimeoutSeconds int64
StepArgs []string
KeyType KeyType
PasswordFile string
Issuer string
Fingerprint string
CaURL string
RootCA string
ConfigDir string
CacheDir string
}
func NewCertFactory ¶
func NewCertFactory(stepArgs *[]string) (*CertFactory, error)
func (*CertFactory) CertificatePair ¶
func (c *CertFactory) CertificatePair(subjectName, duration, certFile, keyFile string) (string, string, error)
func (*CertFactory) Intermediate ¶ added in v0.1.9
func (c *CertFactory) Intermediate(pathname string) (string, error)
func (*CertFactory) SetKeyType ¶
func (c *CertFactory) SetKeyType(keyType KeyType)
type CobraCommand ¶ added in v0.2.1
type CobraCommand interface {
}
type KeymasterConfig ¶ added in v0.2.10
type StepConfig ¶ added in v0.2.6
type SubjHash ¶ added in v0.2.15
type SubjHash [4]byte
SubjHash is the certificate hash with fmt.Stringer interface support.
func IssuerHash ¶ added in v0.2.15
func IssuerHash(cert *x509.Certificate) (SubjHash, error)
Issuer takes a *x509.Certificate and returns the openssl 1.0.1+ compatible issuer_hash for the certificate.
func SubjectHash ¶ added in v0.2.15
func SubjectHash(cert *x509.Certificate) (SubjHash, error)
Subject takes a *x509.Certificate and returns the openssl 1.0.1+ compatible subject_hash for the certificate.
Click to show internal directories.
Click to hide internal directories.