services

package
v2.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2024 License: MPL-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCASigner

func NewCASigner(ca *models.CACertificate, caSDK CAService) crypto.Signer

Types

type AlertsService

type AlertsService interface {
	HandleEvent(ctx context.Context, input *HandleEventInput) error
	GetUserSubscriptions(ctx context.Context, input *GetUserSubscriptionsInput) ([]*models.Subscription, error)
	Subscribe(ctx context.Context, input *SubscribeInput) ([]*models.Subscription, error)
	Unsubscribe(ctx context.Context, input *UnsubscribeInput) ([]*models.Subscription, error)

	GetLatestEventsPerEventType(ctx context.Context, input *GetLatestEventsPerEventTypeInput) ([]*models.AlertLatestEvent, error)
}

func NewAlertsService

func NewAlertsService(builder AlertsServiceBuilder) AlertsService

type AlertsServiceBackend

type AlertsServiceBackend struct {
	// contains filtered or unexported fields
}

func (*AlertsServiceBackend) GetLatestEventsPerEventType

func (svc *AlertsServiceBackend) GetLatestEventsPerEventType(ctx context.Context, input *GetLatestEventsPerEventTypeInput) ([]*models.AlertLatestEvent, error)

func (*AlertsServiceBackend) GetUserSubscriptions

func (svc *AlertsServiceBackend) GetUserSubscriptions(ctx context.Context, input *GetUserSubscriptionsInput) ([]*models.Subscription, error)

func (*AlertsServiceBackend) HandleEvent

func (svc *AlertsServiceBackend) HandleEvent(ctx context.Context, input *HandleEventInput) error

func (*AlertsServiceBackend) Subscribe

func (svc *AlertsServiceBackend) Subscribe(ctx context.Context, input *SubscribeInput) ([]*models.Subscription, error)

func (*AlertsServiceBackend) Unsubscribe

func (svc *AlertsServiceBackend) Unsubscribe(ctx context.Context, input *UnsubscribeInput) ([]*models.Subscription, error)

type AlertsServiceBuilder

type AlertsServiceBuilder struct {
	SubsStorage      storage.SubscriptionsRepository
	EventStorage     storage.EventRepository
	SmtpServerConfig config.SMTPServer
	Logger           *logrus.Entry
}

type BindIdentityToDeviceInput

type BindIdentityToDeviceInput struct {
	DeviceID                string
	CertificateSerialNumber string
	BindMode                models.DeviceEventType
}

type CAMiddleware

type CAMiddleware func(CAService) CAService

type CAService

type CAService interface {
	GetStats(ctx context.Context) (*models.CAStats, error)
	GetStatsByCAID(ctx context.Context, input GetStatsByCAIDInput) (map[models.CertificateStatus]int, error)

	GetCryptoEngineProvider(ctx context.Context) ([]*models.CryptoEngineProvider, error)

	CreateCA(ctx context.Context, input CreateCAInput) (*models.CACertificate, error)
	ImportCA(ctx context.Context, input ImportCAInput) (*models.CACertificate, error)
	GetCAByID(ctx context.Context, input GetCAByIDInput) (*models.CACertificate, error)
	GetCAs(ctx context.Context, input GetCAsInput) (string, error)
	GetCAsByCommonName(ctx context.Context, input GetCAsByCommonNameInput) (string, error)
	UpdateCAStatus(ctx context.Context, input UpdateCAStatusInput) (*models.CACertificate, error)
	UpdateCAMetadata(ctx context.Context, input UpdateCAMetadataInput) (*models.CACertificate, error)
	DeleteCA(ctx context.Context, input DeleteCAInput) error

	SignatureSign(ctx context.Context, input SignatureSignInput) ([]byte, error)
	SignatureVerify(ctx context.Context, input SignatureVerifyInput) (bool, error)

	SignCertificate(ctx context.Context, input SignCertificateInput) (*models.Certificate, error)
	CreateCertificate(ctx context.Context, input CreateCertificateInput) (*models.Certificate, error)
	ImportCertificate(ctx context.Context, input ImportCertificateInput) (*models.Certificate, error)

	GetCertificateBySerialNumber(ctx context.Context, input GetCertificatesBySerialNumberInput) (*models.Certificate, error)
	GetCertificates(ctx context.Context, input GetCertificatesInput) (string, error)
	GetCertificatesByCA(ctx context.Context, input GetCertificatesByCAInput) (string, error)
	GetCertificatesByExpirationDate(ctx context.Context, input GetCertificatesByExpirationDateInput) (string, error)
	GetCertificatesByCaAndStatus(ctx context.Context, input GetCertificatesByCaAndStatusInput) (string, error)
	// GetCertificatesByExpirationDateAndCA(input GetCertificatesByExpirationDateInput) (string, error)
	GetCertificatesByStatus(ctx context.Context, input GetCertificatesByStatusInput) (string, error)
	// GetCertificatesByStatusAndCA(input GetCertificatesByExpirationDateInput) (string, error)
	UpdateCertificateStatus(ctx context.Context, input UpdateCertificateStatusInput) (*models.Certificate, error)
	UpdateCertificateMetadata(ctx context.Context, input UpdateCertificateMetadataInput) (*models.Certificate, error)
}

