Getting error while decrypting a signed PGP message file.

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Getting error while decrypting a signed PGP message file.

Younie, Bradford

I’m trying to use the SignedFileProcessor to decrypt a signed PGP message file. When I run it, I get the following exception:

 

Exception in thread "main" java.lang.ClassCastException: org.bouncycastle.openpgp.PGPEncryptedDataList

      at org.bouncycastle.openpgp.examples.SignedFileProcessor.verifyFile(SignedFileProcessor.java:120)

      at org.bouncycastle.openpgp.examples.SignedFileProcessor.main(SignedFileProcessor.java:257)

 

The actual piece of code that blows up is:

 

PGPCompressedData           c1 = (PGPCompressedData)pgpFact.nextObject();

 

The key that it is trying to deal with is a public key.

 

Can someone lend some advice?

 

Best regards,

---
Bradford Younie

 

----------
Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.

THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.

Reply | Threaded
Open this post in threaded view
|

Re: Getting error while decrypting a signed PGP message file.

David Hook-4

It sounds like the file is encrypted, not signed, although it might be
both. You'll need to modify the example to decrypt the file first.

Regards,

David

On Thu, 2007-12-06 at 13:21 -0500, Younie, Bradford wrote:

> I’m trying to use the SignedFileProcessor to decrypt a signed PGP
> message file. When I run it, I get the following exception:
>
>  
>
> Exception in thread "main" java.lang.ClassCastException:
> org.bouncycastle.openpgp.PGPEncryptedDataList
>
>       at
> org.bouncycastle.openpgp.examples.SignedFileProcessor.verifyFile(SignedFileProcessor.java:120)
>
>       at
> org.bouncycastle.openpgp.examples.SignedFileProcessor.main(SignedFileProcessor.java:257)
>
>  
>
> The actual piece of code that blows up is:
>
>  
>
> PGPCompressedData           c1 =
> (PGPCompressedData)pgpFact.nextObject();
>
>  
>
> The key that it is trying to deal with is a public key.
>
>  
>
> Can someone lend some advice?
>
>  
>
> Best regards,
>
> ---
> Bradford Younie
>
>
>
>  
>
>
> ----------
> Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.
>
> THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.
>


Reply | Threaded
Open this post in threaded view
|

RE: Getting error while decrypting a signed PGPmessage file.

Younie, Bradford
> It sounds like the file is encrypted, not signed, although it might be
> both. You'll need to modify the example to decrypt the file first.

According to a developer who works on the app that generated the PGP
message, it was both encrypted and signed. It was signed with a public
key file.

If I try to decrypt the file, it fails with the error:

"encrypted message contains a signed message - not literal data."

Brad


>
> Regards,
>
> David
>
> On Thu, 2007-12-06 at 13:21 -0500, Younie, Bradford wrote:
> > I'm trying to use the SignedFileProcessor to decrypt a signed PGP
> > message file. When I run it, I get the following exception:
> >
> >
> >
> > Exception in thread "main" java.lang.ClassCastException:
> > org.bouncycastle.openpgp.PGPEncryptedDataList
> >
> >       at
> >
>
org.bouncycastle.openpgp.examples.SignedFileProcessor.verifyFile(SignedF
il
> eProcessor.java:120)
> >
> >       at
> >
>
org.bouncycastle.openpgp.examples.SignedFileProcessor.main(SignedFilePro
ce

> ssor.java:257)
> >
> >
> >
> > The actual piece of code that blows up is:
> >
> >
> >
> > PGPCompressedData           c1 =
> > (PGPCompressedData)pgpFact.nextObject();
> >
> >
> >
> > The key that it is trying to deal with is a public key.
> >
> >
> >
> > Can someone lend some advice?
> >
> >
> >
> > Best regards,
> >
> > ---
> > Bradford Younie
> >
> >
> >
> >
> >
> >
> > ----------
> > Learn more about Chase Paymentech Solutions,LLC payment processing
> services at www.chasepaymentech.com.
> >
> > THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any
attachments
> are proprietary and confidential information intended only for the use
of
> the recipient(s) named above.  If you are not the intended recipient,
you
> may not print, distribute, or copy this message or any attachments.
If
> you have received this communication in error, please notify the
sender by
> return e-mail and delete this message and any attachments from your
> computer.
> >
----------
Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.

THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.


Reply | Threaded
Open this post in threaded view
|

RE: Getting error while decrypting a signed PGPmessage file.

David Hook-4

This would confirm what the developer has told you. I assume you've run
the KeyBasedFileProcessor - if you want to use it as the base you'll
need to modify it to process the signed message.

Regards,

David

On Thu, 2007-12-06 at 15:36 -0500, Younie, Bradford wrote:

> > It sounds like the file is encrypted, not signed, although it might be
> > both. You'll need to modify the example to decrypt the file first.
>
> According to a developer who works on the app that generated the PGP
> message, it was both encrypted and signed. It was signed with a public
> key file.
>
> If I try to decrypt the file, it fails with the error:
>
> "encrypted message contains a signed message - not literal data."
>
> Brad
>
>
> >
> > Regards,
> >
> > David
> >
> > On Thu, 2007-12-06 at 13:21 -0500, Younie, Bradford wrote:
> > > I'm trying to use the SignedFileProcessor to decrypt a signed PGP
> > > message file. When I run it, I get the following exception:
> > >
> > >
> > >
> > > Exception in thread "main" java.lang.ClassCastException:
> > > org.bouncycastle.openpgp.PGPEncryptedDataList
> > >
> > >       at
> > >
> >
> org.bouncycastle.openpgp.examples.SignedFileProcessor.verifyFile(SignedF
> il
> > eProcessor.java:120)
> > >
> > >       at
> > >
> >
> org.bouncycastle.openpgp.examples.SignedFileProcessor.main(SignedFilePro
> ce
> > ssor.java:257)
> > >
> > >
> > >
> > > The actual piece of code that blows up is:
> > >
> > >
> > >
> > > PGPCompressedData           c1 =
> > > (PGPCompressedData)pgpFact.nextObject();
> > >
> > >
> > >
> > > The key that it is trying to deal with is a public key.
> > >
> > >
> > >
> > > Can someone lend some advice?
> > >
> > >
> > >
> > > Best regards,
> > >
> > > ---
> > > Bradford Younie
> > >
> > >
> > >
> > >
> > >
> > >
> > > ----------
> > > Learn more about Chase Paymentech Solutions,LLC payment processing
> > services at www.chasepaymentech.com.
> > >
> > > THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any
> attachments
> > are proprietary and confidential information intended only for the use
> of
> > the recipient(s) named above.  If you are not the intended recipient,
> you
> > may not print, distribute, or copy this message or any attachments.
> If
> > you have received this communication in error, please notify the
> sender by
> > return e-mail and delete this message and any attachments from your
> > computer.
> > >
> ----------
> Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.
>
> THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.
>
>
>


Reply | Threaded
Open this post in threaded view
|

RE: Getting error while decrypting a signedPGPmessage file.

Younie, Bradford
>
> This would confirm what the developer has told you. I assume you've
run
> the KeyBasedFileProcessor - if you want to use it as the base you'll
> need to modify it to process the signed message.

Thanks!

Now I just need to figure out how to process the signature while
decrypting. The samples are not very helpful in that regard, and I can't
find any docs that help with that either.

Brad

>
> Regards,
>
> David
>
> On Thu, 2007-12-06 at 15:36 -0500, Younie, Bradford wrote:
> > > It sounds like the file is encrypted, not signed, although it
might be
> > > both. You'll need to modify the example to decrypt the file first.
> >
> > According to a developer who works on the app that generated the PGP
> > message, it was both encrypted and signed. It was signed with a
public
> > key file.
> >
> > If I try to decrypt the file, it fails with the error:
> >
> > "encrypted message contains a signed message - not literal data."
> >
----------
Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.

THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.


Reply | Threaded
Open this post in threaded view
|

RE: [SPAM_HC:] - RE: Getting error while decrypting a signedPGPmessage file. - Email found in subject

