NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

PKCS1Encoding.processBlock(Unknown Source)

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
i_p_addr



Joined: 19 Feb 2010
Posts: 2

PostPosted: Fri Feb 26, 2010 8:02 am    Post subject: PKCS1Encoding.processBlock(Unknown Source) Reply with quote

hi any one,

i got this error while running app:

org.bouncycastle.crypto.InvalidCipherTextException: unknown block type
at org.bouncycastle.crypto.encodings.PKCS1Encoding.decodeBlock(Unknown Source)
at org.bouncycastle.crypto.encodings.PKCS1Encoding.processBlock(Unknown Source)
at SecureGprs.RSADecrypt(SecureGprs.java:267)

the source like this :

public byte [] RSADecrypt (byte [] toDecrypt,RSAPrivateCrtKeyParameters _RSAPrivateKey) throws Exception
{
if (_RSAPrivateKey == null)
{
throw new Exception("Please generate RSA keys first in order to work");
}
AsymmetricBlockCipher theEngine = new RSAEngine();
theEngine = new PKCS1Encoding(theEngine);
theEngine.init(false, _RSAPrivateKey);
System.out.println("Decrypting length:"+toDecrypt.length);
// the statement below give an error above
return theEngine.processBlock(toDecrypt, 0, toDecrypt.length);
}

could any one help me?
thank
Back to top
malathy29



Joined: 26 Apr 2012
Posts: 1

PostPosted: Thu Apr 26, 2012 8:45 am    Post subject: PKCS1Encoding.processBlock(Unknown Source) Reply with quote

hi any one,

i got this error while running app:

org.bouncycastle.crypto.InvalidCipherTextException: unknown block type
at org.bouncycastle.crypto.encodings.PKCS1Encoding.decodeBlock(Unknown Source)
at org.bouncycastle.crypto.encodings.PKCS1Encoding.processBlock(Unknown Source)
at SecureGprs.RSADecrypt(SecureGprs.java:267)

the source like this :

public byte [] RSADecrypt (byte [] toDecrypt,RSAPrivateCrtKeyParameters _RSAPrivateKey) throws Exception
{
if (_RSAPrivateKey == null)
{
throw new Exception("Please generate RSA keys first in order to work");
}
AsymmetricBlockCipher theEngine = new RSAEngine();
theEngine = new PKCS1Encoding(theEngine);
theEngine.init(false, _RSAPrivateKey);
System.out.println("Decrypting length:"+toDecrypt.length);
// the statement below give an error above
return theEngine.processBlock(toDecrypt, 0, toDecrypt.length);
}

could any one help me?
Thanks in advance..
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo