Examples of PGPLiteralDataGenerator


Examples of org.bouncycastle.openpgp.PGPLiteralDataGenerator

        ByteArrayInputStream    testIn = new ByteArrayInputStream(data);
       
        sGen.initSign(PGPSignature.CANONICAL_TEXT_DOCUMENT, privKey);
        sGen.generateOnePassVersion(false).encode(bOut);

        PGPLiteralDataGenerator lGen = new PGPLiteralDataGenerator();
        OutputStream            lOut = lGen.open(
            new UncloseableOutputStream(bOut),
            PGPLiteralData.TEXT,
            "_CONSOLE",
            data.length * 2,
            new Date());

        int ch;
        while ((ch = testIn.read()) >= 0)
        {
            lOut.write(ch);
            sGen.update((byte)ch);
        }
   
        lOut.write(data);
        sGen.update(data);
       
        lGen.close();
   
        PGPSignature sig = sGen.generate();

        if (sig.getCreationTime().getTime() == 0)
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.