Package org.bouncycastle.openpgp

Examples of org.bouncycastle.openpgp.PGPException


                } else if (message instanceof PGPOnePassSignatureList) {
                    processSignatureList(message);
                } else if (message instanceof PGPSignatureList) {
                    verifySignature(message);
                } else {
                    throw new PGPException("message is not a simple encrypted file - type unknown.");
                }
                message = plainFactory.nextObject();
            }
            return decryptedMessage;
        }
View Full Code Here


        return decodeKeyId;
    }

    private static void pgpAssertNotNull(Object o) throws PGPException {
        if (o == null) {
            throw new PGPException("can not decode");
        }
    }
View Full Code Here

    public PGPSigner(InputStream keyring, String keyId, String passphrase) throws IOException, PGPException {
        secretKey = getSecretKey(keyring, keyId);
        if(secretKey == null)
        {
            throw new PGPException(String.format("Specified key %s does not exist in key ring %s", keyId, keyring));
        }
        privateKey = secretKey.extractPrivateKey(new BcPBESecretKeyDecryptorBuilder(new BcPGPDigestCalculatorProvider()).build(passphrase.toCharArray()));
    }
View Full Code Here

TOP

Related Classes of org.bouncycastle.openpgp.PGPException

Copyright © 2018 www.massapicom. 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.