Documentation
¶
Index ¶
- type AlreadyRevokedError
- type BaseClient
- type CAImport
- type Cert
- type CertContent
- type Certificate
- type Certs
- type ClientConfig
- type KeyInfo
- type LamassuCaClient
- type LamassuCaClientConfig
- func (c *LamassuCaClientConfig) GetCAs(ctx context.Context, caType string) (Certs, error)
- func (c *LamassuCaClientConfig) GetCert(ctx context.Context, IssuerName string, SerialNumber string, caType string) (Cert, error)
- func (c *LamassuCaClientConfig) RevokeCert(ctx context.Context, IssuerName string, serialNumberToRevoke string, ...) error
- func (c *LamassuCaClientConfig) SignCertificateRequest(ctx context.Context, signingCaName string, csr *x509.CertificateRequest, ...) (*x509.Certificate, error)
- type Subject
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlreadyRevokedError ¶ added in v1.0.19
func (*AlreadyRevokedError) Error ¶ added in v1.0.19
func (e *AlreadyRevokedError) Error() string
type BaseClient ¶
type BaseClient interface {
NewRequest(method string, path string, body interface{}) (*http.Request, error)
Do(req *http.Request) (interface{}, *http.Response, error)
}
func NewBaseClient ¶
func NewBaseClient(url *url.URL, httpClient *http.Client) BaseClient
type Cert ¶
type Cert struct {
// The status of the CA
// required: true
// example: issued | expired
Status string `json:"status,omitempty"`
// The serial number of the CA
// required: true
// example: 7e:36:13:a5:31:9f:4a:76:10:64:2e:9b:0a:11:07:b7:e6:3e:cf:94
SerialNumber string `json:"serial_number,omitempty"`
// The name/alias of the CA
// required: true
// example: Lamassu-CA
CAName string `json:"name,omitempty"`
KeyMetadata KeyInfo `json:"key_metadata"`
Subject Subject `json:"subject"`
CertContent CertContent `json:"certificate"`
// Expiration period of the new emmited CA
// required: true
// example: 262800h
CaTTL int `json:"ca_ttl,omitempty"`
EnrollerTTL int `json:"enroller_ttl,omitempty"`
ValidFrom string `json:"valid_from"`
ValidTo string `json:"valid_to"`
RevocationTimestamp int64 `json:"revocation_timestamp,omitempty"`
}
type CertContent ¶
type Certificate ¶
type Certificate struct {
Cert string `json:"crt"`
}
type Certs ¶
type Certs struct {
Certs []Cert `json:"certs"`
}
CAs represents a list of CAs with minimum information swagger:model
type KeyInfo ¶
type KeyInfo struct {
// Algorithm used to create CA key
// required: true
// example: RSA
KeyType string `json:"type"`
// Length used to create CA key
// required: true
// example: 4096
KeyBits int `json:"bits"`
// Strength of the key used to the create CA
// required: true
// example: low
KeyStrength string `json:"strength"`
}
type LamassuCaClient ¶
type LamassuCaClient interface {
GetCAs(ctx context.Context, caType string) (Certs, error)
SignCertificateRequest(ctx context.Context, signingCaName string, csr *x509.CertificateRequest, caType string, signVerbatim bool) (*x509.Certificate, error)
RevokeCert(ctx context.Context, IssuerName string, serialNumberToRevoke string, caType string) error
GetCert(ctx context.Context, IssuerName string, SerialNumber string, caType string) (Cert, error)
}
func NewLamassuCaClient ¶
type LamassuCaClientConfig ¶
type LamassuCaClientConfig struct {
// contains filtered or unexported fields
}
func (*LamassuCaClientConfig) RevokeCert ¶
func (*LamassuCaClientConfig) SignCertificateRequest ¶
func (c *LamassuCaClientConfig) SignCertificateRequest(ctx context.Context, signingCaName string, csr *x509.CertificateRequest, caType string, signVerbatim bool) (*x509.Certificate, error)
type Subject ¶
type Subject struct {
// Common name of the CA certificate
// required: true
// example: Lamassu-Root-CA1-RSA4096
CN string `json:"common_name"`
// Organization of the CA certificate
// required: true
// example: Lamassu IoT
O string `json:"organization"`
// Organization Unit of the CA certificate
// required: true
// example: Lamassu IoT department 1
OU string `json:"organization_unit"`
// Country Name of the CA certificate
// required: true
// example: ES
C string `json:"country"`
// State of the CA certificate
// required: true
// example: Guipuzcoa
ST string `json:"state"`
// Locality of the CA certificate
// required: true
// example: Arrasate
L string `json:"locality"`
}
Click to show internal directories.
Click to hide internal directories.