decentralized -> peer discovery
This commit is contained in:
@@ -16,7 +16,7 @@ func verify(pub crypto.PubKey, data, sig []byte) (bool, error) {
|
||||
return pub.Verify(data, sig)
|
||||
}
|
||||
|
||||
func loadKeyFromFile(isPublic bool) (crypto.PrivKey, error) {
|
||||
func LoadKeyFromFile(isPublic bool) (crypto.PrivKey, error) {
|
||||
path := conf.GetConfig().PrivateKeyPath
|
||||
if isPublic {
|
||||
path = conf.GetConfig().PublicKeyPath
|
||||
@@ -35,12 +35,12 @@ func loadKeyFromFile(isPublic bool) (crypto.PrivKey, error) {
|
||||
}
|
||||
|
||||
func VerifyPubWithPriv() bool {
|
||||
priv, err := loadKeyFromFile(false)
|
||||
priv, err := LoadKeyFromFile(false)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return false
|
||||
}
|
||||
pub, err := loadKeyFromFile(true)
|
||||
pub, err := LoadKeyFromFile(true)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user