Documentation ¶
Index ¶
- Constants
- func GenerateJWS(j *JWK, payload []byte) (jwsBytes []byte, err error)
- func GenerateJWSWithAlg(j *JWK, payload []byte) (jwsBytes []byte, err error)
- func Sign(j *JWK, hashed []byte) (sig []byte, err error)
- func Verify(j *JWK, hashed, sig []byte) (err error)
- func VerifyJWS(j *JWK, jwsBytes []byte) (payload []byte, err error)
- type Header
- type JWK
Constants ¶
View Source
const ( ES256 jwa.SignatureAlgorithm = jwa.ES256 ES256K jwa.SignatureAlgorithm = jwa.ES256K ES384 jwa.SignatureAlgorithm = jwa.ES384 ES512 jwa.SignatureAlgorithm = jwa.ES512 EdDSA jwa.SignatureAlgorithm = jwa.EdDSA HS256 jwa.SignatureAlgorithm = jwa.HS256 HS384 jwa.SignatureAlgorithm = jwa.HS384 HS512 jwa.SignatureAlgorithm = jwa.HS512 NoSignature jwa.SignatureAlgorithm = jwa.NoSignature PS256 jwa.SignatureAlgorithm = jwa.PS256 PS384 jwa.SignatureAlgorithm = jwa.PS384 PS512 jwa.SignatureAlgorithm = jwa.PS512 RS256 jwa.SignatureAlgorithm = jwa.RS256 RS384 jwa.SignatureAlgorithm = jwa.RS384 RS512 jwa.SignatureAlgorithm = jwa.RS512 )
Variables ¶
This section is empty.
Functions ¶
func GenerateJWS ¶
GenerateJWS - generates a new JWS from the given input
func GenerateJWSWithAlg ¶
GenerateJWSWithAlg - generates a new JWS from the given input using the given algorithm
Types ¶
type JWK ¶
type JWK struct { Kty string `yaml:"kty,omitempty" json:"kty,omitempty"` Crv string `yaml:"crv,omitempty" json:"crv,omitempty"` N string `yaml:"n,omitempty" json:"n,omitempty"` E string `yaml:"e,omitempty" json:"e,omitempty"` G string `yaml:"g,omitempty" json:"g,omitempty"` P string `yaml:"p,omitempty" json:"p,omitempty"` Q string `yaml:"q,omitempty" json:"q,omitempty"` X string `yaml:"x,omitempty" json:"x,omitempty"` Y string `yaml:"y,omitempty" json:"y,omitempty"` D string `yaml:"d,omitempty" json:"d,omitempty"` DP string `yaml:"dp,omitempty" json:"dp,omitempty"` DQ string `yaml:"dq,omitempty" json:"dq,omitempty"` QI string `yaml:"qi,omitempty" json:"qi,omitempty"` Kid string `yaml:"kid,omitempty" json:"kid,omitempty"` }
JWK - RSA & EC keys is in JWK format
Click to show internal directories.
Click to hide internal directories.