Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlgorithmParameters ¶
type AlgorithmParameters struct { N buffer.Buffer `json:"n,omitempty"` E buffer.Buffer `json:"e,omitempty"` D buffer.Buffer `json:"d,omitempty"` P buffer.Buffer `json:"p,omitempty"` Q buffer.Buffer `json:"q,omitempty"` Dp buffer.Buffer `json:"dp,omitempty"` Dq buffer.Buffer `json:"dq,omitempty"` Qi buffer.Buffer `json:"qi,omitempty"` Crv EllipticCurveAlgorithm `json:"crv,omitempty"` X buffer.Buffer `json:"x,omitempty"` Y buffer.Buffer `json:"y,omitempty"` K buffer.Buffer `json:"k,omitempty"` }
AlgorithmParameters provides a single structure suitable to unmarshaling any JWK
type EllipticCurve ¶
EllipticCurve provides a indirect type to standard elliptic curve such that we can use it for unmarshal
type EllipticCurveAlgorithm ¶
type EllipticCurveAlgorithm string
EllipticCurveAlgorithm represents the algorithms used for EC keys
const ( P256 EllipticCurveAlgorithm = "P-256" P384 EllipticCurveAlgorithm = "P-384" P521 EllipticCurveAlgorithm = "P-521" )
Supported values for EllipticCurveAlgorithm
type KeyType ¶
type KeyType string
KeyType represents the key type ("kty") that are supported
const ( EC KeyType = "EC" // Elliptic Curve InvalidKeyType KeyType = "" // Invalid KeyType OctetSeq KeyType = "oct" // Octet sequence (used to represent symmetric keys) RSA KeyType = "RSA" // RSA )
Supported values for KeyType
func (*KeyType) Accept ¶
Accept is used when conversion from values given by outside sources (such as JSON payloads) is required
func (*KeyType) UnmarshalJSON ¶
UnmarshalJSON unmarshals and checks data as KeyType Algorithm
type SignatureAlgorithm ¶
type SignatureAlgorithm string
SignatureAlgorithm represents the various signature algorithms as described in https://tools.ietf.org/html/rfc7518#section-3.1
const ( ES256 SignatureAlgorithm = "ES256" // ECDSA using P-256 and SHA-256 ES384 SignatureAlgorithm = "ES384" // ECDSA using P-384 and SHA-384 ES512 SignatureAlgorithm = "ES512" // ECDSA using P-521 and SHA-512 HS256 SignatureAlgorithm = "HS256" // HMAC using SHA-256 HS384 SignatureAlgorithm = "HS384" // HMAC using SHA-384 HS512 SignatureAlgorithm = "HS512" // HMAC using SHA-512 NoSignature SignatureAlgorithm = "none" PS256 SignatureAlgorithm = "PS256" // RSASSA-PSS using SHA256 and MGF1-SHA256 PS384 SignatureAlgorithm = "PS384" // RSASSA-PSS using SHA384 and MGF1-SHA384 PS512 SignatureAlgorithm = "PS512" // RSASSA-PSS using SHA512 and MGF1-SHA512 RS256 SignatureAlgorithm = "RS256" // RSASSA-PKCS-v1.5 using SHA-256 RS384 SignatureAlgorithm = "RS384" // RSASSA-PKCS-v1.5 using SHA-384 RS512 SignatureAlgorithm = "RS512" // RSASSA-PKCS-v1.5 using SHA-512 NoValue SignatureAlgorithm = "" // No value is different from none )
Supported values for SignatureAlgorithm
func (*SignatureAlgorithm) Accept ¶
func (signature *SignatureAlgorithm) Accept(value interface{}) error
Accept is used when conversion from values given by outside sources (such as JSON payloads) is required
func (SignatureAlgorithm) String ¶
func (signature SignatureAlgorithm) String() string
String returns the string representation of a SignatureAlgorithm
func (*SignatureAlgorithm) UnmarshalJSON ¶
func (signature *SignatureAlgorithm) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals and checks data as Signature Algorithm