IBM Crypto Education Community

  • 1.  Generating Operational RSA Public Key

    Posted Fri February 09, 2018 01:17 PM

    Hi Group,

     

    I have an application that needs to verify a digital signature using an RSA public key. The portion of the application that generates the signature provides the modulus (N) and public exponent (E) so I'm trying to use PKA Key Token Build (CSNDPKB) with the RSA-PUBL option to build an operational public key token that can be used in Digital Signature Verify (CSNDDSV). I'm a little confused by the ICSF manual as to which values need to be concatenated to build the key structure. Here's a REXX snippet of the code that build key structure.....however with a 512 byte modulus the structure length is 521 bytes which exceeds the limit for RSA-PUBL option. Any thoughts on how to build the key structure with a 512 byte modulus?

    Keystruct      =  d2c(mod_len_in_bits,2), 
                   || d2c(mod_len_in_bytes,2),
                   || d2c(exp_len_in_bytes,2),
                   || '0000'x,                
                   || decoded_modulus,        
                   || decoded_exponent        

     

    Thanks,

    Larry

    Larry Shaw


  • 2.  Re: Generating Operational RSA Public Key

    Posted Mon February 12, 2018 04:50 PM

    Hi Larry,

    Apparently I missed the notification for this question. I'll post a general sample showing the kvs and share a link here for others.

    Eysha Shirrine


  • 3.  Re: Generating Operational RSA Public Key

    Posted Tue February 13, 2018 01:12 PM

    Here's a link to a Rexx sample showing how to import a 4096-bit RSA public key... https://www.ibm.com/developerworks/community/blogs/79c1eec4-00c4-48ef-ae2b-01bd8448dd6c/entry/Rexx_Sample_Import_a_4096_bit_RSA_Public_Key

    Eysha Shirrine