Martin van Wijk
This helped me a while back (thanks Daniele)
http://www.bouncycastle.org/devmailarchive/msg08137.html

-----Original Message-----
From: Younie, Bradford [mailto:[hidden email]]
Sent: vrijdag 7 december 2007 16:41
To: David Hook
Cc: [hidden email]
Subject: [SPAM_HC:] - RE: [dev-crypto] Getting error while decrypting a
signedPGPmessage file. - Email found in subject


>
> This would confirm what the developer has told you. I assume you've
run
> the KeyBasedFileProcessor - if you want to use it as the base you'll
> need to modify it to process the signed message.

Thanks!

Now I just need to figure out how to process the signature while
decrypting. The samples are not very helpful in that regard, and I can't
find any docs that help with that either.

Brad

>
> Regards,
>
> David
>
> On Thu, 2007-12-06 at 15:36 -0500, Younie, Bradford wrote:
> > > It sounds like the file is encrypted, not signed, although it
might be
> > > both. You'll need to modify the example to decrypt the file first.
> >
> > According to a developer who works on the app that generated the PGP

> > message, it was both encrypted and signed. It was signed with a
public
> > key file.
> >
> > If I try to decrypt the file, it fails with the error:
> >
> > "encrypted message contains a signed message - not literal data."
> >
----------
Learn more about Chase Paymentech Solutions,LLC payment processing
services at www.chasepaymentech.com.

THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments
are proprietary and confidential information intended only for the use
of the recipient(s) named above.  If you are not the intended recipient,
you may not print, distribute, or copy this message or any attachments.
If you have received this communication in error, please notify the
sender by return e-mail and delete this message and any attachments from
your computer.



Reply | Threaded
Open this post in threaded view
|

RE: Getting error while decrypting a signedPGPmessage file.

David Hook-4
In reply to this post by Younie, Bradford

The stream returned by the decryptor just contains a standard signed
message so it is the same process as used in the SignedFileProcessor
example, although in this case you would ignore the code that deals with
compression as the data hasn't been compressed.

Regards,

David

On Fri, 2007-12-07 at 10:41 -0500, Younie, Bradford wrote:

> >
> > This would confirm what the developer has told you. I assume you've
> run
> > the KeyBasedFileProcessor - if you want to use it as the base you'll
> > need to modify it to process the signed message.
>
> Thanks!
>
> Now I just need to figure out how to process the signature while
> decrypting. The samples are not very helpful in that regard, and I can't
> find any docs that help with that either.
>
> Brad
>
> >
> > Regards,
> >
> > David
> >
> > On Thu, 2007-12-06 at 15:36 -0500, Younie, Bradford wrote:
> > > > It sounds like the file is encrypted, not signed, although it
> might be
> > > > both. You'll need to modify the example to decrypt the file first.
> > >
> > > According to a developer who works on the app that generated the PGP
> > > message, it was both encrypted and signed. It was signed with a
> public
> > > key file.
> > >
> > > If I try to decrypt the file, it fails with the error:
> > >
> > > "encrypted message contains a signed message - not literal data."
> > >
> ----------
> Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.
>
> THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.
>
>


Reply | Threaded
Open this post in threaded view
|

RE: Getting error while decrypting a signedPGPmessagefile.

Younie, Bradford
>
> The stream returned by the decryptor just contains a standard signed
> message so it is the same process as used in the SignedFileProcessor
> example, although in this case you would ignore the code that deals
with
> compression as the data hasn't been compressed.

So, you first decrypt the message the normal way to get a normal signed
message, and then you process the signed message?

Brad


>
> Regards,
>
> David
>
> On Fri, 2007-12-07 at 10:41 -0500, Younie, Bradford wrote:
> > >
> > > This would confirm what the developer has told you. I assume
you've
> > run
> > > the KeyBasedFileProcessor - if you want to use it as the base
you'll
> > > need to modify it to process the signed message.
> >
> > Thanks!
> >
> > Now I just need to figure out how to process the signature while
> > decrypting. The samples are not very helpful in that regard, and I
can't

