Newer
Older
package config
import "github.com/google/uuid"
const (
DefaultGRPCTimeoutInSeconds = 10
)
Id string `yaml:"Id"`
Name string `yaml:"Name"`
InterComAddr string `yaml:"InterComAddr"`
QuantumAddr string `yaml:"QuantumAddr"`
AkmsURL string `yaml:"AkmsURL"`
AkmsCkmsServerPort string `yaml:"AkmsCkmsServerPort"`
GnmiBindAddress string `yaml:"GnmiBindAddress"`
KmsTLS TLSConfig `yaml:"KmsTLS"`
Peers []Peer `yaml:"Peers"`
GnmiTLS TLSConfig `yaml:"GnmiTLS"`
AkmsCkmsTLS TLSConfig `yaml:"AkmsCkmsTLS"`
ETSI14Server *ETSI14Server `yaml:"ETSI14Server,omitempty"`
QkdnManagerServer *QkdnManagerServer `yaml:"QkdnManagerServer,omitempty"`
GRPCTimeoutInSeconds int `yaml:"GRPCTimeoutInSeconds"`
}
type Peer struct {
PeerId string `yaml:"PeerId"`
PeerInterComAddr string `yaml:"PeerInterComAddr"`
Type string `yaml:"Type"`
QuantumModule QuantumModule `yaml:"QuantumModule"`
}
type TLSConfig struct {
Active bool `yaml:"Active"`
InsecureSkipVerify bool `yaml:"InsecureSkipVerify"`
CAFile string `yaml:"CAFile"`
CertFile string `yaml:"CertFile"`
KeyFile string `yaml:"KeyFile"`
QmType string `yaml:"Type"`
TLS TLSConfig `yaml:"TLS"`
Address string `yaml:"Address"`
Hostname string `yaml:"Hostname"`
LocalSAEID string `yaml:"LocalSAEID"`
TargetSAEID string `yaml:"TargetSAEID"`
MasterMode bool `yaml:"MasterMode"`
KeyFetchInterval int `yaml:"KeyFetchInterval"`
KeyFetchAmount int `yaml:"KeyFetchAmount"`
MaxKeyFillLevel int `yaml:"MaxKeyFillLevel"`
type ETSI14Server struct {
Address string `yaml:"Address"`
RemoteCKMSID string `yaml:"RemoteCKMSID"`
}
type QkdnManagerServer struct {
Address string `yaml:"Address"`
}
func NewKMSInfo(id uuid.UUID, version *kmsVersionInformation, channel chan string) *KMSInfo {
return &KMSInfo{
id: id,
version: version,
KmsPeerUpdateChannel: channel,
}
}
// Information used to fill the ETSI GS QKD 15 yang model
id uuid.UUID
KmsPeerUpdateChannel chan string // used to get updates from KmsPeer part
}
func NewKMSVersionInformation(firmware string, swVersion string, hwVersion string) *kmsVersionInformation {
return &kmsVersionInformation{
firmware: firmware,
swVersion: swVersion,
hwVersion: hwVersion,
}
}
firmware string
swVersion string
hwVersion string
}
func (kvi *kmsVersionInformation) Firmware() string {
return kvi.firmware
func (kvi *kmsVersionInformation) SoftwareVersion() string {
return kvi.swVersion
func (kvi *kmsVersionInformation) HardwareVersion() string {
return kvi.hwVersion
func (qkdnInfo *KMSInfo) Version() *kmsVersionInformation {
func (qkdnInfo *KMSInfo) ID() uuid.UUID {