6/7/2021 11:11:38 AM
Total Posts 1



I tried to sign with CKM_RSA_PKCS_PSS with this code : 


        DEFINE VARIABLE wMecanism     AS Cryptware.NCryptoki.Mechanism.
        DEFINE VARIABLE wParameter    AS Cryptware.NCryptoki.Parameters.RSA_PKCS_PSS_PARAMS.
        wMecanism = NEW Cryptware.NCryptoki.Mechanism().
        wParameter = NEW Cryptware.NCryptoki.Parameters.RSA_PKCS_PSS_PARAMS().

/******************* CKM_RSA_PKCS_PSS ********************/
            wParameter:HashAlg = Cryptware.NCryptoki.Mechanism:CKM_SHA256
            wParameter:Mgf = Cryptware.NCryptoki.Mechanism:CKG_MGF1_SHA256
            wParameter:Len = 32 . <- not sure about this value
        wMecanism:set(Cryptware.NCryptoki.Mechanism:CKM_RSA_PKCS_PSS, wParameter).

/**^^^^^^^^^^^^^^ CKM_RSA_PKCS_PSS ^^^^^^^^^^^^^^^^*/

IIt is not working, but when i tried this underneath, it works. 


/******************* CKM_SHA256_RSA_PKCS ********************/
        wMecanism:set(Cryptware.NCryptoki.Mechanism:CKM_SHA256_RSA_PKCS , ?).

/**^^^^^^^^^^^^^^ CKM_SHA256_RSA_PKCS ^^^^^^^^^^^^^^^^*/

Then we make the SignInit, Sign, VerifyInit and vrify wiath our key pair.

The key pair used is created with our HSM with p11tool.exe with "--generate-rsa" and "--bits 4096".

Can you give us some hints to make CKM_RSA_PKCS_PSS works ?

What did we miss ?