> > find any docs that help with that either.
> >
> > Brad
> >
> > >
> > > Regards,
> > >
> > > David
> > >
> > > On Thu, 2007-12-06 at 15:36 -0500, Younie, Bradford wrote:
> > > > > It sounds like the file is encrypted, not signed, although it
> > might be
> > > > > both. You'll need to modify the example to decrypt the file
first.
> > > >
> > > > According to a developer who works on the app that generated the
PGP
> > > > message, it was both encrypted and signed. It was signed with a
> > public
> > > > key file.
> > > >
> > > > If I try to decrypt the file, it fails with the error:
> > > >
> > > > "encrypted message contains a signed message - not literal
data."
> > > >
> > ----------
> > Learn more about Chase Paymentech Solutions,LLC payment processing
> services at www.chasepaymentech.com.
> >
> > THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any
attachments
> are proprietary and confidential information intended only for the use
of
> the recipient(s) named above.  If you are not the intended recipient,
you
> may not print, distribute, or copy this message or any attachments.
If
> you have received this communication in error, please notify the
sender by
> return e-mail and delete this message and any attachments from your
> computer.
> >
> >
----------
Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.

THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.


Reply | Threaded
Open this post in threaded view
|

RE: Getting error while decrypting a signedPGPmessagefile.

David Hook-4

Yep - just remember that as it's a streaming based API the operations
are nested (so you can process the signed message in situ, rather than
having to read all the encrypted stream first). This becomes more
important if your generating messages as well.

Regards,

David
On Mon, 2007-12-10 at 08:44 -0500, Younie, Bradford wrote:

> >
> > The stream returned by the decryptor just contains a standard signed
> > message so it is the same process as used in the SignedFileProcessor
> > example, although in this case you would ignore the code that deals
> with
> > compression as the data hasn't been compressed.
>
> So, you first decrypt the message the normal way to get a normal signed
> message, and then you process the signed message?
>
> Brad
>
>
> >
> > Regards,
> >
> > David
> >
> > On Fri, 2007-12-07 at 10:41 -0500, Younie, Bradford wrote:
> > > >
> > > > This would confirm what the developer has told you. I assume
> you've
> > > run
> > > > the KeyBasedFileProcessor - if you want to use it as the base
> you'll
> > > > need to modify it to process the signed message.
> > >
> > > Thanks!
> > >
> > > Now I just need to figure out how to process the signature while
> > > decrypting. The samples are not very helpful in that regard, and I
> can't
> > > find any docs that help with that either.
> > >
> > > Brad
> > >
> > > >
> > > > Regards,
> > > >
> > > > David
> > > >
> > > > On Thu, 2007-12-06 at 15:36 -0500, Younie, Bradford wrote:
> > > > > > It sounds like the file is encrypted, not signed, although it
> > > might be
> > > > > > both. You'll need to modify the example to decrypt the file
> first.
> > > > >
> > > > > According to a developer who works on the app that generated the
> PGP
> > > > > message, it was both encrypted and signed. It was signed with a
> > > public
> > > > > key file.
> > > > >
> > > > > If I try to decrypt the file, it fails with the error:
> > > > >
> > > > > "encrypted message contains a signed message - not literal
> data."
> > > > >
> > > ----------
> > > Learn more about Chase Paymentech Solutions,LLC payment processing
> > services at www.chasepaymentech.com.
> > >
> > > THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any
> attachments
> > are proprietary and confidential information intended only for the use
> of
> > the recipient(s) named above.  If you are not the intended recipient,
> you
> > may not print, distribute, or copy this message or any attachments.
> If
> > you have received this communication in error, please notify the
> sender by
> > return e-mail and delete this message and any attachments from your
> > computer.
> > >
> > >
> ----------
> Learn more about Chase Paymentech Solutions,LLC payment processing services at www.chasepaymentech.com.
>
> THIS MESSAGE IS CONFIDENTIAL.  This e-mail message and any attachments are proprietary and confidential information intended only for the use of the recipient(s) named above.  If you are not the intended recipient, you may not print, distribute, or copy this message or any attachments.  If you have received this communication in error, please notify the sender by return e-mail and delete this message and any attachments from your computer.
>
>