Documentation
¶
Index ¶
- type Cli
- func (c *Cli) AfterApply(app *kong.Kong, vars kong.Vars) error
- func (c *Cli) Context() context.Context
- func (c *Cli) CryptoProv() (*cryptoprov.Crypto, cryptoprov.Provider)
- func (c *Cli) ErrWriter() io.Writer
- func (c *Cli) ReadFile(filename string) ([]byte, error)
- func (c *Cli) Reader() io.Reader
- func (c *Cli) WithErrWriter(out io.Writer) *Cli
- func (c *Cli) WithReader(reader io.Reader) *Cli
- func (c *Cli) WithWriter(out io.Writer) *Cli
- func (c *Cli) WriteJSON(value interface{}) error
- func (c *Cli) Writer() io.Writer
- type CsrCmd
- type CsrCreateCmd
- type CsrSignCmd
- type GenCertCmd
- type HsmCmd
- type HsmGenKeyCmd
- type HsmKeyInfoCmd
- type HsmLsKeyCmd
- type HsmRmKeyCmd
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cli ¶
type Cli struct {
Version ctl.VersionFlag `name:"version" help:"Print version information and quit" hidden:""`
Cfg string `help:"Location of HSM config file, as default crypto provider" required:""`
Crypto []string `help:"Location of additional HSM config files" type:"path"`
PlainKey bool `help:"Generate plain key"`
Debug bool `short:"D" help:"Enable debug mode"`
LogLevel string `short:"l" help:"Set the logging level (debug|info|warn|error)" default:"error"`
// contains filtered or unexported fields
}
Cli provides CLI context to run commands
func (*Cli) AfterApply ¶
AfterApply hook loads config
func (*Cli) CryptoProv ¶
func (c *Cli) CryptoProv() (*cryptoprov.Crypto, cryptoprov.Provider)
CryptoProv loads Crypto provider
func (*Cli) WithErrWriter ¶
WithErrWriter allows to specify a custom error writer
func (*Cli) WithReader ¶
WithReader allows to specify a custom reader
func (*Cli) WithWriter ¶
WithWriter allows to specify a custom writer
type CsrCmd ¶
type CsrCmd struct {
Create CsrCreateCmd `cmd:"" help:"create certificate request"`
GenCert GenCertCmd `cmd:"" help:"create CSR and sign certificate"`
Sign CsrSignCmd `cmd:"" help:"sign certificate"`
}
CsrCmd is the parent for CSR command
type CsrCreateCmd ¶
type CsrCreateCmd struct {
CsrProfile string `required:"" help:"file name with CSR profile"`
KeyLabel string `required:"" help:"name for generated key"`
Output string `help:"the optional prefix for output files; if not set, the output will be printed to STDOUT only"`
}
CsrCreateCmd specifies flags for Create command
type CsrSignCmd ¶
type CsrSignCmd struct {
Csr string `kong:"arg" required:"" help:"file name with pem-encoded CSR to sign"`
CACert string `required:"" help:"file name of the signing CA cert"`
CAKey string `required:"" help:"file name of the signing CA key"`
CAConfig string `required:"" help:"file name with ca-config"`
Profile string `required:"" help:"certificate profile name from CA config"`
San []string `help:"Subject Alt Names for generated cert"`
AiaURL string `help:"optional AIA to add to the certificate"`
OcspURL string `help:"optional OCSP URL to add to the certificate"`
CrlURL string `help:"optional CRL DP to add to the certificate"`
PemInfo bool `help:"Include certificate info in PEM file"`
Output string `help:"the optional prefix for output files; if not set, the output will be printed to STDOUT only"`
}
CsrSignCmd signs certificate request
type GenCertCmd ¶
type GenCertCmd struct {
SelfSign bool `help:"generate self-signed cert"`
CACert string `help:"file name of the signing CA cert"`
CAKey string `help:"file name of the signing CA key"`
CAConfig string `required:"" help:"file name with ca-config"`
CsrProfile string `required:"" help:"file name with CSR profile"`
Profile string `required:"" help:"certificate profile name from CA config"`
KeyLabel string `required:"" help:"name for generated key"`
San []string `help:"Subject Alt Names for generated cert"`
PemInfo bool `help:"Include certificate info in PEM file"`
Output string `help:"the optional prefix for output files; if not set, the output will be printed to STDOUT only"`
}
GenCertCmd specifies flags for GenCert command
type HsmCmd ¶
type HsmCmd struct {
List HsmLsKeyCmd `cmd:"" help:"list keys"`
Info HsmKeyInfoCmd `cmd:"" help:"print key information"`
Generate HsmGenKeyCmd `cmd:"" help:"generate key"`
Remove HsmRmKeyCmd `cmd:"" help:"delete key"`
}
HsmCmd is the parent for HSM command
type HsmGenKeyCmd ¶
type HsmGenKeyCmd struct {
Algo string `required:"" help:"algorithm: RSA|ECDSA"`
Size int `required:"" help:"key size in bits"`
Purpose string `required:"" help:"purpose of the key: SIGN|ENCRYPT"`
Label string `required:"" help:"name for generated key"`
Output string `help:"location to write the key, if not set, the output will be printed to STDOUT only"`
Force bool `help:"force to override key file if exists"`
}
HsmGenKeyCmd generates key
type HsmKeyInfoCmd ¶
type HsmKeyInfoCmd struct {
ID string `kong:"arg" required:"" help:"key ID"`
Token string `help:"slot token (optional)"`
Serial string `help:"slot serial (optional)"`
Public bool `help:"print Public Key"`
}
HsmKeyInfoCmd prints the key info
type HsmLsKeyCmd ¶
type HsmLsKeyCmd struct {
Token string `help:"specifies slot token (optional)"`
Serial string `help:"specifies slot serial (optional)"`
Prefix string `help:"specifies key label prefix (optional)"`
}
HsmLsKeyCmd prints Keys
type HsmRmKeyCmd ¶
type HsmRmKeyCmd struct {
ID string `kong:"arg" required:"" help:"specifies key ID"`
Token string `help:"specifies slot token (optional)"`
Serial string `help:"specifies slot serial (optional)"`
}
HsmRmKeyCmd deletes key
Click to show internal directories.
Click to hide internal directories.