[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [iaik-ssl] InvalidAlgorithmParameterException: IV must be the same length ...



I also got another type of exception on a different run - for a previously working Client key ! :
java.security.InvalidKeyException: No RSA Private Key: iaik.asn1.CodingException:
ASN.1 creation error:Length: Too large ASN.1 object: 69

There may be a common connection between the two problems perhaps.
Any clues ?

Sundar

Sundar Krishnan wrote:

Just when I thought I am near the end of the SSL part in my project, I encountered this new exception.
I am using :
iaik.utils.SSLeayPrivateKey pk1 = new SSLeayPrivateKey ( strClientCertKeyDir + "/" + strClientPrKey ) ;
----
pk1.decrypt(strPassPhrToDecrClientPrKey) ;
----

 private_key of Client1cert   from Client6key.pem was encrypted.
 Decrypting it ...

java.security.InvalidKeyException: java.security.InvalidAlgorithmParameterException: IV must be the same length as block size of the underlying cipher.
        at iaik.utils.SSLeayPrivateKey.decrypt(Compiled Code)
        at cshop.security.INGTestClientTrustDecider.<init>(Compiled Code)
        at cshop.security.SSLTestClient.main(Compiled Code)

Could someone tell me what could be the fault in this. Which parameter is faulty here, and how do I correct ?
I have used the same SSLeay Scripts to generate these Certificates and Keys (the 6th set) as I have done in the past.
However, this last set gives me problems while decrypting the Client side private key.

Regards

Sundar Krishnan

PS : A successful decryption (for the previous sets) prints something like the foll :

Sun Aug 15 10:04:33 GMT+05:30 1999 :
 private_key of Client1cert prKeyOfClientCert after decrypting = pk1.getPrivateKey() =
modulus: c60a19cf5ce16d133ba421c9aec1347fd74bc79a733b3707182093f024d368609597dcab3dfb942e5ad5671078a0162925381acaf51271a1
d8b8dcc861348197
public exponent: 10001
private exponent: 1023b098caac0074a9cea586473cada7a187267c3ad9df912f71303d48f305b57ca4178ab282c64c2f696b7aaf8ba2b42a5fc59
eb7720770365c8bc39265bd39
primeP: e7f98e6eb07ff2f842f2ef4184d77aca6cd55aa66c915f5b89758ce1c969c713
primeQ: da8ccd4fddcaf702888aa9d7ea09c800de1005924ad43cc7287348fe371997ed
primeExponentP: b9a4363f10d2a43fd75c10ea8f03de8966856b9129eb40b3c192a816fd17c0af
primeExponentQ: 63758a861b389ffafe2aa4aac72e965f96af91e986b659c684e91a41decf7ded
crt_coefficient: 94224b8042dba1114711550203ffe18def709f2b45a91ef5e035cecfc8ee0d4a

 Client Certs and Private Key retrieved successfully.