Complete refactor using protobuff

This commit is contained in:
ycc
2022-01-15 22:19:29 +01:00
parent 60b14db80c
commit c07cdff3de
29 changed files with 1088 additions and 131 deletions

27
asymcrypt_test.go Normal file
View File

@ -0,0 +1,27 @@
package meowlib
import (
"encoding/base64"
"fmt"
"log"
"testing"
)
func TestNewKeyPair(t *testing.T) {
kp := NewKeyPair()
fmt.Println(kp.Public)
fmt.Println(kp.Private)
}
func TestGetKey(t *testing.T) {
kp := NewKeyPair()
// fmt.Println(kp.Public)
// fmt.Println(kp.Private)
key := kp.GetCryptoKeyObject()
// fmt.Println(key.Armor())
Armpubkey, _ := key.GetArmoredPublicKey()
pubkey := base64.StdEncoding.EncodeToString([]byte(Armpubkey))
if kp.Public != pubkey {
log.Fatal("error in public key")
}
}