Documentation ¶
Index ¶
- Variables
- func DecodeSegment(seg string) ([]byte, error)
- func EncodeSegment(seg []byte) string
- type Claims
- type Descriptor
- type Header
- type Manifest
- type Scheme
- func (s *Scheme) RegisterSigner(signerID string, signer Signer)
- func (s *Scheme) RegisterVerifier(verifier Verifier)
- func (s *Scheme) Sign(signerID string, claims Claims) (string, error)
- func (s *Scheme) SignRaw(signerID string, content []byte) (string, error)
- func (s *Scheme) Verify(token string) (Claims, error)
- type Signer
- type Verifier
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidToken = errors.New("invalid token") ErrInvalidSignatureType = errors.New("invalid signature type") ErrUnknownSignatureType = errors.New("unknown signature type") ErrUnknownSigner = errors.New("unknown signer") ErrDigestMismatch = errors.New("digest mismatch") ErrSizeMismatch = errors.New("size mismatch") ErrMediaTypeMismatch = errors.New("media type mismatch") )
common errors
Functions ¶
func DecodeSegment ¶
DecodeSegment JWT specific base64url encoding with padding stripped
func EncodeSegment ¶
EncodeSegment JWT specific base64url encoding with padding stripped
Types ¶
type Claims ¶
type Claims struct { Manifest Expiration int64 `json:"exp,omitempty"` IssuedAt int64 `json:"iat,omitempty"` NotBefore int64 `json:"nbf,omitempty"` }
Claims contains the claims to be signed
func DecodeClaims ¶
DecodeClaims JWT specific base64url encoding with padding stripped as Claims
type Descriptor ¶
type Descriptor struct { MediaType string `json:"mediaType,omitempty"` Digest string `json:"digest"` Size int64 `json:"size"` }
Descriptor describes the basic information of the target content
type Manifest ¶
type Manifest struct { Descriptor References []string `json:"references,omitempty"` }
Manifest to be signed
type Scheme ¶
type Scheme struct {
// contains filtered or unexported fields
}
Scheme is a signature scheme
func (*Scheme) RegisterSigner ¶
RegisterSigner registers signer with a name
func (*Scheme) RegisterVerifier ¶
RegisterVerifier registers verifier
Click to show internal directories.
Click to hide internal directories.