NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
i_p_addr
Joined: 19 Feb 2010 Posts: 2
|
Posted: Fri Feb 26, 2010 8:02 am Post subject: PKCS1Encoding.processBlock(Unknown Source) |
|
|
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
|
Posted: Thu Apr 26, 2012 8:45 am Post subject: PKCS1Encoding.processBlock(Unknown Source) |
|
|
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 |
|
 |
|
|
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
|
|