Hi Paul
You mention
I also suspect I have to make some translation to/from ASCII/EBCDIC
There could be some translation from EBCDIC, but how sure are you that it is in fact to ASCII
Some of the translation we have had to do is to CCSID 819
Alan Shore
E-mail : ASHORE@xxxxxxxx
Phone [O] : (631) 200-5019
Phone [C] : (631) 880-8640
'If you're going through hell, keep going.'
Winston Churchill
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Paul Roy
Sent: Thursday, September 20, 2018 11:46 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: [EXTERNAL] WS security password digest
Hi
I am trying to call a webservice that requires ws security
the password needs to be sent as a password digest ... so i am trying to do this in RPGLE from google, I found that a password digest is created as digest = base64_encode( sha1 ( nonce + TimeStampCreated + pwd ) )
I also suspect I have to make some translation to/from ASCII/EBCDIC
I am only converting the initial string to ASCII then calculate the hash, encode in base 64 then use the value in the soap payload and post using LIBHTTP...
here is some extract of my code
todig = %trim(snonce)+%trim(fmttmp(tmpCreate))+%trim(pwd) ; //convert to ASCII using QDCXLATE
translate(%len(todig) : todig : 'QTCPASC'); p_recv = %addr(digest); p_src = %addr(todig); // calculate sha1 using _CIPHER cipher( p_recv: sha_controls : p_src); // translate to base 64 using BASE64R4 (LIBHTTP SK) base64_encode(%addr(digest ): digestLen :%addr(digest64) : d64Len) ;
but until now I have had no success.... so posting here to receive some hint...
any help welcome
thank you
Paul
..
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD
As an Amazon Associate we earn from qualifying purchases.