func NewCAService

func NewCAService(builder CAServiceBuilder) (CAService, error)

type CAServiceBuilder

type CAServiceBuilder struct {
	Logger               *logrus.Entry
	CryptoEngines        map[string]*Engine
	CAStorage            storage.CACertificatesRepo
	CertificateStorage   storage.CertificatesRepo
	CryptoMonitoringConf config.CryptoMonitoring
	VAServerDomain       string
}

type CAServiceImpl

type CAServiceImpl struct {
	// contains filtered or unexported fields
}

func (*CAServiceImpl) Close added in v2.4.5

func (svc *CAServiceImpl) Close()

func (*CAServiceImpl) CreateCA

func (svc *CAServiceImpl) CreateCA(ctx context.Context, input CreateCAInput) (*models.CACertificate, error)

Returned Error Codes:

  • ErrCAIncompatibleExpirationTimeRef The Expiration time ref is incompatible with the selected variable, i.e. if the time ref is Duration the variable must be of type Duration not of type Time.
  • ErrCAIssuanceExpiration When creating a CA, the Issuance Expiration is greater than the CA Expiration.
  • ErrCAType When creating the CA, the CA Type must have the value of MANAGED.
  • ErrValidateBadRequest The required variables of the data structure are not valid.

func (*CAServiceImpl) CreateCertificate

func (svc *CAServiceImpl) CreateCertificate(ctx context.Context, input CreateCertificateInput) (*models.Certificate, error)

func (*CAServiceImpl) DeleteCA

func (svc *CAServiceImpl) DeleteCA(ctx context.Context, input DeleteCAInput) error

Returned Error Codes:

  • ErrCANotFound The specified CA can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.
  • ErrCAStatus Cannot delete a CA that is not expired or revoked.

func (*CAServiceImpl) GetCAByID

func (svc *CAServiceImpl) GetCAByID(ctx context.Context, input GetCAByIDInput) (*models.CACertificate, error)

Returned Error Codes:

  • ErrCANotFound The specified CA can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.

func (*CAServiceImpl) GetCABySerialNumber

func (svc *CAServiceImpl) GetCABySerialNumber(ctx context.Context, input GetCABySerialNumberInput) (*models.CACertificate, error)

func (*CAServiceImpl) GetCAs

func (svc *CAServiceImpl) GetCAs(ctx context.Context, input GetCAsInput) (string, error)

func (*CAServiceImpl) GetCAsByCommonName

func (svc *CAServiceImpl) GetCAsByCommonName(ctx context.Context, input GetCAsByCommonNameInput) (string, error)

func (*CAServiceImpl) GetCertificateBySerialNumber

func (svc *CAServiceImpl) GetCertificateBySerialNumber(ctx context.Context, input GetCertificatesBySerialNumberInput) (*models.Certificate, error)

Returned Error Codes:

  • ErrCertificateNotFound The specified Certificate can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.

func (*CAServiceImpl) GetCertificates

