File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
pg/src/main/java/org/bouncycastle/openpgp Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change 10
10
11
11
import org .bouncycastle .bcpg .BCPGInputStream ;
12
12
import org .bouncycastle .bcpg .PacketTags ;
13
+ import org .bouncycastle .bcpg .TrustPacket ;
13
14
import org .bouncycastle .bcpg .UnknownPacket ;
14
15
import org .bouncycastle .bcpg .UnsupportedPacketVersionException ;
15
16
import org .bouncycastle .openpgp .operator .KeyFingerPrintCalculator ;
16
- import org .bouncycastle .util .Iterable ;
17
17
18
18
/**
19
19
* General class for reading a PGP object stream.
@@ -141,6 +141,8 @@ public Object nextObject()
141
141
return new PGPCompressedData (in );
142
142
case PacketTags .LITERAL_DATA :
143
143
return new PGPLiteralData (in );
144
+ case PacketTags .TRUST :
145
+ return new PGPTrust (in );
144
146
case PacketTags .PUBLIC_KEY_ENC_SESSION :
145
147
case PacketTags .SYMMETRIC_KEY_ENC_SESSION :
146
148
case PacketTags .SYMMETRIC_KEY_ENC :
Original file line number Diff line number Diff line change
1
+ package org .bouncycastle .openpgp ;
2
+
3
+ import org .bouncycastle .bcpg .BCPGInputStream ;
4
+ import org .bouncycastle .bcpg .TrustPacket ;
5
+
6
+ import java .io .IOException ;
7
+ import java .util .Arrays ;
8
+
9
+ public class PGPTrust
10
+ {
11
+
12
+ private final TrustPacket packet ;
13
+
14
+ public PGPTrust (TrustPacket packet )
15
+ {
16
+ this .packet = packet ;
17
+ }
18
+
19
+ public PGPTrust (BCPGInputStream inputStream )
20
+ throws IOException
21
+ {
22
+ this ((TrustPacket ) inputStream .readPacket ());
23
+ }
24
+
25
+ public TrustPacket getPacket ()
26
+ {
27
+ return packet ;
28
+ }
29
+
30
+ public byte [] getLevelAndTrust ()
31
+ {
32
+ return Arrays .copyOf (
33
+ packet .getLevelAndTrustAmount (),
34
+ packet .getLevelAndTrustAmount ().length );
35
+ }
36
+ }
You can’t perform that action at this time.
0 commit comments