Skip to Content

RSA encryption in ABAP: How to?

I need to execute an RSA encryption in ABAP (more specifically: I need to do a JSON Web Signature - JWS cf https://tools.ietf.org/html/rfc7515 - with RSA and SHA256; for SHA256 I can use cl_abap_hmac, but for RSA?).

Has anyone an idea how to achieve this?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • May 02, 2017 at 08:05 PM

    I'm not an expert on this (actually have no clue TBH) but this question piqued my interest and I did some digging around.

    Not sure if anything is available in EHP7 and higher but in EHP6 a quick search in the security packages did not find anything. It might be important to highlight the difference between a hash function (such as SHA...) and encryption/decryption such as RSA. This might be why you've found one but not the other in SAP. You can see in the description that CL_ABAP_HMAC is "copyrighted by RSA..." and I'm just guessing SAP got this one for their own needs (nice bonus for the customers) but there was no need for RSA encryption in ABAP.

    As far as "how to achieve" - you can find some code examples online that are using some special Java libraries, so I'm guessing since there is no such functionality directly in ABAP you'll just have to run some external program to achieve that part. There are several ways to do so (another web service? LOL :) ), I'm sure you can figure out that part.

    There might be some third-party solutions for this or other non-obvious ways. If you don't get any better replies here - try Stackoverflow. I believe the cutting edge crowd might have moved over there from SCN lately.

    Add comment
    10|10000 characters needed characters exceeded