func (svc *CAServiceImpl) GetCertificates(ctx context.Context, input GetCertificatesInput) (string, error)

func (*CAServiceImpl) GetCertificatesByCA

func (svc *CAServiceImpl) GetCertificatesByCA(ctx context.Context, input GetCertificatesByCAInput) (string, error)

Returned Error Codes:

  • ErrCANotFound The specified CA can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.

func (*CAServiceImpl) GetCertificatesByCaAndStatus

func (svc *CAServiceImpl) GetCertificatesByCaAndStatus(ctx context.Context, input GetCertificatesByCaAndStatusInput) (string, error)

func (*CAServiceImpl) GetCertificatesByExpirationDate

func (svc *CAServiceImpl) GetCertificatesByExpirationDate(ctx context.Context, input GetCertificatesByExpirationDateInput) (string, error)

func (*CAServiceImpl) GetCertificatesByStatus

func (svc *CAServiceImpl) GetCertificatesByStatus(ctx context.Context, input GetCertificatesByStatusInput) (string, error)

func (*CAServiceImpl) GetCryptoEngineProvider

func (svc *CAServiceImpl) GetCryptoEngineProvider(ctx context.Context) ([]*models.CryptoEngineProvider, error)

func (*CAServiceImpl) GetStats

func (svc *CAServiceImpl) GetStats(ctx context.Context) (*models.CAStats, error)

func (*CAServiceImpl) GetStatsByCAID

func (svc *CAServiceImpl) GetStatsByCAID(ctx context.Context, input GetStatsByCAIDInput) (map[models.CertificateStatus]int, error)

func (*CAServiceImpl) ImportCA

func (svc *CAServiceImpl) ImportCA(ctx context.Context, input ImportCAInput) (*models.CACertificate, error)

Returned Error Codes:

  • ErrCAIncompatibleExpirationTimeRef The Expiration time ref is incompatible with the selected variable, i.e. if the time ref is Duration the variable must be of type Duration not of type Time.
  • ErrCAIssuanceExpiration When creating a CA, the Issuance Expiration is greater than the CA Expiration.
  • ErrCAType The CA Type cannot have the value of MANAGED.
  • ErrCAValidCertAndPrivKey The CA certificate and the private key provided are not compatible.
  • ErrValidateBadRequest The required variables of the data structure are not valid.

func (*CAServiceImpl) ImportCertificate

func (svc *CAServiceImpl) ImportCertificate(ctx context.Context, input ImportCertificateInput) (*models.Certificate, error)

func (*CAServiceImpl) SetService

func (svc *CAServiceImpl) SetService(service CAService)

func (*CAServiceImpl) SignCertificate

func (svc *CAServiceImpl) SignCertificate(ctx context.Context, input SignCertificateInput) (*models.Certificate, error)

Returned Error Codes:

  • ErrCANotFound The specified CA can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.
  • ErrCAStatus CA is not active

func (*CAServiceImpl) SignatureSign

func (svc *CAServiceImpl) SignatureSign(ctx context.Context, input SignatureSignInput) ([]byte, error)

func (*CAServiceImpl) SignatureVerify

func (svc *CAServiceImpl) SignatureVerify(ctx context.Context, input SignatureVerifyInput) (bool, error)

func (*CAServiceImpl) UpdateCAMetadata

func (svc *CAServiceImpl) UpdateCAMetadata(ctx context.Context, input UpdateCAMetadataInput) (*models.CACertificate, error)

Returned Error Codes:

  • ErrCANotFound The specified CA can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.

func (*CAServiceImpl) UpdateCAStatus

func (svc *CAServiceImpl) UpdateCAStatus(ctx context.Context, input UpdateCAStatusInput) (*models.CACertificate, error)

Returned Error Codes:

  • ErrCANotFound The specified CA can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.
  • ErrCAAlreadyRevoked CA already revoked

func (*CAServiceImpl) UpdateCertificateMetadata

func (svc *CAServiceImpl) UpdateCertificateMetadata(ctx context.Context, input UpdateCertificateMetadataInput) (*models.Certificate, error)

