Skip to main content
Participant
Nov 11, 2020 10:33 AM UTC
Question

Could you please help on create Screct using cryto.hmac method in coldfusion

Please find below snippet , we have to convert to Coldfusion tags ,any one help me.

 

<script type="text/javascript">
var epochTime = "1605070736";
var Digest = computeDigest();
function computeDigest()
{
var hmac = Crypto.HMAC(Crypto.SHA256, epochTime, "1308302020102915214099263166", { asBytes: true });
var base64String = Crypto.util.bytesToBase64(Crypto.HMAC(Crypto.SHA256, epochTime, "AKI1308302020102915214099263166", { asBytes: true }));
return base64String;
}
</script>

    This topic is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    BKBK
    Community Expert
    Community Expert
    Nov 12, 2020 8:28 AM UTC

    ColdFusion code runs on the server. Your code is Javascript. Hence it is meant to run on the browser.

     

    If you wish to run Crypto on ColdFusion then you should:

     

    1) Import the Crypto Java library or classes into ColdFusion;

    2) Also import any other third-party libraries that Crypto depends on.

    Translate