File tree 2 files changed +40
-0
lines changed
pg/src/main/java/org/bouncycastle/openpgp/api
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 18
18
import org .bouncycastle .openpgp .api .exception .MissingIssuerCertException ;
19
19
import org .bouncycastle .openpgp .api .util .UTCUtil ;
20
20
import org .bouncycastle .openpgp .operator .PGPContentVerifierBuilderProvider ;
21
+ import org .bouncycastle .util .io .Streams ;
21
22
22
23
import java .io .ByteArrayInputStream ;
23
24
import java .io .ByteArrayOutputStream ;
@@ -126,6 +127,25 @@ public static OpenPGPCertificate fromAsciiArmor(
126
127
implementation );
127
128
}
128
129
130
+ public static OpenPGPCertificate fromInputStream (InputStream inputStream )
131
+ throws IOException
132
+ {
133
+ return fromInputStream (inputStream , OpenPGPImplementation .getInstance ());
134
+ }
135
+
136
+ public static OpenPGPCertificate fromInputStream (InputStream inputStream , OpenPGPImplementation implementation )
137
+ throws IOException
138
+ {
139
+ byte [] bytes = Streams .readAll (inputStream );
140
+ return fromBytes (bytes , implementation );
141
+ }
142
+
143
+ public static OpenPGPCertificate fromBytes (byte [] bytes )
144
+ throws IOException
145
+ {
146
+ return fromBytes (bytes , OpenPGPImplementation .getInstance ());
147
+ }
148
+
129
149
public static OpenPGPCertificate fromBytes (
130
150
byte [] bytes ,
131
151
OpenPGPImplementation implementation )
Original file line number Diff line number Diff line change 14
14
import org .bouncycastle .openpgp .PGPUtil ;
15
15
import org .bouncycastle .openpgp .operator .PBESecretKeyDecryptor ;
16
16
import org .bouncycastle .openpgp .operator .PBESecretKeyDecryptorBuilderProvider ;
17
+ import org .bouncycastle .util .io .Streams ;
17
18
18
19
import java .io .ByteArrayInputStream ;
19
20
import java .io .ByteArrayOutputStream ;
@@ -112,6 +113,25 @@ public static OpenPGPKey fromAsciiArmor(
112
113
implementation );
113
114
}
114
115
116
+ public static OpenPGPKey fromInputStream (InputStream inputStream )
117
+ throws IOException
118
+ {
119
+ return fromInputStream (inputStream , OpenPGPImplementation .getInstance ());
120
+ }
121
+
122
+ public static OpenPGPKey fromInputStream (InputStream inputStream , OpenPGPImplementation implementation )
123
+ throws IOException
124
+ {
125
+ return fromBytes (Streams .readAll (inputStream ), implementation );
126
+ }
127
+
128
+ public static OpenPGPKey fromBytes (
129
+ byte [] bytes )
130
+ throws IOException
131
+ {
132
+ return fromBytes (bytes , OpenPGPImplementation .getInstance ());
133
+ }
134
+
115
135
public static OpenPGPKey fromBytes (
116
136
byte [] bytes ,
117
137
OpenPGPImplementation implementation )
You can’t perform that action at this time.
0 commit comments