added encryption/decryption strategy

This commit is contained in:
0xdcarns
2022-01-28 15:33:30 -05:00
parent 749e6f464d
commit 0015d6fdf8
14 changed files with 318 additions and 111 deletions

View File

@@ -1,6 +1,10 @@
package models
import jwt "github.com/golang-jwt/jwt/v4"
import (
"crypto/rsa"
jwt "github.com/golang-jwt/jwt/v4"
)
const PLACEHOLDER_KEY_TEXT = "ACCESS_KEY"
const PLACEHOLDER_TOKEN_TEXT = "ACCESS_TOKEN"
@@ -175,3 +179,9 @@ type ServerAddr struct {
IsLeader bool `json:"isleader" bson:"isleader" yaml:"isleader"`
Address string `json:"address" bson:"address" yaml:"address"`
}
// TrafficKeys - struct to hold public keys
type TrafficKeys struct {
Mine rsa.PublicKey `json:"mine" bson:"mine" yaml:"mine"`
Server rsa.PublicKey `json:"server" bson:"server" yaml:"server"`
}