Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrRSAPublicKeyNotFound is returned when a certificate does not contain an RSA public key. ErrRSAPublicKeyNotFound = errors.New("not a RSA public key") // ErrCertificateNotFound is returned when no certificate is provided. ErrCertificateNotFound = errors.New("certificate not found") // ErrDuplicateKID is returned when duplicate key IDs are detected. ErrDuplicateKID = errors.New("duplicate kid") // ErrKeyTypeUnsupported is returned when an unsupported key type is encountered. ErrKeyTypeUnsupported = errors.New("key type unsupported") // ErrInvalidKey is returned when key validation fails. ErrInvalidKey = errors.New("invalid key") )
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
Kty KeyType
Alg string
Use string
KeyOps []string
Kid string
X509Certs []x509.Certificate
}
Input is used to build JWKS from a set of keys and certificates.
type JWKS ¶
type JWKS struct {
Keys []Key `json:"keys"`
}
JWKS represents a JSON Web Key Set, containing multiple JWK keys.
func New ¶
New constructs a JWKS from one or more KeyInput values. It ensures each key has a unique KID and at least one certificate.
type Key ¶
type Key struct {
Kty KeyType `json:"kty"` // Key type (e.g., "RSA")
Alg string `json:"alg"` // Algorithm intended for use with the key
Use string `json:"use"` // Intended use of the public key
KeyOps []string `json:"key_ops"` // Permitted operations for the key
Kid string `json:"kid"` // Key ID
X5c []string `json:"x5c"` // X.509 certificate chain
N string `json:"n"` // RSA modulus
E string `json:"e"` // RSA public exponent
}
Key defines the structure of a single JSON Web Key.
Click to show internal directories.
Click to hide internal directories.