camock

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCAChain

func WithCAChain(caCert string) func(*CA) error

Types

type CA

type CA struct {
	PK      interface{}
	Cert    *x509.Certificate
	CAChain string

	Enrolled map[string][]*x509.Certificate
	// contains filtered or unexported fields
}

func MustNew

func MustNew(privateKey, cert []byte, opts ...Opt) *CA

func New

func New(privateKey, cert []byte, opts ...Opt) (*CA, error)

func (*CA) AffiliationCreate

func (c *CA) AffiliationCreate(ctx context.Context, name string, opts ...caapi.AffiliationOpt) error

func (*CA) AffiliationDelete

func (c *CA) AffiliationDelete(ctx context.Context, name string, opts ...caapi.AffiliationOpt) ([]caapi.Identity, []caapi.Affiliation, error)

func (*CA) AffiliationList

func (c *CA) AffiliationList(ctx context.Context, rootAffiliation ...string) ([]caapi.Identity, []caapi.Affiliation, error)

func (*CA) CAInfo

func (c *CA) CAInfo(ctx context.Context) (*caapi.ResponseCAInfo, error)

func (*CA) CertificateList

func (c *CA) CertificateList(ctx context.Context, opts ...caapi.CertificateListOpt) ([]*x509.Certificate, error)

func (*CA) Enroll

func (c *CA) Enroll(_ context.Context, name, _ string, req *x509.CertificateRequest, _ ...caapi.EnrollOpt) (*x509.Certificate, interface{}, error)

func (*CA) IdentityGet

func (c *CA) IdentityGet(ctx context.Context, enrollId string) (*caapi.Identity, error)

func (*CA) IdentityList

func (c *CA) IdentityList(ctx context.Context) ([]caapi.Identity, error)

func (*CA) Register

func (c *CA) Register(ctx context.Context, req caapi.RegistrationRequest) (string, error)

func (*CA) Revoke

type Cert

type Cert struct {
	Cert       *x509.Certificate
	PrivateKey interface{}
}

type Opt

type Opt func(*CA) error

Jump to

Keyboard shortcuts

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