reallylabs / jwt-scala

JSON Web Token (JWT) Scala implementation
Apache License 2.0
38 stars 30 forks source link

add SHA with RSA algorithms #6

Closed fmasion closed 9 years ago

fmasion commented 9 years ago

Hi, I've needed a JWT implementation supporting RS256 So I've added the missings RSxxx algorithm to your lib

Fred

montaro commented 9 years ago

Thanks @fmasion. Can you please add test cases for your implementation.

fmasion commented 9 years ago

Hi Ahmed,

Here are the corresponding tests case and one bug fix. As RSA is not using a simple String as secret but strongly typed java.security.{PublicKey, PrivateKey} I made the assumption it should throw some InvalidPublicKey exception and not a JWTResult.InvalidSignature. actually InvalidSignature is returned only in case of structurally valid (but wrong) key. This point can be discussed. I have no preference about this point : it's up to you take a look at RSASpec for more info Fred

AhmedSoliman commented 9 years ago

LGTM