File tree Expand file tree Collapse file tree
pg/src/main/java/org/bouncycastle Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package org .bouncycastle .bcpg ;
22
3+ import org .bouncycastle .util .Arrays ;
34import org .bouncycastle .util .io .Streams ;
45
56import java .io .ByteArrayOutputStream ;
@@ -213,7 +214,7 @@ public long getKeyID()
213214 * @return 32 bytes issuer fingerprint
214215 */
215216 public byte [] getFingerprint () {
216- return fingerprint ;
217+ return Arrays . clone ( fingerprint ) ;
217218 }
218219
219220 /**
@@ -222,7 +223,7 @@ public byte[] getFingerprint() {
222223 * @return salt
223224 */
224225 public byte [] getSalt () {
225- return salt ;
226+ return Arrays . clone ( salt ) ;
226227 }
227228
228229 /**
Original file line number Diff line number Diff line change @@ -88,11 +88,44 @@ public boolean verify(
8888 return verifier .verify (pgpSig .getSignature ());
8989 }
9090
91+ /**
92+ * Return the packet version.
93+ *
94+ * @return packet version
95+ */
96+ public int getVersion () {
97+ return sigPack .getVersion ();
98+ }
99+
100+ /**
101+ * Return the key-ID of the issuer signing key.
102+ * For {@link OnePassSignaturePacket#VERSION_6} packets, the key-ID is derived from the fingerprint.
103+ *
104+ * @return key-ID
105+ */
91106 public long getKeyID ()
92107 {
93108 return sigPack .getKeyID ();
94109 }
95110
111+ /**
112+ * Return the issuer key fingerprint.
113+ * Only for {@link OnePassSignaturePacket#VERSION_6} packets.
114+ * @return fingerprint
115+ */
116+ public byte [] getFingerprint () {
117+ return sigPack .getFingerprint ();
118+ }
119+
120+ /**
121+ * Return the salt used in the corresponding signature.
122+ * Only for {@link OnePassSignaturePacket#VERSION_6} packets.
123+ * @return salt
124+ */
125+ public byte [] getSalt () {
126+ return sigPack .getSalt ();
127+ }
128+
96129 public int getSignatureType ()
97130 {
98131 return sigPack .getSignatureType ();
You can’t perform that action at this time.
0 commit comments