mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-27 01:23:00 +08:00
18 lines
361 B
Go
18 lines
361 B
Go
package logic
|
|
|
|
import (
|
|
"crypto/rsa"
|
|
"encoding/json"
|
|
)
|
|
|
|
// RetrieveTrafficKey - retrieves public key based on node
|
|
func RetrieveTrafficKey() (rsa.PrivateKey, error) {
|
|
var telRecord, err = fetchTelemetryRecord()
|
|
if err != nil {
|
|
return rsa.PrivateKey{}, err
|
|
}
|
|
var key rsa.PrivateKey
|
|
json.Unmarshal([]byte(telRecord.TrafficKey), &key)
|
|
|
|
return key, nil
|
|
}
|