Documentation ¶
Overview ¶
Package jose implements some helper functions and types for the children packages, jws, jwt, and jwe.
Index ¶
- func Base64Decode(b []byte) ([]byte, error)
- func Base64Encode(b []byte) []byte
- func DecodeEscaped(b []byte) ([]byte, error)
- func EncodeEscape(b []byte) []byte
- type Encoder
- type Header
- type Protected
- func (p Protected) Base64() ([]byte, error)
- func (p Protected) Del(key string)
- func (p Protected) Get(key string) interface{}
- func (p Protected) Has(key string) bool
- func (p Protected) MarshalJSON() ([]byte, error)
- func (p Protected) Set(key string, val interface{})
- func (p *Protected) UnmarshalJSON(b []byte) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64Decode ¶
Base64Decode decodes a base64-encoded byte slice.
func DecodeEscaped ¶
DecodeEscaped decodes a base64-encoded byte slice straight from a JSON structure. It assumes it's in the format: `"base64"`, but can handle cases where it's not.
func EncodeEscape ¶
EncodeEscape base64-encodes a byte slice but escapes it for JSON. It'll return the format: `"base64"`
Types ¶
type Encoder ¶
Encoder is satisfied if the type can marshal itself into a valid structure for a JWS.
type Header ¶
type Header map[string]interface{}
Header implements a JOSE Header with the addition of some helper methods, similar to net/url.Values.
func (Header) MarshalJSON ¶
MarshalJSON implements json.Marshaler for Header.
func (*Header) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler for Header.
type Protected ¶
type Protected Header
Protected Headers are base64-encoded after they're marshaled into JSON.
func (Protected) Has ¶
Has returns true if a value for the given key exists inside the Protected Header.
func (Protected) MarshalJSON ¶
MarshalJSON implements json.Marshaler for Protected.
func (*Protected) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler for Protected.
Directories ¶
Path | Synopsis |
---|---|
Package crypto implements "SigningMethods" and "EncryptionMethods"; that is, ways to sign and encrypt JWS and JWEs, respectively, as well as JWTs.
|
Package crypto implements "SigningMethods" and "EncryptionMethods"; that is, ways to sign and encrypt JWS and JWEs, respectively, as well as JWTs. |
Package jws implements JWSs per RFC 7515
|
Package jws implements JWSs per RFC 7515 |
Package jwt implements JWTs per RFC 7519
|
Package jwt implements JWTs per RFC 7519 |