Versions in this module Expand all Collapse all v0 v0.14.0 Jan 29, 2024 Changes in this version + var ErrFailedCertCreation = errors.New("failed to create client certificate") + var ErrFailedCertRevocation = errors.New("failed to revoke certificate") + var ErrFailedReadFromPKI = errors.New("failed to read certificate from PKI") + var ErrFailedToRemoveCertFromDB = errors.New("failed to remove cert serial from db") + var ErrMissingCerts = errors.New("CA path or CA key path not set") + func LoadCertificates(caPath, caKeyPath string) (tls.Certificate, *x509.Certificate, error) + func ReadCert(b []byte) (*x509.Certificate, error) + type Cert struct + CAChain []string + ClientCert string + ClientKey string + Expire time.Time + IssuingCA string + OwnerID string + PrivateKeyType string + Serial string + ThingID string + type Page struct + Certs []Cert + Limit uint64 + Offset uint64 + Total uint64 + type Repository interface + Remove func(ctx context.Context, ownerID, thingID string) error + RetrieveAll func(ctx context.Context, ownerID string, offset, limit uint64) (Page, error) + RetrieveBySerial func(ctx context.Context, ownerID, serialID string) (Cert, error) + RetrieveByThing func(ctx context.Context, ownerID, thingID string, offset, limit uint64) (Page, error) + Save func(ctx context.Context, cert Cert) (string, error) + type Revoke struct + RevocationTime time.Time + type Service interface + IssueCert func(ctx context.Context, token, thingID, ttl string) (Cert, error) + ListCerts func(ctx context.Context, token, thingID string, offset, limit uint64) (Page, error) + ListSerials func(ctx context.Context, token, thingID string, offset, limit uint64) (Page, error) + RevokeCert func(ctx context.Context, token, serialID string) (Revoke, error) + ViewCert func(ctx context.Context, token, serialID string) (Cert, error) + func New(auth magistrala.AuthServiceClient, certs Repository, sdk mgsdk.SDK, ...) Service