Complete refactor using protobuff
This commit is contained in:
27
asymcrypt_test.go
Normal file
27
asymcrypt_test.go
Normal 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")
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user