Skip to content

Commit f718503

Browse files
committed
Merge branch 'pgpainless-moreKeyIdentifiers'
2 parents c40df6d + c6a1cef commit f718503

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

pg/src/main/java/org/bouncycastle/bcpg/sig/IntendedRecipientFingerprint.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.bouncycastle.bcpg.SignatureSubpacket;
44
import org.bouncycastle.bcpg.SignatureSubpacketTags;
5+
import org.bouncycastle.openpgp.KeyIdentifier;
56
import org.bouncycastle.util.Arrays;
67

78
/**
@@ -40,4 +41,9 @@ public byte[] getFingerprint()
4041
{
4142
return Arrays.copyOfRange(data, 1, data.length);
4243
}
44+
45+
public KeyIdentifier getKeyIdentifier()
46+
{
47+
return new KeyIdentifier(getFingerprint());
48+
}
4349
}

pg/src/main/java/org/bouncycastle/bcpg/sig/IssuerFingerprint.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import org.bouncycastle.bcpg.PublicKeyPacket;
55
import org.bouncycastle.bcpg.SignatureSubpacket;
66
import org.bouncycastle.bcpg.SignatureSubpacketTags;
7+
import org.bouncycastle.openpgp.KeyIdentifier;
78
import org.bouncycastle.util.Arrays;
89

910
/**
@@ -59,4 +60,9 @@ public long getKeyID()
5960
}
6061
return 0;
6162
}
63+
64+
public KeyIdentifier getKeyIdentifier()
65+
{
66+
return new KeyIdentifier(getFingerprint());
67+
}
6268
}

pg/src/main/java/org/bouncycastle/bcpg/sig/IssuerKeyID.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import org.bouncycastle.bcpg.FingerprintUtil;
44
import org.bouncycastle.bcpg.SignatureSubpacket;
55
import org.bouncycastle.bcpg.SignatureSubpacketTags;
6+
import org.bouncycastle.openpgp.KeyIdentifier;
67

78
/**
89
* Signature Subpacket containing the key-id of the issuers signing (sub-) key.
@@ -44,4 +45,9 @@ public long getKeyID()
4445
{
4546
return FingerprintUtil.readKeyID(data);
4647
}
48+
49+
public KeyIdentifier getKeyIdentifier()
50+
{
51+
return new KeyIdentifier(getKeyID());
52+
}
4753
}

pg/src/main/java/org/bouncycastle/bcpg/sig/RevocationKey.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import org.bouncycastle.bcpg.SignatureSubpacket;
44
import org.bouncycastle.bcpg.SignatureSubpacketTags;
5+
import org.bouncycastle.openpgp.KeyIdentifier;
56

67
/**
78
* Represents revocation key OpenPGP signature sub packet.
@@ -55,4 +56,9 @@ public byte[] getFingerprint()
5556
System.arraycopy(data, 2, fingerprint, 0, fingerprint.length);
5657
return fingerprint;
5758
}
59+
60+
public KeyIdentifier getKeyIdentifier()
61+
{
62+
return new KeyIdentifier(getFingerprint());
63+
}
5864
}

0 commit comments

Comments
 (0)