Skip to Content
avatar image
Former Member

Encrypt data to RSA SHA-256 algorithm

Hi all,

for my current project i need to create a JWT (BASIS 7.02, no OAuth2 function available), so i have to compute the signature using SHA256withRSA (also known as RSASSA-PKCS1-V1_5-SIGN with the SHA-256 hash function).

Please, how can i do that ?

Please note that the CommonCryptoLib v8.5 is installed.

Thanks for any help,

Eric

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jul 29, 2017 at 09:10 AM

    Hi Steven,

    yes sure, i need a JWT because i want to connect to Google DFP API and for this i need to setup up an OAuth2 authentication that is not native in my SAP system. So first step is to create a JWT.

    For more information you can watch here : Using OAuth 2.0 for Server to Server Applications

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 29, 2017 at 12:29 AM

    What have you tried? Are you sure it has to be JWT? If you look through the archives there are several detailed messages on how to step through this, including dealing with some documented bugs.

    https://archive.sap.com/discussions/thread/3729755

    https://blogs.sap.com/2015/09/08/implementing-sha2-sha256-type-certificate-in-sap-netweaver-70-for-java/

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 29, 2017 at 04:47 PM

    As an approach: take a look into the /UI2/ packages. They had JSON serialization before it got added to BASIS so maybe there's some OAUTH code too.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Fabian,

      sorry but i don't have this package. SAP_BASIS is realease 702 SP-Level 0016, old version :(

  • avatar image
    Former Member
    Aug 18, 2017 at 09:59 AM

    I think that method CALCULATE_HMAC_FOR_CHAR from class CL_ABAP_HMAC must be to use for compute, i can test it with algorithm 'SHA256' but with RSA SHA256, how can i do ?

    Need help, please.

    Add comment
    10|10000 characters needed characters exceeded