Documentation
¶
Index ¶
- Constants
- type Cert
- func (c *Cert) IsCA() bool
- func (c Cert) MarshalJSON() ([]byte, error)
- func (c Cert) Meta() schema.CertMeta
- 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) DeleteName(ctx context.Context, id uint64) (*schema.Name, error)
- func (certmanager *CertManager) GetName(ctx context.Context, id uint64) (*schema.Name, error)
- func (certmanager *CertManager) ListNames(ctx context.Context) (*schema.NameList, error)
- func (certmanager *CertManager) RegisterCert(ctx context.Context, meta *Cert) (*Cert, error)
- func (certmanager *CertManager) RegisterName(ctx context.Context, meta schema.NameMeta) (*schema.Name, error)
- func (certmanager *CertManager) Root() *Cert
- 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 WithEllipticKey(t string) Opt
- func WithExpiry(expires time.Duration) 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 Ts *time.Time `json:"timestamp,omitempty"` // Timestamp // 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) DeleteName ¶
func (*CertManager) RegisterCert ¶
func (*CertManager) RegisterName ¶
type Opt ¶
Opt is a function which applies options
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.