Documentation
¶
Index ¶
- Constants
- type Cert
- func (c Cert) CertMeta() schema.CertMeta
- func (c *Cert) IsCA() bool
- func (c Cert) MarshalJSON() ([]byte, error)
- func (c *Cert) PrivateKey() any
- func (c *Cert) PublicKey() any
- func (c Cert) String() string
- func (c Cert) SubjectMeta() schema.NameMeta
- func (c *Cert) Write(w io.Writer) error
- func (c *Cert) WritePrivateKey(w io.Writer) error
- type CertManager
- func (certmanager *CertManager) CreateCert(ctx context.Context, name string, opt ...Opt) (*schema.Cert, error)
- func (certmanager *CertManager) CreateName(ctx context.Context, meta schema.NameMeta) (*schema.Name, error)
- func (certmanager *CertManager) DeleteCert(ctx context.Context, name string) (*schema.Cert, error)
- func (certmanager *CertManager) DeleteName(ctx context.Context, id uint64) (*schema.Name, error)
- func (certmanager *CertManager) GetCert(ctx context.Context, name string) (*schema.Cert, error)
- func (certmanager *CertManager) GetName(ctx context.Context, id uint64) (*schema.Name, error)
- func (certmanager *CertManager) ListNames(ctx context.Context, req schema.NameListRequest) (*schema.NameList, error)
- func (certmanager *CertManager) RegisterCert(ctx context.Context, name string, meta schema.CertMeta) (*schema.Cert, error)
- func (certmanager *CertManager) Root() *Cert
- func (certmanager *CertManager) UpdateCert(ctx context.Context, name string, meta schema.CertMeta) (*schema.Cert, error)
- func (certmanager *CertManager) UpdateName(ctx context.Context, id uint64, meta schema.NameMeta) (*schema.Name, error)
- type Opt
- func WithAddr(addr ...string) Opt
- func WithAddress(address, postcode string) Opt
- func WithCA() Opt
- func WithCommonName(name string) Opt
- func WithCountry(country, state, city string) Opt
- func WithDefaultKeyType() Opt
- func WithEllipticKey(t string) Opt
- func WithExpiry(expires time.Duration) Opt
- func WithKeyType(t string) Opt
- func WithOrganization(org, unit string) Opt
- func WithRSAKey(bits int) Opt
- func WithRandomSerial() Opt
- func WithSerial(serial *big.Int) Opt
- func WithSigner(signer *Cert) Opt
Constants ¶
View Source
const ( PemTypePrivateKey = "PRIVATE KEY" PemTypeCertificate = "CERTIFICATE" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cert ¶
type Cert struct { Name string `json:"name"` // Common Name Subject *uint64 `json:"subject,omitempty"` // Subject Signer *Cert `json:"signer,omitempty"` // Signer // contains filtered or unexported fields }
Certificate
func (Cert) MarshalJSON ¶
type CertManager ¶
type CertManager struct {
// contains filtered or unexported fields
}
func NewCertManager ¶
Create a new certificate manager, with a root certificate authority
func (*CertManager) CreateCert ¶ added in v1.5.6
func (certmanager *CertManager) CreateCert(ctx context.Context, name string, opt ...Opt) (*schema.Cert, error)
Create a certificate with the given name, and a signer. The certificate is created in the database
func (*CertManager) CreateName ¶ added in v1.5.6
func (*CertManager) DeleteCert ¶ added in v1.5.6
func (*CertManager) DeleteName ¶
func (*CertManager) ListNames ¶
func (certmanager *CertManager) ListNames(ctx context.Context, req schema.NameListRequest) (*schema.NameList, error)
func (*CertManager) RegisterCert ¶
func (*CertManager) UpdateCert ¶ added in v1.5.6
type Opt ¶
Opt is a function which applies options
func WithDefaultKeyType ¶ added in v1.5.6
func WithDefaultKeyType() Opt
Create with a default key type
func WithEllipticKey ¶
Create an ECDSA key with one of the following curves: P224, P256, P384, P521
Click to show internal directories.
Click to hide internal directories.