Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Method ¶
type Method struct {
PrivateKey *rsa.PrivateKey
PublicKey *rsa.PublicKey
HashFunc func() hash.Hash
Hash crypto.Hash
Name string
// contains filtered or unexported fields
}
func NewFromPublicKey ¶
NewFromPublicKey constructs a verifying Method from an RSA public key by heuristically selecting a JOSE RSA algorithm based on modulus size.
Heuristics (PKCS#1 v1.5):
- n bits >= 4096 -> RS512
- n bits >= 3072 -> RS384
- otherwise -> RS256
Note: The choice between PKCS#1 v1.5 (RS*) and PSS (PS*) cannot be inferred from the key alone. This helper defaults to RS* for maximum interoperability.
Click to show internal directories.
Click to hide internal directories.