I would recommend you continue using the private Java runtime provided by your SAS installation. This is because they are looking for the base64 encoding of the byte array, you are creating the base64 encoding of the hexadecimal representation of the byte Hmac-SHA1 digest. %let key = kd94hf93k423kf44&pfkkdhi9sl3r4s00; %let message = GET&http%3A%2F%2Fphotos.example.net%2Fphotos&file%3Dvacation.jpg%26oauth_consumer_key%3Ddpf43f3p2l4k3l03%26oauth_nonce%3Dkllo9940pd9333jh%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1191242096%26oauth_token%3Dnnch734d00sl2jdk%26oauth_version%3D1.0%26size%3Doriginal; proc groovy; add sasjar="commons_codec" version="1.7.0.0_SAS_20121211183158";*version may differ based on your installation. Check your SAS Versioned Jar Repository; submit "&key." "&message."; import javax.crypto.Mac import javax.crypto.spec.SecretKeySpec import org.apache.commons.codec.binary.Base64 def base64hmacsha1(key, message) { mac = Mac.getInstance("HmacSHA1") mac.init(new SecretKeySpec(key.getBytes(), "HmacSHA1")) sha1_bytes = mac.doFinal(message.getBytes()) base64 = new Base64() return new String(base64.encode(sha1_bytes)) } exports.base64hmacsha1 = base64hmacsha1(args[0], args[1]) endsubmit; quit; %put &base64hmacsha1.; /*tR3+Ty81lMeYAr/Fid0kMTYa/WM=*/ Message was edited by: FriedEgg - typo corrected in RED, also added reference for common-codec sasjar
... View more