Oracle Weblogic Server (MOSC)

MOSC Banner

How Using function CryptoJS.HmacSHA256 in Oracle Service Bus Javascript

edited November 2021 in Oracle Weblogic Server (MOSC) 2 commentsQuestion

Hi Guys,

We need to encrypt some JSon payload using CryptoJS.HmacSHA256 .

How to implement that encrypt inside OSB javascript


already try using this code, but getting error "OSB JavaScript action failed: ReferenceError: "CryptoJS" is not defined"

var hash = CryptoJS.HmacSHA256(process.body, process.ServerKey)

var signatureId = CryptoJS.enc.Base64.stringify(hash).replace(/\n+$/, '')

process.signatureId = signatureId;

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center