ghi-electronics / TinyCLR-Libraries

Official Libraries supporting TinyCLR OS
https://www.ghielectronics.com/tinyclr/
17 stars 16 forks source link

Additional Crypto functions needed for JWT #783

Open martincalsyn opened 3 years ago

martincalsyn commented 3 years ago

Additional crypto features need to be exposed in order to support generation of JWT tokens for use with popular web services, including Google IoT

SHA256 hash calculation HMAC hash calculation RSA signature calculation (at least RSA256)

Palomino34 commented 3 years ago

Does RSA "https://docs.ghielectronics.com/software/tinyclr/tutorials/cryptography.html" work?

martincalsyn commented 3 years ago

Those functions work fine for encrypt/decrypt, but we need RSA256 signing (generating a signature hash, not an encrypted payload). Also need HMAC signing. There are also elliptic curve signing algorithms that are used with JWT, but if the goal is Google IoT, then RSA256 is sufficient to start with.