netmaker/logic/traffic.go

22 lines
488 B
Go
Raw Normal View History

2022-01-29 04:33:30 +08:00
package logic
2022-01-29 22:37:53 +08:00
// RetrievePrivateTrafficKey - retrieves private key of server
2022-01-30 04:02:37 +08:00
func RetrievePrivateTrafficKey() ([]byte, error) {
2024-01-19 17:21:51 +08:00
var telRecord, err = FetchTelemetryRecord()
2022-01-29 04:33:30 +08:00
if err != nil {
2022-01-30 04:02:37 +08:00
return nil, err
2022-01-29 04:33:30 +08:00
}
2022-01-29 06:49:31 +08:00
2022-01-29 22:37:53 +08:00
return telRecord.TrafficKeyPriv, nil
}
// RetrievePublicTrafficKey - retrieves public key of server
2022-01-30 04:02:37 +08:00
func RetrievePublicTrafficKey() ([]byte, error) {
2024-01-19 17:21:51 +08:00
var telRecord, err = FetchTelemetryRecord()
2022-01-29 22:37:53 +08:00
if err != nil {
2022-01-30 04:02:37 +08:00
return nil, err
2022-01-29 22:37:53 +08:00
}
2022-01-30 04:02:37 +08:00
return telRecord.TrafficKeyPub, nil
2022-01-29 04:33:30 +08:00
}