mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-30 08:12:06 +01:00
Add KeyRingInfo.getVersion()
This commit is contained in:
parent
98609375d1
commit
dae5288456
2 changed files with 11 additions and 0 deletions
|
@ -727,6 +727,15 @@ public class KeyRingInfo {
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the version number of the public keys format.
|
||||
*
|
||||
* @return version
|
||||
*/
|
||||
public int getVersion() {
|
||||
return keys.getPublicKey().getVersion();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a list of all subkeys which can be used for encryption of the given purpose.
|
||||
* This list does not include expired or revoked keys.
|
||||
|
|
|
@ -75,6 +75,8 @@ public class KeyRingInfoTest {
|
|||
assertEquals(Collections.singletonList("<emil@email.user>"), pInfo.getUserIds());
|
||||
assertEquals(Collections.singletonList("emil@email.user"), sInfo.getEmailAddresses());
|
||||
assertEquals(Collections.singletonList("emil@email.user"), pInfo.getEmailAddresses());
|
||||
assertEquals(4, sInfo.getVersion());
|
||||
assertEquals(4, pInfo.getVersion());
|
||||
|
||||
assertTrue(sInfo.isSecretKey());
|
||||
assertFalse(pInfo.isSecretKey());
|
||||
|
|
Loading…
Reference in a new issue