()
| 25 | ) |
| 26 | |
| 27 | func init() { |
| 28 | // PS256 |
| 29 | SigningMethodPS256 = &SigningMethodRSAPSS{ |
| 30 | SigningMethodRSA: &SigningMethodRSA{ |
| 31 | Name: "PS256", |
| 32 | Hash: crypto.SHA256, |
| 33 | }, |
| 34 | Options: &rsa.PSSOptions{ |
| 35 | SaltLength: rsa.PSSSaltLengthEqualsHash, |
| 36 | }, |
| 37 | VerifyOptions: &rsa.PSSOptions{ |
| 38 | SaltLength: rsa.PSSSaltLengthAuto, |
| 39 | }, |
| 40 | } |
| 41 | RegisterSigningMethod(SigningMethodPS256.Alg(), func() SigningMethod { |
| 42 | return SigningMethodPS256 |
| 43 | }) |
| 44 | |
| 45 | // PS384 |
| 46 | SigningMethodPS384 = &SigningMethodRSAPSS{ |
| 47 | SigningMethodRSA: &SigningMethodRSA{ |
| 48 | Name: "PS384", |
| 49 | Hash: crypto.SHA384, |
| 50 | }, |
| 51 | Options: &rsa.PSSOptions{ |
| 52 | SaltLength: rsa.PSSSaltLengthEqualsHash, |
| 53 | }, |
| 54 | VerifyOptions: &rsa.PSSOptions{ |
| 55 | SaltLength: rsa.PSSSaltLengthAuto, |
| 56 | }, |
| 57 | } |
| 58 | RegisterSigningMethod(SigningMethodPS384.Alg(), func() SigningMethod { |
| 59 | return SigningMethodPS384 |
| 60 | }) |
| 61 | |
| 62 | // PS512 |
| 63 | SigningMethodPS512 = &SigningMethodRSAPSS{ |
| 64 | SigningMethodRSA: &SigningMethodRSA{ |
| 65 | Name: "PS512", |
| 66 | Hash: crypto.SHA512, |
| 67 | }, |
| 68 | Options: &rsa.PSSOptions{ |
| 69 | SaltLength: rsa.PSSSaltLengthEqualsHash, |
| 70 | }, |
| 71 | VerifyOptions: &rsa.PSSOptions{ |
| 72 | SaltLength: rsa.PSSSaltLengthAuto, |
| 73 | }, |
| 74 | } |
| 75 | RegisterSigningMethod(SigningMethodPS512.Alg(), func() SigningMethod { |
| 76 | return SigningMethodPS512 |
| 77 | }) |
| 78 | } |
| 79 | |
| 80 | // Verify implements token verification for the SigningMethod. |
| 81 | // For this verify method, key must be an rsa.PublicKey struct |
nothing calls this directly
no test coverage detected