26 lines
433 B
Go
26 lines
433 B
Go
|
package meow
|
||
|
|
||
|
import (
|
||
|
"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())
|
||
|
pubkey, _ := key.GetArmoredPublicKey()
|
||
|
if kp.Public != pubkey {
|
||
|
log.Fatal("error in public key")
|
||
|
}
|
||
|
}
|