Expression [MethodCallExpression] is not allowed: javax.crypto.Mac.getInstance(HmacSHA256)

+1 for javax.crypto support please!

I have built a driver that needs to perform AES encrypt/decrypt to talk to a device, so the classes I need are:

import javax.crypto.spec.IvParameterSpec 
import javax.crypto.spec.SecretKeySpec
import javax.crypto.Cipher

Including any of those gives:

Importing [javax.crypto.spec.IvParameterSpec] is not allowed

Or trying to access them in code via full definition (ie. without import needed) gives:

Expression [DeclarationExpression] is not allowed: (iv = new javax.crypto.spec.IvParameterSpec(initVector.getBytes(UTF-8)))

bump!

1 Like

Hi,

A recent newcomer to the Hubitat community... have had my C-5 unit a few weeks now and now looking to write my own driver. I searched the forums and found that someone else is also having similar issues to me in that it appears some of the crypto libraries are not included with the Hubitat firmware. Why?

Any plans to add these libraries? Looking for support around HMAC-SHA256, AES-CBC and base64 encoding capabilities to allow me to interact with a server unit that is controlling a garage door (uses strong encryption over a web socket).

@dwery was you able to progress around this? Any feedback from @mike.maxwell?

Thanks

Nutz

No feedback but still hoping!

Still hoping too... My plan B is going to be setup a REST endpoint on a Raspberry Pi that lets me send it the data to encrypt and sends it back... seems ridiculous, but it's my only option :frowning:

I have too many bridges already :smiley: don't want one more for my Neato

BUMP

Are you guys all trying to solve this to port the Neato driver? I am. The only reason my ST hub isn't a paper weight.

Not me, I’ve another project that I’d like to use these libraries for... so instead I’ve had to build a NodeJS bridge.

I did raise it with the Hubitat support team - their response was “this enhancement has not been prioritised and no time frame”.

I’m on hold due to the missing library as well.

I wouldn't hold my breathe. It's like to set it too but I doubt is high priority

Maybe a Christmas gift? :smiley:

Have you given it a try lately? It wasn't in the release notes as far as I remember but @chuck.schwer told me it was added in to 2.1.7.

1 Like

it worked, thanks!

For Neato?

I just tried the above mentioned crypto function, and it worked. With that, a driver for the Neato can certainly be built.

Consistent with the above interchange, I just tried porting the ST Neato DTH over to HE. After removing the simulator section and all the tile sections, I get the following error. I'm a bit over my head, though I attempted (feebly?) to follow the porting instructions here. Any ideas would be greatly appreciated!

No signature of method: Script1.mappings() is applicable for argument types: (Script1$_run_closure2) values: [Script1$_run_closure2@1e20859] Possible solutions: main(java.lang.String), main(java.util.List), main([Ljava.lang.String;)

I am interested in this for the GoGoGate 2 pygogogate -> groovy implementation I would like to do. The pygogogate requries AES to talk to the GoGoGate2 and supports enumeration of children etc. that the current Hubitat implementations don't support.

You can try changing the algorithm. Devices and apps support child devices in Hubitat, you should be able to enumerate and create/update children.

Beyond my ken I’m afraid.

Just tried it again for my driver that needed AES-128 - worked great! Now I no longer need my RPi doing the encryption/decryption :grinning:

Thanks @dman2306 and @chuck.schwer!