Returned Error Codes:

  • ErrCertificateNotFound The specified Certificate can not be found in the Database
  • ErrValidateBadRequest The required variables of the data structure are not valid.

func (*CAServiceImpl) UpdateCertificateStatus

func (svc *CAServiceImpl) UpdateCertificateStatus(ctx context.Context, input UpdateCertificateStatusInput) (*models.Certificate, error)

Returned Error Codes:

  • ErrCertificateNotFound The specified Certificate can not be found in the Database
  • ErrCertificateStatusTransitionNotAllowed The specified status is not valid for this certficate due to its initial status
  • ErrValidateBadRequest The required variables of the data structure are not valid.

type CRLService

type CRLService interface {
	GetCRL(ctx context.Context, input GetCRLInput) ([]byte, error)
}

func NewCRLService

func NewCRLService(builder CRLServiceBuilder) CRLService

type CRLServiceBuilder

type CRLServiceBuilder struct {
	Logger   *logrus.Entry
	CAClient CAService
}

type CreateCAInput

type CreateCAInput struct {
	ID                 string
	ParentID           string
	KeyMetadata        models.KeyMetadata `validate:"required"`
	Subject            models.Subject     `validate:"required"`
	IssuanceExpiration models.Expiration  `validate:"required"`
	CAExpiration       models.Expiration  `validate:"required"`
	EngineID           string
	Metadata           map[string]any
}

type CreateCertificateInput

type CreateCertificateInput struct {
	KeyMetadata models.KeyMetadata `validate:"required"`
	Subject     models.Subject     `validate:"required"`
}

type CreateDMSInput

type CreateDMSInput struct {
	ID       string `validate:"required"`
	Name     string `validate:"required"`
	Metadata map[string]any
	Settings models.DMSSettings `validate:"required"`
}

type CreateDeviceInput

type CreateDeviceInput struct {
	ID        string `validate:"required"`
	Alias     string
	Tags      []string
	Metadata  map[string]any
	DMSID     string `validate:"required"`
	Icon      string `validate:"required"`
	IconColor string `validate:"required"`
}

type DMSManagerBuilder

type DMSManagerBuilder struct {
	Logger                *logrus.Entry
	DevManagerCli         DeviceManagerService
	CAClient              CAService
	DMSStorage            storage.DMSRepo
	DownstreamCertificate *x509.Certificate
}

type DMSManagerMiddleware

type DMSManagerMiddleware func(DMSManagerService) DMSManagerService

type DMSManagerService

type DMSManagerService interface {
	ESTService
	GetDMSStats(ctx context.Context, input GetDMSStatsInput) (*models.DMSStats, error)
	CreateDMS(ctx context.Context, input CreateDMSInput) (*models.DMS, error)
	UpdateDMS(ctx context.Context, input UpdateDMSInput) (*models.DMS, error)
	GetDMSByID(ctx context.Context, input GetDMSByIDInput) (*models.DMS, error)
	GetAll(ctx context.Context, input GetAllInput) (string, error)

	BindIdentityToDevice(ctx context.Context, input BindIdentityToDeviceInput) (*models.BindIdentityToDeviceOutput, error)
}

func NewDMSManagerService

func NewDMSManagerService(builder DMSManagerBuilder) DMSManagerService

type DMSManagerServiceImpl

type DMSManagerServiceImpl struct {
	// contains filtered or unexported fields
}

func (DMSManagerServiceImpl) BindIdentityToDevice

func (DMSManagerServiceImpl) CACerts

func (svc DMSManagerServiceImpl) CACerts(aps string) ([]*x509.Certificate, error)

func (DMSManagerServiceImpl) CreateDMS

func (svc DMSManagerServiceImpl) CreateDMS(ctx context.Context, input CreateDMSInput) (*models.DMS, error)

func (DMSManagerServiceImpl) Enroll

Validation:

  • Cert: Only Bootstrap cert (CA issued By Lamassu)

func (DMSManagerServiceImpl) GetAll

func (svc DMSManagerServiceImpl) GetAll(ctx context.Context, input GetAllInput) (string, error)

func (DMSManagerServiceImpl) GetDMSByID

func (svc DMSManagerServiceImpl) GetDMSByID(ctx context.Context, input GetDMSByIDInput) (*models.DMS, error)

func (DMSManagerServiceImpl) GetDMSStats

func (svc DMSManagerServiceImpl) GetDMSStats(ctx context.Context, input GetDMSStatsInput) (*models.DMSStats, error)

func (DMSManagerServiceImpl) Reenroll

func (DMSManagerServiceImpl) ServerKeyGen

func (svc DMSManagerServiceImpl) ServerKeyGen(ctx context.Context, csr *x509.CertificateRequest, aps string) (*x509.Certificate, interface{}, error)

func (*DMSManagerServiceImpl) SetService

func (svc *DMSManagerServiceImpl) SetService(service DMSManagerService)

func (DMSManagerServiceImpl) UpdateDMS

func (svc DMSManagerServiceImpl) UpdateDMS(ctx context.Context, input UpdateDMSInput) (*models.DMS, error)

type DeleteCAInput

type DeleteCAInput struct {
	CAID string `validate:"required"`
}

type DeviceManagerBuilder

type DeviceManagerBuilder struct {
	Logger         *logrus.Entry
	CAClient       CAService
	DevicesStorage storage.DeviceManagerRepo
}

type DeviceManagerService

type DeviceManagerService interface {
	GetDevicesStats(input GetDevicesStatsInput) (*models.DevicesStats, error)
	CreateDevice(input CreateDeviceInput) (*models.Device, error)
	GetDeviceByID(input GetDeviceByIDInput) (*models.Device, error)
	GetDevices(input GetDevicesInput) (string, error)
	GetDeviceByDMS(input GetDevicesByDMSInput) (string, error)
	UpdateDeviceStatus(input UpdateDeviceStatusInput) (*models.Device, error)
	UpdateDeviceIdentitySlot(input UpdateDeviceIdentitySlotInput) (*models.Device, error)
	UpdateDeviceMetadata(input UpdateDeviceMetadataInput) (*models.Device, error)
}

func NewDeviceManagerService

func NewDeviceManagerService(builder DeviceManagerBuilder) DeviceManagerService

type DeviceManagerServiceImpl

type DeviceManagerServiceImpl struct {
	// contains filtered or unexported fields
}

func (DeviceManagerServiceImpl) CreateDevice

func (svc DeviceManagerServiceImpl) CreateDevice(input CreateDeviceInput) (*models.Device, error)

func (DeviceManagerServiceImpl) GetDeviceByDMS

func (svc DeviceManagerServiceImpl) GetDeviceByDMS(input GetDevicesByDMSInput) (string, error)

func (DeviceManagerServiceImpl) GetDeviceByID

func (svc DeviceManagerServiceImpl) GetDeviceByID(input GetDeviceByIDInput) (*models.Device, error)

func (DeviceManagerServiceImpl) GetDevices

func (svc DeviceManagerServiceImpl) GetDevices(input GetDevicesInput) (string, error)

func (*DeviceManagerServiceImpl) GetDevicesStats

func (svc *DeviceManagerServiceImpl) GetDevicesStats(input GetDevicesStatsInput) (*models.DevicesStats, error)

func (*DeviceManagerServiceImpl) SetService

func (svc *DeviceManagerServiceImpl) SetService(service DeviceManagerService)

func (DeviceManagerServiceImpl) UpdateDeviceIdentitySlot

func (svc DeviceManagerServiceImpl) UpdateDeviceIdentitySlot(input UpdateDeviceIdentitySlotInput) (*models.Device, error)

func (DeviceManagerServiceImpl) UpdateDeviceMetadata

func (svc DeviceManagerServiceImpl) UpdateDeviceMetadata(input UpdateDeviceMetadataInput) (*models.Device, error)

func (DeviceManagerServiceImpl) UpdateDeviceStatus

func (svc DeviceManagerServiceImpl) UpdateDeviceStatus(input UpdateDeviceStatusInput) (*models.Device, error)

type ESTService

type ESTService interface {
	// CACerts requests a copy of the current CA certificates. See RFC7030 4.1.
	CACerts(aps string) ([]*x509.Certificate, error)

	// Enroll requests a new certificate. See RFC7030 4.2.
	Enroll(ctx context.Context, csr *x509.CertificateRequest, aps string) (*x509.Certificate, error)

	// Reenroll requests renewal/rekey of an existing certificate. See RFC7030
	// 4.2.
	Reenroll(ctx context.Context, csr *x509.CertificateRequest, aps string) (*x509.Certificate, error)
	// ServerKeyGen requests a new certificate and a private key. The key must
	// be returned as a DER-encoded PKCS8 PrivateKeyInfo structure if additional
	// encryption is not being employed, or returned inside a CMS SignedData
	// structure which itself is inside a CMS EnvelopedData structure. See
	// RFC7030 4.4.
	ServerKeyGen(ctx context.Context, csr *x509.CertificateRequest, aps string) (*x509.Certificate, interface{}, error)
}

type Engine

type Engine struct {
	Default bool
	Service cryptoengines.CryptoEngine
}

type GetAllInput

type GetAllInput struct {
	resources.ListInput[models.DMS]
}

type GetCAByIDInput

type GetCAByIDInput struct {
	CAID string `validate:"required"`
}

type GetCABySerialNumberInput

type GetCABySerialNumberInput struct {
	SerialNumber string `validate:"required"`
}

type GetCAsByCommonNameInput

type GetCAsByCommonNameInput struct {
	CommonName string

	QueryParameters *resources.QueryParameters
	ExhaustiveRun   bool //wether to iter all elems
	ApplyFunc       func(cert models.CACertificate)
}

type GetCAsInput

type GetCAsInput struct {
	QueryParameters *resources.QueryParameters

	ExhaustiveRun bool //wether to iter all elems
	ApplyFunc     func(ca models.CACertificate)
}

type GetCRLInput

type GetCRLInput struct {
	CAID string `validate:"required"`
}

type GetCertificatesByCAInput

type GetCertificatesByCAInput struct {
	CAID string `validate:"required"`
	resources.ListInput[models.Certificate]
}

type GetCertificatesByCaAndStatusInput

type GetCertificatesByCaAndStatusInput struct {
	CAID   string
	Status models.CertificateStatus
	resources.ListInput[models.Certificate]
}

type GetCertificatesByExpirationDateInput

type GetCertificatesByExpirationDateInput struct {
	ExpiresAfter  time.Time
	ExpiresBefore time.Time
	resources.ListInput[models.Certificate]
}

type GetCertificatesBySerialNumberInput

type GetCertificatesBySerialNumberInput struct {
	SerialNumber string `validate:"required"`
}

type GetCertificatesByStatusInput

type GetCertificatesByStatusInput struct {
	Status models.CertificateStatus
	resources.ListInput[models.Certificate]
}

type GetCertificatesInput

type GetCertificatesInput struct {
	resources.ListInput[models.Certificate]
}

type GetDMSByIDInput

type GetDMSByIDInput struct {
	ID string `validate:"required"`
}

type GetDMSStatsInput

type GetDMSStatsInput struct{}

type GetDeviceByIDInput

type GetDeviceByIDInput struct {
	ID string `validate:"required"`
}

type GetDevicesByDMSInput

type GetDevicesByDMSInput struct {
	DMSID string
	resources.ListInput[models.Device]
}

type GetDevicesInput

type GetDevicesInput struct {
	resources.ListInput[models.Device]
}

type GetDevicesStatsInput

type GetDevicesStatsInput struct {
}

type GetLatestEventsPerEventTypeInput

type GetLatestEventsPerEventTypeInput struct{}

type GetStatsByCAIDInput

type GetStatsByCAIDInput struct {
	CAID string
}

type GetUserSubscriptionsInput

type GetUserSubscriptionsInput struct {
	UserID string
}

type HandleEventInput

type HandleEventInput struct {
	Event cloudevents.Event
}

type ImportCAInput

