Documentation
¶
Overview ¶
Copyright 2026 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- type Claims
- func (c Claims) GetCMW() *cmw.CMW
- func (c Claims) GetEatNonce() *eat.Nonce
- func (c Claims) GetEatProfile() *eat.Profile
- func (c Claims) GetKeyandNonceSz(key string) (uint, bool)
- func (c Claims) GetNonceAdjustFn() string
- func (c Claims) GetNonceAdjustMap() map[string]uint
- func (c *Claims) SetCMW(v interface{}) error
- func (c *Claims) SetKeyandNonceSz(key string, sz uint) error
- func (c *Claims) SetNonce(v []byte) error
- func (c *Claims) SetNonceAdjustFn(alg string) error
- type Evidence
Constants ¶
const ( LegacyProfile = "tag:github.com,2024:veraison/ratsd" NonceAdjustFunctionShake128 = "shake-128" NonceAdjustFunctionShake256 = "shake-256" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
type Claims struct {
EatProfile *eat.Profile `json:"eat_profile"`
EatNonce *eat.Nonce `json:"eat_nonce"`
CMW string `json:"cmw"`
NonceAdjustFunction *string `json:"vnd.veraison.nonce_adjust_function,omitempty"`
NonceAdjustMap map[string]uint `json:"vnd.veraison.nonce_adjust_map,omitempty"`
}
Claims contains the legacy RATSD token claims defined in docs/ratsd-token.cddl.
func (Claims) GetEatNonce ¶
GetEatNonce returns the EAT nonce claim.
func (Claims) GetEatProfile ¶
GetEatProfile returns the EAT profile claim.
func (Claims) GetKeyandNonceSz ¶
GetKeyandNonceSz returns the configured adjusted nonce size for the given key. The boolean result reports whether the key was present in the nonce-adjust map.
func (Claims) GetNonceAdjustFn ¶
GetNonceAdjustFn returns the nonce adjustment algorithm, if set.
func (Claims) GetNonceAdjustMap ¶
GetNonceAdjustMap returns a copy of the nonce adjustment map.
func (*Claims) SetCMW ¶
SetCMW serializes the supplied CMW object into the legacy base64 claim form.
func (*Claims) SetKeyandNonceSz ¶
SetKeyandNonceSz sets the nonce-adjusted size for a given key.
func (*Claims) SetNonceAdjustFn ¶
SetNonceAdjustFn sets the nonce adjustment algorithm.
type Evidence ¶
type Evidence struct {
Claims Claims `json:"-"`
}
Evidence exposes the legacy RATSD token as a single claims container.
func NewEvidence ¶
func NewEvidence() *Evidence
NewEvidence returns an Evidence with the legacy EAT profile preset.
func (Evidence) GetClaims ¶
GetClaims returns a copy of the stored claims after validating the evidence state.
func (Evidence) MarshalJSON ¶
MarshalJSON encodes Evidence using the flat legacy claim layout.
func (*Evidence) SetClaims ¶
SetClaims attaches the supplied claims to the Evidence instance. Only successfully validated claims are allowed to be set.
func (*Evidence) UnmarshalJSON ¶
UnmarshalJSON decodes Evidence from the flat legacy claim layout.