cli

package
v0.0.0-...-fe4d2ff Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct{}

func (*App) Run

func (*App) Run()

type CACertAddCmd

type CACertAddCmd struct {
	PrivateKeyOption
	Requester string `short:"r" long:"requester" help:"Requester name" required:""`

	Country    []string `long:"country" help:"Country name" required:""`
	Org        []string `long:"org" help:"Organization name" required:""`
	Unit       []string `long:"unit" help:"Unit name" required:""`
	CommonName string   `long:"common-name" help:"Common name" required:""`
}

func (*CACertAddCmd) Run

func (*CACertAddCmd) Run(cli *CertServerCli) error

type CACertGetCmd

type CACertGetCmd RootCertGetCmd

func (*CACertGetCmd) Run

func (*CACertGetCmd) Run(cli *CertServerCli) error

type CACertListCmd

type CACertListCmd RootCertListCmd

func (*CACertListCmd) Run

func (*CACertListCmd) Run(cli *CertServerCli) error

type CACertRespondCmd

type CACertRespondCmd struct {
	Requester string `short:"r" long:"requester" help:"Requester name" required:""`
	ID        string `help:"Certificate ID" required:""`
	Cert      []byte `type:"filecontent" help:"Certificate content" required:""`
}

func (*CACertRespondCmd) Run

type CACertRevokeCmd

type CACertRevokeCmd struct {
	Requester string `short:"r" long:"requester" help:"Requester name" required:""`
	ID        string `required:""`
	CRL       []byte `type:"filecontent" help:"Certificate Revocation List" required:""`
}

func (*CACertRevokeCmd) Run

func (*CACertRevokeCmd) Run(cli *CertServerCli) error

type CertAddCmd

type CertAddCmd struct {
	Requester string         `short:"r" long:"requester" help:"Requester name" required:""`
	CertType  model.CertType `enum:"business_unit,third_party_ca" required:""`
	CSR       []byte         `type:"filecontent" help:"Certificate Signing Request" required:""`
}

func (*CertAddCmd) Run

func (*CertAddCmd) Run(cli *CertServerCli) error

type CertGetCmd

type CertGetCmd RootCertGetCmd

func (*CertGetCmd) Run

func (*CertGetCmd) Run(cli *CertServerCli) error

type CertIssueCmd

type CertIssueCmd struct {
	Requester string         `short:"r" long:"requester" help:"Requester name" required:""`
	ID        string         `required:""`
	CACertID  string         `required:""`
	CertType  model.CertType `enum:"business_unit,third_party_ca" required:""`
	NotBefore time.Time      `required:""`
	NotAfter  time.Time      `required:""`
}

func (*CertIssueCmd) Run

func (*CertIssueCmd) Run(cli *CertServerCli) error

type CertListCmd

type CertListCmd RootCertListCmd

func (*CertListCmd) Run

func (*CertListCmd) Run(cli *CertServerCli) error

type CertRejectCmd

type CertRejectCmd struct {
	Requester string         `short:"r" long:"requester" help:"Requester name" required:""`
	ID        string         `required:""`
	CertType  model.CertType `enum:"business_unit,third_party_ca" required:""`
	Reason    string         `required:"" help:"Reject Reason"`
}

func (*CertRejectCmd) Run

func (*CertRejectCmd) Run(cli *CertServerCli) error

type CertRevokeCmd

type CertRevokeCmd RootCertRevokeCmd

func (*CertRevokeCmd) Run

func (*CertRevokeCmd) Run(cli *CertServerCli) error

type CertServerCli

type CertServerCli struct {
	Server  ServerCmd  `cmd:"" help:"Run cert server."`
	Migrate MigrateCmd `cmd:"" help:"Migrate database."`

	Client struct {
		Server string `short:"s" long:"server" help:"Server address" required:""`

		RootCert struct {
			Add    RootCertAddCmd    `cmd:""`
			Revoke RootCertRevokeCmd `cmd:""`
			List   RootCertListCmd   `cmd:""`
			Get    RootCertGetCmd    `cmd:""`
		} `cmd:""`

		CACert struct {
			Add     CACertAddCmd     `cmd:""`
			Respond CACertRespondCmd `cmd:""`
			List    CACertListCmd    `cmd:""`
			Get     CACertGetCmd     `cmd:""`
			Revoke  CACertRevokeCmd  `cmd:""`
		} `cmd:""`

		Cert struct {
			Add    CertAddCmd    `cmd:""`
			Issue  CertIssueCmd  `cmd:""`
			Reject CertRejectCmd `cmd:""`
			List   CertListCmd   `cmd:""`
			Get    CertGetCmd    `cmd:""`
			Revoke CertRevokeCmd `cmd:""`
		} `cmd:""`
	} `cmd:""`
}

