Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParsePrivateKey ¶
func ParsePrivateKey(filename string) (crypto.PrivateKey, error)
ParsePrivateKey pase PEM private key file, and returns a crypto.PrivateKey interface.
Types ¶
type ECJWTSigner ¶
type ECJWTSigner struct { PrivateKey *ecdsa.PrivateKey PublicKey *ecdsa.PublicKey Kid string // contains filtered or unexported fields }
func NewECJWTSigner ¶
func NewECJWTSigner(k *ecdsa.PrivateKey, alg, mockKid string) (*ECJWTSigner, error)
func (*ECJWTSigner) DecryptJWT ¶ added in v0.18.0
func (k *ECJWTSigner) DecryptJWT(encryptedJwt, alg string) (string, error)
func (*ECJWTSigner) JWKS ¶
func (k *ECJWTSigner) JWKS() ([]byte, error)
JWKS is the JSON JWKS representation of the rsa.PublicKey
func (*ECJWTSigner) SignJWT ¶
func (k *ECJWTSigner) SignJWT(claims jwt.Claims) (string, error)
SignJWT signs jwt.Claims with the Keypair and returns a token string
type JwtSigner ¶
type JwtSigner interface { JWKS() ([]byte, error) // marshal of JWKS SignJWT(claims jwt.Claims) (string, error) // signs jwt claims DecryptJWT(encryptedJwt, alg string) (string, error) // decrypt jwt }
JwtSigner interface for signing jwt and generating jwks
func NewJwtSigner ¶
func NewJwtSigner(key crypto.PrivateKey, alg, mockKid string) (JwtSigner, error)
NewJwtSigner create a JwtSigned for the correspond key type
supported key tupes are rsa.PrivateKey and ecdsa.PrivateKey
type RSAJWTSigner ¶
type RSAJWTSigner struct { PrivateKey *rsa.PrivateKey PublicKey *rsa.PublicKey Kid string // contains filtered or unexported fields }
func NewRSAJWTSigner ¶
func NewRSAJWTSigner(k *rsa.PrivateKey, alg, mockKid string) (*RSAJWTSigner, error)
func (*RSAJWTSigner) DecryptJWT ¶ added in v0.18.0
func (k *RSAJWTSigner) DecryptJWT(encryptedJwt, alg string) (string, error)
DecryptJWT decrypt jwt
func (*RSAJWTSigner) JWKS ¶
func (k *RSAJWTSigner) JWKS() ([]byte, error)
JWKS is the JSON JWKS representation of the rsa.PublicKey
func (*RSAJWTSigner) SignJWT ¶
func (k *RSAJWTSigner) SignJWT(claims jwt.Claims) (string, error)
SignJWT signs jwt.Claims with the Keypair and returns a token string
Click to show internal directories.
Click to hide internal directories.