Examples of BcPGPObjectFactory


Examples of org.bouncycastle.openpgp.bc.BcPGPObjectFactory

        assertTrue(pgpSignatureFile.exists());

        try (final InputStream keyringIn = PGPUtil.getDecoderStream(PackageBuilderTest.class.getResourceAsStream("public.asc"))) {
            try (final InputStream signatureIn = PGPUtil.getDecoderStream(new FileInputStream(pgpSignatureFile))) {
                final PGPPublicKey publicKey = ((PGPPublicKeyRing) new BcPGPPublicKeyRingCollection(keyringIn).getKeyRings().next()).getPublicKey();
                final PGPSignature signature = ((PGPSignatureList) new BcPGPObjectFactory(signatureIn).nextObject()).get(0);
                signature.init(new BcPGPContentVerifierBuilderProvider(), publicKey);

                signature.update(Files.asByteSource(new File(packageDir, "debian-binary")).read());
                signature.update(Files.asByteSource(new File(packageDir, "control.tar.gz")).read());
                signature.update(Files.asByteSource(new File(packageDir, "data.tar.gz")).read());
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.