type Config

type Config struct {
	Database       util.PostgresDatabaseConfig `yaml:"database"`
	PrivateAddress string                      `yaml:"private_address"`
	PublicAddress  string                      `yaml:"public_address"`
}

type MigrateCmd

type MigrateCmd struct {
	Config     string `short:"c" long:"config" type:"existingfile" help:"Path to the configuration file"`
	Migrations string `short:"p" long:"path" type:"existingdir" help:"Path to the migration files" default:"migrations"`
}

func (*MigrateCmd) Run

func (cmd *MigrateCmd) Run(cli *CertServerCli) error

type PrivateKeyOption

type PrivateKeyOption struct {
	KeyType   eblpkix.PrivateKeyType `enum:"RSA,ECDSA" short:"t" long:"type" help:"Key type" default:"RSA"`
	BitLength int                    `short:"b" long:"bit-length" help:"Key bit length" default:"2048"`
	CurveType eblpkix.ECDSACurveType `enum:"P-256,P-384,P-521" long:"curve" help:"Key curve type" default:"P-256"`
}

type RestClient

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

func NewRestClient

func NewRestClient(server, requester string) *RestClient

func (*RestClient) AddCACert

func (r *RestClient) AddCACert(cmd *CACertAddCmd) (model.Cert, error)

func (*RestClient) AddCert

func (r *RestClient) AddCert(cmd *CertAddCmd) (model.Cert, error)

func (*RestClient) AddRootCert

func (r *RestClient) AddRootCert(cert string) (model.Cert, error)

func (*RestClient) GetCACert

func (r *RestClient) GetCACert(certID string) (model.Cert, error)

func (*RestClient) GetCert

func (r *RestClient) GetCert(certID string) (model.Cert, error)

func (*RestClient) GetRootCert

func (r *RestClient) GetRootCert(certID string) (model.Cert, error)

func (*RestClient) IssueCert

func (r *RestClient) IssueCert(cmd *CertIssueCmd) (model.Cert, error)

func (*RestClient) ListCACert

func (r *RestClient) ListCACert(offset, limit int) (storage.ListCertificatesResponse, error)

func (*RestClient) ListCert

func (r *RestClient) ListCert(offset, limit int) (storage.ListCertificatesResponse, error)

func (*RestClient) ListRootCert

func (r *RestClient) ListRootCert(offset, limit int) (storage.ListCertificatesResponse, error)

func (*RestClient) RejectCert

func (r *RestClient) RejectCert(certID string, certType model.CertType, reason string) (model.Cert, error)

func (*RestClient) RespondCACert

func (r *RestClient) RespondCACert(certID string, cert string) (model.Cert, error)

func (*RestClient) RevokeCACert

func (r *RestClient) RevokeCACert(certID string, crl string) (model.Cert, error)

func (*RestClient) RevokeCert

func (r *RestClient) RevokeCert(certID string) (model.Cert, error)

func (*RestClient) RevokeRootCert

func (r *RestClient) RevokeRootCert(certID string) (model.Cert, error)

type RootCertAddCmd

type RootCertAddCmd struct {
	Requester string `short:"r" long:"requester" help:"Requester name" required:""`
	Cert      []byte `type:"filecontent" help:"Root certificate content" required:""`
}

func (*RootCertAddCmd) Run

func (*RootCertAddCmd) Run(cli *CertServerCli) error

type RootCertGetCmd

type RootCertGetCmd struct {
	ID string `required:""`
}

func (*RootCertGetCmd) Run

func (*RootCertGetCmd) Run(cli *CertServerCli) error

type RootCertListCmd

type RootCertListCmd struct {
	Offset int `long:"offset" help:"Offset" default:"0"`
	Limit  int `long:"limit" help:"Limit" default:"50"`
}

func (*RootCertListCmd) Run

func (*RootCertListCmd) Run(cli *CertServerCli) error

type RootCertRevokeCmd

type RootCertRevokeCmd struct {
	Requester string `short:"r" long:"requester" help:"Requester name" required:""`
	ID        string `required:""`
}

func (*RootCertRevokeCmd) Run

type ServerCmd

type ServerCmd struct {
	Config string `short:"c" long:"config" type:"existingfile" help:"Path to the configuration file"`
}

func (*ServerCmd) Run

func (cmd *ServerCmd) Run(cli *CertServerCli) error

Jump to

Keyboard shortcuts

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