kms

package
v0.0.0-...-f9f117d Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2023 License: BSD-3-Clause Imports: 21 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKmsPeer

func NewKmsPeer(servQLE *QuantumElement, in chan string) (peer kmsPeer)

func StartETSI

func StartETSI(listenAddr string, callingKMS *EKMS)

func StartInterComm

func StartInterComm(interComPort int)

Types

type EKMS

type EKMS struct {
	QuantumElements map[uint32]*QuantumElement

	KmsPeers map[string]*kmsPeer

	pbETSI.UnimplementedKmsETSIServer
	pbIC.UnimplementedKmsTalkerServer
	// contains filtered or unexported fields
}

The general emulated KMS

func NewEKMS

func NewEKMS(kmsName string, kmsUUID uuid.UUID, logOutput io.Writer, logLevel log.Level, logInJson bool) (newEKMS *EKMS)

func (*EKMS) AddExternalNotifierKMSPeer

func (kms *EKMS) AddExternalNotifierKMSPeer(in chan string)

func (*EKMS) AddExternalNotifierQLE

func (kms *EKMS) AddExternalNotifierQLE(in chan uint32)

func (*EKMS) AddPeer

func (kms *EKMS) AddPeer(kmsPeerSocket string, servingQLE *QuantumElement)

TODO/XXX error handling

func (*EKMS) AddQuantumElement

func (kms *EKMS) AddQuantumElement(kmsUDPAddrr string, logOutput io.Writer, logLevel log.Level, logInJson bool) *QuantumElement

func (*EKMS) FindPeerUuid

func (kms *EKMS) FindPeerUuid(lookup uuid.UUID) (peer *kmsPeer)

func (*EKMS) GenerateNewQleID

func (kms *EKMS) GenerateNewQleID() (uint32, error)

This has a design flaw, as the generated ID is returned to the calling function and used there. However, when being used a potential other caller might received the same qlElementId TODO/XXX: This would be collision and must be eventually avoided

func (*EKMS) GlobalKeyHandler

func (kms *EKMS) GlobalKeyHandler(waitTime time.Duration) error

func (*EKMS) RemovePeer

func (kms *EKMS) RemovePeer(kmsPeerSocket string)

TODO/XXX error handling

type KmsPeerStatus

type KmsPeerStatus int16
const (
	KmsPeerUp      KmsPeerStatus = iota // peer was seen up lately
	KmsPeerDown                         // peer not reachable anymore
	KmsPeerPending                      // peer was added and has to be succesfully contacted once
	KmsPeerUnknown                      // not known, not initialized
)

type Qkdnkms

type Qkdnkms interface {
	//AddExternalNotifierGeneral(chan bool)   // used to indicate unspecific changes
	AddExternalNotifierQLE(chan uint32)     // used to indicate changes to specific Quantum Link Element (QLE)
	AddExternalNotifierKMSPeer(chan string) // used to indicate changes to specific KMSPeer
	AddQuantumElement() *QuantumElement
	GlobalKeyHandler(time.Duration) error
	AddPeer(kmsPeerSocket string, servingQLE *QuantumElement)
	RemovePeer(kmsPeerSocket string)
	FindPeerUuid(uuid.UUID) *kmsPeer
}

type QuantumElement

type QuantumElement struct {
	QlID               uint32
	QuantumElementLink *quantumlayer.QuantumlayerEmuPRNG // contains information about the quantum links
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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