type ImportCAInput struct {
	ID                 string
	CAType             models.CertificateType    `validate:"required,ne=MANAGED"`
	IssuanceExpiration models.Expiration         `validate:"required"`
	CACertificate      *models.X509Certificate   `validate:"required"`
	CAChain            []*models.X509Certificate //Parent CAs. They MUST be sorted as follows. 0: Root-CA; 1: Subordinate CA from Root-CA; ...
	CARSAKey           *rsa.PrivateKey
	CAECKey            *ecdsa.PrivateKey
	KeyType            models.KeyType
	EngineID           string
	ParentID           string
}

type ImportCertificateInput

type ImportCertificateInput struct {
	ImportMode  models.CertificateType
	Certificate *models.X509Certificate
	Metadata    map[string]any
}

type OCSPService

type OCSPService interface {
	Verify(ctx context.Context, req *ocsp.Request) ([]byte, error)
}

func NewOCSPService

func NewOCSPService(builder OCSPServiceBuilder) OCSPService

type OCSPServiceBuilder

type OCSPServiceBuilder struct {
	Logger   *logrus.Entry
	CAClient CAService
}

type ProvisionDeviceSlotInput

type ProvisionDeviceSlotInput struct {
	ID     string `validate:"required"`
	SlotID string `validate:"required"`
}

type SignCertificateInput

type SignCertificateInput struct {
	CAID         string                         `validate:"required"`
	CertRequest  *models.X509CertificateRequest `validate:"required"`
	Subject      *models.Subject
	SignVerbatim bool
}

type SignInput

type SignInput struct {
	CAID               string
	Message            []byte
	MessageType        models.SignMessageType
	SignatureAlgorithm string
}

type SignatureSignInput

type SignatureSignInput struct {
	CAID             string                 `validate:"required"`
	Message          []byte                 `validate:"required"`
	MessageType      models.SignMessageType `validate:"required"`
	SigningAlgorithm string                 `validate:"required"`
}

type SignatureVerifyInput

type SignatureVerifyInput struct {
	CAID             string                 `validate:"required"`
	Signature        []byte                 `validate:"required"`
	Message          []byte                 `validate:"required"`
	MessageType      models.SignMessageType `validate:"required"`
	SigningAlgorithm string                 `validate:"required"`
}

type SubscribeInput

type SubscribeInput struct {
	UserID     string
	EventType  models.EventType
	Conditions []models.SubscriptionCondition
	Channel    models.Channel
}

type UnsubscribeInput

type UnsubscribeInput struct {
	UserID         string
	SubscriptionID string
}

type UpdateCAMetadataInput

type UpdateCAMetadataInput struct {
	CAID     string                 `validate:"required"`
	Metadata map[string]interface{} `validate:"required"`
}

type UpdateCAStatusInput

type UpdateCAStatusInput struct {
	CAID             string                   `validate:"required"`
	Status           models.CertificateStatus `validate:"required"`
	RevocationReason models.RevocationReason
}

type UpdateCertificateMetadataInput

type UpdateCertificateMetadataInput struct {
	SerialNumber string                 `validate:"required"`
	Metadata     map[string]interface{} `validate:"required"`
}

type UpdateCertificateStatusInput

type UpdateCertificateStatusInput struct {
	SerialNumber     string                   `validate:"required"`
	NewStatus        models.CertificateStatus `validate:"required"`
	RevocationReason models.RevocationReason
}

type UpdateDMSInput

type UpdateDMSInput struct {
	DMS models.DMS `validate:"required"`
}

type UpdateDeviceIdentitySlotInput

type UpdateDeviceIdentitySlotInput struct {
	ID   string              `validate:"required"`
	Slot models.Slot[string] `validate:"required"`
}

type UpdateDeviceMetadataInput

type UpdateDeviceMetadataInput struct {
	ID       string         `validate:"required"`
	Metadata map[string]any `validate:"required"`
}

type UpdateDeviceStatusInput

type UpdateDeviceStatusInput struct {
	ID        string              `validate:"required"`
	NewStatus models.DeviceStatus `validate:"required"`
}

Directories

Path Synopsis
alerts

Jump to

Keyboard shortcuts

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