mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-05 20:15:59 +01:00
Reformat KeyRingReader
This commit is contained in:
parent
9eea028cf7
commit
b31d72bd65
1 changed files with 44 additions and 23 deletions
|
@ -41,7 +41,8 @@ public class KeyRingReader {
|
|||
* @return key ring
|
||||
* @throws IOException in case of an IO error
|
||||
*/
|
||||
public PGPKeyRing keyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
public PGPKeyRing keyRing(@Nonnull InputStream inputStream)
|
||||
throws IOException {
|
||||
return readKeyRing(inputStream);
|
||||
}
|
||||
|
||||
|
@ -53,7 +54,8 @@ public class KeyRingReader {
|
|||
* @return key ring
|
||||
* @throws IOException in case of an IO error
|
||||
*/
|
||||
public PGPKeyRing keyRing(@Nonnull byte[] bytes) throws IOException {
|
||||
public PGPKeyRing keyRing(@Nonnull byte[] bytes)
|
||||
throws IOException {
|
||||
return keyRing(new ByteArrayInputStream(bytes));
|
||||
}
|
||||
|
||||
|
@ -65,19 +67,23 @@ public class KeyRingReader {
|
|||
* @return key ring
|
||||
* @throws IOException in case of an IO error
|
||||
*/
|
||||
public PGPKeyRing keyRing(@Nonnull String asciiArmored) throws IOException {
|
||||
public PGPKeyRing keyRing(@Nonnull String asciiArmored)
|
||||
throws IOException {
|
||||
return keyRing(asciiArmored.getBytes(UTF8));
|
||||
}
|
||||
|
||||
public PGPPublicKeyRing publicKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
public PGPPublicKeyRing publicKeyRing(@Nonnull InputStream inputStream)
|
||||
throws IOException {
|
||||
return readPublicKeyRing(inputStream);
|
||||
}
|
||||
|
||||
public PGPPublicKeyRing publicKeyRing(@Nonnull byte[] bytes) throws IOException {
|
||||
public PGPPublicKeyRing publicKeyRing(@Nonnull byte[] bytes)
|
||||
throws IOException {
|
||||
return publicKeyRing(new ByteArrayInputStream(bytes));
|
||||
}
|
||||
|
||||
public PGPPublicKeyRing publicKeyRing(@Nonnull String asciiArmored) throws IOException {
|
||||
public PGPPublicKeyRing publicKeyRing(@Nonnull String asciiArmored)
|
||||
throws IOException {
|
||||
return publicKeyRing(asciiArmored.getBytes(UTF8));
|
||||
}
|
||||
|
||||
|
@ -86,23 +92,28 @@ public class KeyRingReader {
|
|||
return readPublicKeyRingCollection(inputStream);
|
||||
}
|
||||
|
||||
public PGPPublicKeyRingCollection publicKeyRingCollection(@Nonnull byte[] bytes) throws IOException, PGPException {
|
||||
public PGPPublicKeyRingCollection publicKeyRingCollection(@Nonnull byte[] bytes)
|
||||
throws IOException, PGPException {
|
||||
return publicKeyRingCollection(new ByteArrayInputStream(bytes));
|
||||
}
|
||||
|
||||
public PGPPublicKeyRingCollection publicKeyRingCollection(@Nonnull String asciiArmored) throws IOException, PGPException {
|
||||
public PGPPublicKeyRingCollection publicKeyRingCollection(@Nonnull String asciiArmored)
|
||||
throws IOException, PGPException {
|
||||
return publicKeyRingCollection(asciiArmored.getBytes(UTF8));
|
||||
}
|
||||
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull InputStream inputStream)
|
||||
throws IOException {
|
||||
return readSecretKeyRing(inputStream);
|
||||
}
|
||||
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull byte[] bytes) throws IOException {
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull byte[] bytes)
|
||||
throws IOException {
|
||||
return secretKeyRing(new ByteArrayInputStream(bytes));
|
||||
}
|
||||
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull String asciiArmored) throws IOException {
|
||||
public PGPSecretKeyRing secretKeyRing(@Nonnull String asciiArmored)
|
||||
throws IOException {
|
||||
return secretKeyRing(asciiArmored.getBytes(UTF8));
|
||||
}
|
||||
|
||||
|
@ -111,11 +122,13 @@ public class KeyRingReader {
|
|||
return readSecretKeyRingCollection(inputStream);
|
||||
}
|
||||
|
||||
public PGPSecretKeyRingCollection secretKeyRingCollection(@Nonnull byte[] bytes) throws IOException, PGPException {
|
||||
public PGPSecretKeyRingCollection secretKeyRingCollection(@Nonnull byte[] bytes)
|
||||
throws IOException, PGPException {
|
||||
return secretKeyRingCollection(new ByteArrayInputStream(bytes));
|
||||
}
|
||||
|
||||
public PGPSecretKeyRingCollection secretKeyRingCollection(@Nonnull String asciiArmored) throws IOException, PGPException {
|
||||
public PGPSecretKeyRingCollection secretKeyRingCollection(@Nonnull String asciiArmored)
|
||||
throws IOException, PGPException {
|
||||
return secretKeyRingCollection(asciiArmored.getBytes(UTF8));
|
||||
}
|
||||
|
||||
|
@ -124,11 +137,13 @@ public class KeyRingReader {
|
|||
return readKeyRingCollection(inputStream, isSilent);
|
||||
}
|
||||
|
||||
public PGPKeyRingCollection keyRingCollection(@Nonnull byte[] bytes, boolean isSilent) throws IOException, PGPException {
|
||||
public PGPKeyRingCollection keyRingCollection(@Nonnull byte[] bytes, boolean isSilent)
|
||||
throws IOException, PGPException {
|
||||
return keyRingCollection(new ByteArrayInputStream(bytes), isSilent);
|
||||
}
|
||||
|
||||
public PGPKeyRingCollection keyRingCollection(@Nonnull String asciiArmored, boolean isSilent) throws IOException, PGPException {
|
||||
public PGPKeyRingCollection keyRingCollection(@Nonnull String asciiArmored, boolean isSilent)
|
||||
throws IOException, PGPException {
|
||||
return keyRingCollection(asciiArmored.getBytes(UTF8), isSilent);
|
||||
}
|
||||
|
||||
|
@ -142,7 +157,8 @@ public class KeyRingReader {
|
|||
* @return key ring
|
||||
* @throws IOException in case of an IO error
|
||||
*/
|
||||
public static PGPKeyRing readKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
public static PGPKeyRing readKeyRing(@Nonnull InputStream inputStream)
|
||||
throws IOException {
|
||||
return readKeyRing(inputStream, MAX_ITERATIONS);
|
||||
}
|
||||
|
||||
|
@ -157,7 +173,8 @@ public class KeyRingReader {
|
|||
* @return key ring
|
||||
* @throws IOException in case of an IO error
|
||||
*/
|
||||
public static PGPKeyRing readKeyRing(@Nonnull InputStream inputStream, int maxIterations) throws IOException {
|
||||
public static PGPKeyRing readKeyRing(@Nonnull InputStream inputStream, int maxIterations)
|
||||
throws IOException {
|
||||
PGPObjectFactory objectFactory = ImplementationFactory.getInstance().getPGPObjectFactory(
|
||||
ArmorUtils.getDecoderStream(inputStream));
|
||||
int i = 0;
|
||||
|
@ -181,7 +198,8 @@ public class KeyRingReader {
|
|||
throw new IOException("Loop exceeded max iteration count.");
|
||||
}
|
||||
|
||||
public static PGPPublicKeyRing readPublicKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
public static PGPPublicKeyRing readPublicKeyRing(@Nonnull InputStream inputStream)
|
||||
throws IOException {
|
||||
return readPublicKeyRing(inputStream, MAX_ITERATIONS);
|
||||
}
|
||||
|
||||
|
@ -196,7 +214,8 @@ public class KeyRingReader {
|
|||
*
|
||||
* @throws IOException in case of an IO error or exceeding of max iterations
|
||||
*/
|
||||
public static PGPPublicKeyRing readPublicKeyRing(@Nonnull InputStream inputStream, int maxIterations) throws IOException {
|
||||
public static PGPPublicKeyRing readPublicKeyRing(@Nonnull InputStream inputStream, int maxIterations)
|
||||
throws IOException {
|
||||
PGPObjectFactory objectFactory = ImplementationFactory.getInstance().getPGPObjectFactory(
|
||||
ArmorUtils.getDecoderStream(inputStream));
|
||||
int i = 0;
|
||||
|
@ -218,7 +237,7 @@ public class KeyRingReader {
|
|||
}
|
||||
|
||||
public static PGPPublicKeyRingCollection readPublicKeyRingCollection(@Nonnull InputStream inputStream)
|
||||
throws IOException, PGPException {
|
||||
throws IOException {
|
||||
return readPublicKeyRingCollection(inputStream, MAX_ITERATIONS);
|
||||
}
|
||||
|
||||
|
@ -264,7 +283,8 @@ public class KeyRingReader {
|
|||
throw new IOException("Loop exceeded max iteration count.");
|
||||
}
|
||||
|
||||
public static PGPSecretKeyRing readSecretKeyRing(@Nonnull InputStream inputStream) throws IOException {
|
||||
public static PGPSecretKeyRing readSecretKeyRing(@Nonnull InputStream inputStream)
|
||||
throws IOException {
|
||||
return readSecretKeyRing(inputStream, MAX_ITERATIONS);
|
||||
}
|
||||
|
||||
|
@ -279,7 +299,8 @@ public class KeyRingReader {
|
|||
*
|
||||
* @throws IOException in case of an IO error or exceeding of max iterations
|
||||
*/
|
||||
public static PGPSecretKeyRing readSecretKeyRing(@Nonnull InputStream inputStream, int maxIterations) throws IOException {
|
||||
public static PGPSecretKeyRing readSecretKeyRing(@Nonnull InputStream inputStream, int maxIterations)
|
||||
throws IOException {
|
||||
InputStream decoderStream = ArmorUtils.getDecoderStream(inputStream);
|
||||
PGPObjectFactory objectFactory = ImplementationFactory.getInstance().getPGPObjectFactory(decoderStream);
|
||||
int i = 0;
|
||||
|
@ -302,7 +323,7 @@ public class KeyRingReader {
|
|||
}
|
||||
|
||||
public static PGPSecretKeyRingCollection readSecretKeyRingCollection(@Nonnull InputStream inputStream)
|
||||
throws IOException, PGPException {
|
||||
throws IOException {
|
||||
return readSecretKeyRingCollection(inputStream, MAX_ITERATIONS);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue