Add getEntity and getEcryptionKeyIDs functions to key and message types respectively (#55)
* add getEntity function to key struct * add getEncryptionKeyIDs * add chengelog + bool return in getEncryptionKeyIDs * fix description
This commit is contained in:
parent
d1f6f7d718
commit
8d42a53775
5 changed files with 64 additions and 0 deletions
|
|
@ -7,6 +7,7 @@ import (
|
|||
"strings"
|
||||
"testing"
|
||||
|
||||
"golang.org/x/crypto/openpgp"
|
||||
"golang.org/x/crypto/openpgp/armor"
|
||||
"golang.org/x/crypto/rsa"
|
||||
|
||||
|
|
@ -378,3 +379,13 @@ func TestGetSHA256FingerprintsV4(t *testing.T) {
|
|||
assert.Exactly(t, "d9ac0b857da6d2c8be985b251a9e3db31e7a1d2d832d1f07ebe838a9edce9c24", sha256Fingerprints[0])
|
||||
assert.Exactly(t, "203dfba1f8442c17e59214d9cd11985bfc5cc8721bb4a71740dd5507e58a1a0d", sha256Fingerprints[1])
|
||||
}
|
||||
|
||||
func TestGetEntity(t *testing.T) {
|
||||
publicKey, err := NewKeyFromArmored(readTestFile("keyring_publicKey", false))
|
||||
if err != nil {
|
||||
t.Fatal("Cannot unarmor key:", err)
|
||||
}
|
||||
entity := publicKey.GetEntity()
|
||||
assert.True(t, entity.PrimaryIdentity().SelfSignature.FlagsValid)
|
||||
assert.IsType(t, &openpgp.Entity{}, entity)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue