tags:

views:

361

answers:

3

I was wondering if there would be a way to get a HMAC-SHA1 signature in scala without having to compile a java class with the code everyone use in java. Any ideas?

A: 

I'm a little unclear on what you mean here: Do you have a document you are trying to get a HMAC for? Or are you talking about code signing? If it's not some sort of code signing, then you can follow the steps in the link you provided, but simply call the functions from your Scala code... it takes Strings as data, and Scala Strings are fully compatible (the same as) Java strings.

mcherm
+1  A: 

If you're looking to avoid dealing with having Java source files in your Scala project, just translate the Java code into Scala. It should be a very straightforward task.

Erik Engbrecht
+1  A: 

Not sure what are you trying to do, but here http://technically.us/code/x/oauth-here-she-comes you can find an example of how to do HMAC-SHA1 (for OAuth) in Scala

GClaramunt