better error management + shortcode overflow control
This commit is contained in:
@@ -57,12 +57,21 @@ func TestGetKey(t *testing.T) {
|
||||
}
|
||||
// fmt.Println(kp.Public)
|
||||
// fmt.Println(kp.Private)
|
||||
key := kp.GetCryptoKeyObject()
|
||||
key, err := kp.GetCryptoKeyObject()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
// fmt.Println(key.Armor())
|
||||
Armpubkey, _ := key.GetArmoredPublicKey()
|
||||
Armpubkey, err := key.GetArmoredPublicKey()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
pubkey := base64.StdEncoding.EncodeToString([]byte(Armpubkey))
|
||||
println(len([]byte(pubkey)))
|
||||
binpubkey, _ := key.GetPublicKey()
|
||||
binpubkey, err := key.GetPublicKey()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
println(len(binpubkey))
|
||||
assert.Equal(t, kp.Public, pubkey, "The two public keys should be the same.")
|
||||
//if kp.Public != pubkey {
|
||||
|
||||
Reference in New Issue
Block a user