[prev in list] [next in list] [prev in thread] [next in thread] 

List:       bouncycastle-crypto-dev
Subject:    Re: [dev-crypto] Re: Problem in decrypting the
From:       David Hook <dgh () lockboxlabs ! com>
Date:       2011-06-24 15:28:44
Message-ID: 1308929324.2164.15.camel () konkolo
[Download RAW message or body]


The object is implicitly tagged.

It should read:

DERIA5String.getInstance(o, false)

not 

DERIA5String.getInstance(o, true)...

Bit surprised this is still a problem in the beta. I will investigate.

Regards,

David

On Fri, 2011-06-24 at 05:02 -0700, chandru wrote:
> Hi,
> 
> Thanks for your reply.
> 
> I tried placing some debug statements and printStackTrace in the library
> (bcmail-jdk15-146.jar)
> 
> Please find the trace below.
> 
> java.lang.IllegalArgumentException: illegal object in getInstance:
> org.bouncycastle.asn1.DEROctetString
> at
> org.bouncycastle.asn1.DERIA5String.getInstance(DERIA5String.java:27)
> at
> org.bouncycastle.asn1.DERIA5String.getInstance(DERIA5String.java:47)
> 
> It seems the problem starts when trying to create a instance of
> DERIA5String.
> 
> I added the following lines in the SignedMailValidator in the method
> getEmailAddresses(X509Certificate cert)
> boolean fff = o.getObject() instanceof DERIA5String;This line returns false
> boolean fff1 = o.getObject() instanceof ASN1Object; This line returns true
> .
> .
> .
> DERIA5String ooo= new DERIA5String(((ASN1OctetString)dero).getOctets());
> 	log.debug("Der object "+ooo.getString());
> String email = DERIA5String.getInstance(o, true)
> .getString().toLowerCase();//Exception raises
> here
> 
> 
> When the object enters the below method in DERIA5String class we get the
> IllegalArgumentException.
> 
> public static DERIA5String getInstance(
> Object  obj)
> {
> if (obj == null || obj instanceof DERIA5String) // since the obj is
> an instance of ASN1Object it always return false.
> {
> return (DERIA5String)obj;
> }
> 
> throw new IllegalArgumentException("illegal object in getInstance: "
> + obj.getClass().getName());
> }
> 
> I also tried with the beta jars still the problem persists.
> 
> Could you please help?
> 
> Regards,
> Chandru.M
> 
> --
> View this message in context: \
> http://bouncy-castle.1462172.n4.nabble.com/Problem-in-decrypting-the-application-x-pkcs7-mime-mail-tp3602582p3622340.html
>  Sent from the Bouncy Castle - Dev mailing list archive at Nabble.com.
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic