distribution

package
v0.0.0-...-b180f38 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributionSession

type DistributionSession struct {
	ID          string
	RecipientID string
	ExchangeID  string
	Status      DistributionStatus
	InitiatedAt time.Time
	CompletedAt time.Time
	KeyMetadata map[string]interface{}
	RetryCount  int
	MaxRetries  int
}

type DistributionStatus

type DistributionStatus string
const (
	StatusPending    DistributionStatus = "pending"
	StatusExchanging DistributionStatus = "exchanging"
	StatusCompleted  DistributionStatus = "completed"
	StatusFailed     DistributionStatus = "failed"
)

type KeyDistributionMessage

type KeyDistributionMessage struct {
	KeyID        string
	Version      int
	Timestamp    time.Time
	EncryptedKey []byte
	Signature    []byte
}

type KeyDistributionService

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

func NewKeyDistributionService

func NewKeyDistributionService(
	natsURL string,
	keyStore *keystore.HSMKeyStore,
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
) (*KeyDistributionService, error)

func (*KeyDistributionService) DistributeKey

func (s *KeyDistributionService) DistributeKey(ctx context.Context, keyID string, encryptedKey []byte) error

func (*KeyDistributionService) RegisterSubscriber

func (s *KeyDistributionService) RegisterSubscriber(ctx context.Context, id string, publicKey []byte) error

func (*KeyDistributionService) UnregisterSubscriber

func (s *KeyDistributionService) UnregisterSubscriber(ctx context.Context, id string) error

type KeySubscriber

type KeySubscriber struct {
	ID        string
	PublicKey []byte
	Status    SubscriberStatus
	LastSeen  time.Time
}

type SecureDistributor

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

func NewSecureDistributor

func NewSecureDistributor(
	natsURL string,
	keyExchange *quantum.KeyExchange,
	metrics *metrics.QuantumStorageMetrics,
	tracer tracing.Tracer,
) (*SecureDistributor, error)

func (*SecureDistributor) DistributeKey

func (sd *SecureDistributor) DistributeKey(ctx context.Context, recipientID string, keyData []byte, metadata map[string]interface{}) error

type SubscriberStatus

type SubscriberStatus string
const (
	SubscriberStatusActive   SubscriberStatus = "active"
	SubscriberStatusInactive SubscriberStatus = "inactive"
)

Jump to

Keyboard shortcuts

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