RS256 / SHA256withRSA

Hi all

I am attempting to populate a Google sheet from form submissions (on Mura
CMS on Lucee 4.5.2.018 / Apache Tomcat 7.0.37). To do this I need to create
a JWT and to do that I need to encrypt various bits of data using the
SHA256withRSA algorithm. When I attempt this, however, I get this error:

Algorithm SHA256withRSA not available
Code: 0
Type: java.security.NoSuchAlgorithmException

Algorithm SHA256withRSA not available
at javax.crypto.Mac.getInstance(Mac.java:176):176


I assume I can take this at face value and the algorithm is not available
in Lucee? Is there a list somewhere of the algorithms that are available?
Is there a plan to implement this algorithm? And, for now, what is the best
way of achieving the encryption I need?

Many thanks.–

The contents of this message are intended for the addressee only. The views
expressed do not necessarily represent those of George Watson’s College and
the contents do not form a legal binding contract.

George Watson’s College is an Edinburgh Merchant Company Education Board
School (Scottish Charity No. SC009747).

You’ll need to tap into the Java libraries, I have this function for
signing bits on my system…

http://pastebin.com/ejMiAzj8On 29 June 2016 at 11:17, Stephen Gray <@Stephen_Gray> wrote:

Hi all

I am attempting to populate a Google sheet from form submissions (on Mura
CMS on Lucee 4.5.2.018 / Apache Tomcat 7.0.37). To do this I need to create
a JWT and to do that I need to encrypt various bits of data using the
SHA256withRSA algorithm. When I attempt this, however, I get this error:

Algorithm SHA256withRSA not available
Code: 0
Type: java.security.NoSuchAlgorithmException

Algorithm SHA256withRSA not available
at javax.crypto.Mac.getInstance(Mac.java:176):176


I assume I can take this at face value and the algorithm is not available
in Lucee? Is there a list somewhere of the algorithms that are available?
Is there a plan to implement this algorithm? And, for now, what is the best
way of achieving the encryption I need?

Many thanks.


The contents of this message are intended for the addressee only. The
views expressed do not necessarily represent those of George Watson’s
College and the contents do not form a legal binding contract.

George Watson’s College is an Edinburgh Merchant Company Education Board
School (Scottish Charity No. SC009747).


Win a ticket to dev.objective from Lucee via Twitter, see
http://bit.ly/1UbTMWj for details, good luck and see you there…

You received this message because you are subscribed to the Google Groups
“Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/lucee/91b92a2f-9733-4abd-8bf2-f709fb7b5856%40googlegroups.com
https://groups.google.com/d/msgid/lucee/91b92a2f-9733-4abd-8bf2-f709fb7b5856%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

Oh, and the list of algorithms available in Java is
here: https://docs.oracle.com/javase/8/docs/technotes/guides/security/StandardNames.html

  • most of it is already implemented, some is not.

After looking at both BC docs, Java docs and what Jedihomer provided, his
is probably the easier solution at the end of the day since it’s already
wrapped in a function for ya :slight_smile: Nice work BTW Jedihomer.

– Denny

You can also do this with the bouncy castle JCE provider,
see https://www.bouncycastle.org/specifications.html for the specs,
http://www.bouncycastle.org/wiki/display/JA1/Provider+Installation for
install instructions (use the static method). I’ve not done this with
Lucee, yet, but I’ve done it a hundred times with ACF. Once the provider is
installed you should have access to SHA256withRSA through the native CF
functions (e.g. hmac in this case).

HTH

– Denny

See also Ben Nadel’s solution here: