File tree Expand file tree Collapse file tree 2 files changed +36
-2
lines changed
pg/src/main/java/org/bouncycastle Expand file tree Collapse file tree 2 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 1
1
package org .bouncycastle .bcpg ;
2
2
3
+ import org .bouncycastle .util .Arrays ;
3
4
import org .bouncycastle .util .io .Streams ;
4
5
5
6
import java .io .ByteArrayOutputStream ;
@@ -213,7 +214,7 @@ public long getKeyID()
213
214
* @return 32 bytes issuer fingerprint
214
215
*/
215
216
public byte [] getFingerprint () {
216
- return fingerprint ;
217
+ return Arrays . clone ( fingerprint ) ;
217
218
}
218
219
219
220
/**
@@ -222,7 +223,7 @@ public byte[] getFingerprint() {
222
223
* @return salt
223
224
*/
224
225
public byte [] getSalt () {
225
- return salt ;
226
+ return Arrays . clone ( salt ) ;
226
227
}
227
228
228
229
/**
Original file line number Diff line number Diff line change @@ -88,11 +88,44 @@ public boolean verify(
88
88
return verifier .verify (pgpSig .getSignature ());
89
89
}
90
90
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
+ */
91
106
public long getKeyID ()
92
107
{
93
108
return sigPack .getKeyID ();
94
109
}
95
110
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
+
96
129
public int getSignatureType ()
97
130
{
98
131
return sigPack .getSignatureType ();
You can’t perform that action at this time.
0 commit comments