Velocity Java Import Capabilities | Community
Skip to main content
michaelstancil
Level 3
March 29, 2022
Solved

Velocity Java Import Capabilities

  • March 29, 2022
  • 2 replies
  • 2717 views

Hi all,

 

I'm trying to run a Java URL signer within Velocity for to handle a signature with on the Google Maps Static API, within a velocity token. In searching the forums I know that Java capabilities have been/are being deprecated in Velocity, but in looking at the Base64 module,  I'm curious if it's possible to merge the two together with the libraries listed on the Java URL signer, or if I have to go about it another way. 

 

My thought was to add the Base64 module, #set the static strings, remove the error handling and print/input sections, as Marketo has no problem telling me the code is broken, and there's no need to input since the data would be within the script. That leaves the question of the other imports, specifically the HMAC-SHA1.

Before I start down this path further, I figured I would ask, is this even remotely possible?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

It’s not possible (anymore) to load any other classes in Marketo’s Velocity besides the standard Tools (which don’t include Java crypto stuff).

 

I was able to do that Base64 thing without using any other special classes, but the next level of actual crypto wouldn’t be possible — don’t get me wrong, I’ve thought about taking off time to do SHA-256 in Velocity, but that wouldn’t be a very relaxing month off. 🙂

 

I’d use FlowBoost if I were you. (Knowing you already use it.)

 

 

2 replies

Jo_Pitts1
Community Advisor
Community Advisor
March 30, 2022

@michaelstancil , I'll be honest - I couldn't work out what the use case is, or what you're trying to achieve?

 

 

michaelstancil
Level 3
March 30, 2022

Our API configuration requires a signature, and given the URL the signature could be applied to is dynamic, I need to create that signature each time I call the API, as every request is unique based on user parameters.

SanfordWhiteman
SanfordWhitemanAccepted solution
Level 10
March 30, 2022

It’s not possible (anymore) to load any other classes in Marketo’s Velocity besides the standard Tools (which don’t include Java crypto stuff).

 

I was able to do that Base64 thing without using any other special classes, but the next level of actual crypto wouldn’t be possible — don’t get me wrong, I’ve thought about taking off time to do SHA-256 in Velocity, but that wouldn’t be a very relaxing month off. 🙂

 

I’d use FlowBoost if I were you. (Knowing you already use it.)

 

 

SanfordWhiteman
Level 10
March 30, 2022

I’d use FlowBoost if I were you. (Knowing you already use it.)


(FBUtil.crypto is a copy of crypto-js.)

michaelstancil
Level 3
March 30, 2022

I was curious if this was FlowBoost-able, just wasn't sure with the cross-language component - I'll start digging!