165166167168169170171172173174175
sGen.update((byte)ch); } lGen.close(); sGen.generate().encode(bOut); cGen.close(); if (armor) {
166167168169170171172173174175176
sGen.update((byte)ch); } lGen.close(); sGen.generate().encode(bcOut); PGPObjectFactory pgpFact = new PGPObjectFactory(bOut.toByteArray()); PGPOnePassSignatureList p1 = (PGPOnePassSignatureList)pgpFact.nextObject(); PGPOnePassSignature ops = p1.get(0);
202203204205206207208209210211212
sGen.update((byte)ch); } lGen.close(); sGen.generate().encode(bcOut); cGen.close(); // // verify generated signature
554555556557558559560561562563564
lOut.write(TEST_DATA); sGen.update(TEST_DATA); lGen.close(); sGen.generate().encode(bOut); verifySignature(bOut.toByteArray(), hashAlgorithm, pubKey, TEST_DATA); } private void testTextSig(
596597598599600601602603604605606
lOut.write(data); sGen.update(data); lGen.close(); PGPSignature sig = sGen.generate(); if (sig.getCreationTime().getTime() == 0) { fail("creation time not set in v4 signature"); }
12811282128312841285128612871288128912901291
sGen.update((byte)ch); } lOut.close(); sGen.generate().encode(bcOut); bcOut.close(); // // verify generated signature
13531354135513561357135813591360136113621363
329330331332333334335336337338339
aOut.endClearText(); BCPGOutputStream bcpgOut = new BCPGOutputStream(aOut); sGen.generate().encode(bcpgOut); aOut.close(); messageTest(new String(bOut.toByteArray()), type); }
346347348349350351352353354355356
sGen.update((byte)ch); } lGen.close(); sGen.generate().encode(bcOut); cGen.close(); PGPObjectFactory pgpFact = new PGPObjectFactory(bOut.toByteArray()); PGPCompressedData c1 = (PGPCompressedData)pgpFact.nextObject();
477478479480481482483484485486487
sGen.update((byte)ch); } lGen.close(); sGen.generate().encode(bcOut); cGen.close(); // // verify generated signature - canconical text