MCPcopy
hub / github.com/golang-jwt/jwt / init

Function init

rsa_pss.go:27–78  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25)
26
27func 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

Callers

nothing calls this directly

Calls 2

RegisterSigningMethodFunction · 0.85
AlgMethod · 0.65

Tested by

no test coverage detected