× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi Greg,

Thanks for the suggestions. Yes i changed the data holding field ccsid as
UTF-8 and it worked.

Thanks for helping me out. Really appreciate your help.

Regards,
Surender K

On Tue, Dec 8, 2020 at 2:26 AM Greg Wilburn <
gwilburn@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

Suren K,

I had a lot of help doing this with a Web Service API... the trick was to
convert the data to ASCII before calling Qc3CalculateHMAC.

I used HTTP_Xlate() to do so.

HTH,
Greg

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
Suren K
Sent: Monday, December 07, 2020 4:15 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Reg: HMAC Calculation

Hi All,

How are you?

I am facing the following issue with Qc3CalculateHMAC API.

Currently i am trying to do the JWT token validation in iSeries, to do that
i am planning to generate the HMAC using the header, payload and signed
secret key.

The logic i am using is Passing the input data as
Header(Base64encoded).Payload(Base64encoded).

1) For Base64 decoding - SYSTOOLS.BASE64ENCODE function is used.
2) Algorithm - SHA256.
3) I am passing the Secret Key as plain character text using "KEYD0200"

But the HMAC generated by the API is not correct. Am i doing anything
wrong?

Qc3CalculateHMAC(
%addr(headerPayload) :
%len(%trimr(headerPayload)) :
'DATA0100' :
algd0500 :
'ALGD0500' :
keyparam :
'KEYD0200' :
'0' : // crypto
*blank : // crypto dev
hash :
QUSEC);

Could anyone please help me to figure out the issue?

Regards,
Suren K
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.