<link>http://www.ncryptoki.com/forum.aspx</link> <description /> <docs>http://www.rssboard.org/rss-specification</docs> <generator>mojoPortal Forum module</generator> <item> <title>Re: Error 113 Yes. In 1.6.1.1 we changed the way the parameters are marshalled and now we found a little bug in this method.

We just uploaded the new version 1.6.1.2 that solves such a bug.

Download it, try and let's know.

 

 

]]>
http://www.ncryptoki.com/Forums/Thread.aspx?pageid=9&t=131~-1#post552 Jason16v http://www.ncryptoki.com/Forums/Thread.aspx?pageid= Tue, 26 Nov 2013 15:16:21 GMT Re: Error 113 Ugo,

 

When I run what Jason is trying to do against an older version of NCryptoki (1.5.4.2), it works.  Run against the latest version (1.6.1.1), it does not.  Same exact code:

 

Mechanism m = new Mechanism((int)(Mechanism.CKM_AES_CBC_PAD), new byte[16]);

int result = session.EncryptInit(mech, secretKey); // With a previously found and loaded SecretKey.

 

This gives no error when run against the 1.5.4.2 version of NCryptoki, but results in the 0x00000071 (decimal 113) error code when run against the 1.6.1.1 version.  In that latter case, the error is returned by the underlying Cryptoki implementation (cknfast.dll for an nShield HSM).

 

Did something change between those two versions in the way you process parameters for mechanisms? 

 

Thanks,

S

ander

]]>
http://www.ncryptoki.com/Forums/Thread.aspx?pageid=9&t=131~-1#post551 Jason16v http://www.ncryptoki.com/Forums/Thread.aspx?pageid= Tue, 26 Nov 2013 06:05:12 GMT
Re: Error 113 Hi, 

error 113 means CKR_MECHANISM_PARAM_INVALID

i.e. the param passed is invalid.

 

BTW. the list of all errors is here: http://wiki.ncryptoki.com/How-NCryptoki-manages-PKCS-11-errors.ashx

 

]]>
http://www.ncryptoki.com/Forums/Thread.aspx?pageid=9&t=131~-1#post550 Jason16v http://www.ncryptoki.com/Forums/Thread.aspx?pageid= Mon, 25 Nov 2013 09:06:16 GMT
Error 113 Hello,

 

I'm trying to port an encryption call that I'm able to make successfully using the PKCS11 wrapper, but is not working right using nCryptoki.

I'm getting an error 113 on the EncryptInit method. Any idea why this is happening? I checked the available mechanisms coming from the HSM and CKM_AES_CBC_PAD is listed.

 

The code looks like this...

 

stringFromCRM = "555-55-5555";
byte[] valueFromCRM = UTF8Encoding.UTF8.GetBytes(stringFromCRM);

byte[] parameter = new byte[16];
Mechanism m = new Mechanism(Mechanism.CKM_AES_CBC_PAD, parameter);


int retVal = stateObject.session.EncryptInit(m, stateObject.secretKey);
if (retVal != 0)
{
Console.Write("Error initializing ENcryption");
//throw new InvalidOperationException("Error Initializing Encryption");
return stateObject;
}
else
{
byte[] ciphertext = stateObject.session.Encrypt(valueFromCRM);
string encryptedvalue = Convert.ToBase64String(ciphertext);

ec.Entities[index]["fi_taxid"] = encryptedvalue;
Console.WriteLine("Set TaxId = " + encryptedvalue + " for ContactId " + ec.Entities[index]["fi_id"]);
stateObject.orgService.Update(ec.Entities[index]);
return stateObject;
}
 

]]>
http://www.ncryptoki.com/Forums/Thread.aspx?pageid=9&t=131~-1#post549 Jason16v http://www.ncryptoki.com/Forums/Thread.aspx?pageid= Tue, 19 Nov 2013 08:36:43 GMT