meowlib/usermessage_test.go
2022-01-15 22:19:29 +01:00

38 lines
709 B
Go

package meowlib
import (
"fmt"
"log"
"testing"
)
func TestCreateText(t *testing.T) {
kp := NewKeyPair()
fmt.Println(kp.Public)
fmt.Println(kp.Private)
}
func TestPack(t *testing.T) {
kp := NewKeyPair()
// fmt.Println(kp.Public)
// fmt.Println(kp.Private)
key := kp.GetCryptoKeyObject()
// fmt.Println(key.Armor())
pubkey, _ := key.GetArmoredPublicKey()
if kp.Public != pubkey {
log.Fatal("error in public key")
}
}
func TestUnPack(t *testing.T) {
kp := NewKeyPair()
// fmt.Println(kp.Public)
// fmt.Println(kp.Private)
key := kp.GetCryptoKeyObject()
// fmt.Println(key.Armor())
pubkey, _ := key.GetArmoredPublicKey()
if kp.Public != pubkey {
log.Fatal("error in public key")
}
}