Top Description Constructors Methods
org.bouncycastle.openpgp.examples

public Class ClearSignedFileProcessor

extends Object
Class Inheritance
Imports
java.io.BufferedInputStream, .BufferedOutputStream, .ByteArrayOutputStream, .FileInputStream, .FileOutputStream, .IOException, .InputStream, .OutputStream, java.security.NoSuchAlgorithmException, .NoSuchProviderException, .Security, .SignatureException, java.util.Iterator, org.bouncycastle.bcpg.ArmoredInputStream, .ArmoredOutputStream, .BCPGOutputStream, org.bouncycastle.jce.provider.BouncyCastleProvider, org.bouncycastle.openpgp.PGPException, .PGPPrivateKey, .PGPPublicKey, .PGPPublicKeyRingCollection, .PGPSecretKey, .PGPSignature, .PGPSignatureGenerator, .PGPSignatureList, .PGPSignatureSubpacketGenerator, .PGPUtil, org.bouncycastle.openpgp.jcajce.JcaPGPObjectFactory, org.bouncycastle.openpgp.operator.jcajce.JcaKeyFingerprintCalculator, .JcaPGPContentSignerBuilder, .JcaPGPContentVerifierBuilderProvider, .JcePBESecretKeyDecryptorBuilder, org.bouncycastle.util.Strings

A simple utility class that creates clear signed files and verifies them.

To sign a file: ClearSignedFileProcessor -s fileName secretKey passPhrase.

To decrypt: ClearSignedFileProcessor -v signatureFile publicKeyFile.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static int
private static int
private static byte[]
private static boolean
isLineEnding(byte b)

private static boolean
isWhiteSpace(byte b)

public static void
main(String[] args)

private static void
processLine(PGPSignature sig, byte[] line)

private static void
private static int
private static int
private static int
private static void
signFile(String fileName, InputStream keyIn, OutputStream out, char[] pass, String digestName)

private static void
verifyFile(InputStream in, InputStream keyIn, String resultName)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ClearSignedFileProcessorback to summary
public ClearSignedFileProcessor()

Method Detail

getLengthWithoutSeparatorOrTrailingWhitespaceback to summary
private static int getLengthWithoutSeparatorOrTrailingWhitespace(byte[] line)
getLengthWithoutWhiteSpaceback to summary
private static int getLengthWithoutWhiteSpace(byte[] line)
getLineSeparatorback to summary
private static byte[] getLineSeparator()
isLineEndingback to summary
private static boolean isLineEnding(byte b)
isWhiteSpaceback to summary
private static boolean isWhiteSpace(byte b)
mainback to summary
public static void main(String[] args) throws Exception
processLineback to summary
private static void processLine(PGPSignature sig, byte[] line) throws SignatureException, IOException
processLineback to summary
private static void processLine(OutputStream aOut, PGPSignatureGenerator sGen, byte[] line) throws SignatureException, IOException
readInputLineback to summary
private static int readInputLine(ByteArrayOutputStream bOut, InputStream fIn) throws IOException
readInputLineback to summary
private static int readInputLine(ByteArrayOutputStream bOut, int lookAhead, InputStream fIn) throws IOException
readPassedEOLback to summary
private static int readPassedEOL(ByteArrayOutputStream bOut, int lastCh, InputStream fIn) throws IOException
signFileback to summary
private static void signFile(String fileName, InputStream keyIn, OutputStream out, char[] pass, String digestName) throws IOException, NoSuchAlgorithmException, NoSuchProviderException, PGPException, SignatureException
verifyFileback to summary
private static void verifyFile(InputStream in, InputStream keyIn, String resultName) throws Exception