Documentation
¶
Overview ¶
Package coserv provides an implementation of draft-howard-rats-coserv
Index ¶
- type AKQuad
- type ArtifactType
- type CoTSStmt
- type Coserv
- func (o *Coserv) AddResults(v ResultSet) error
- func (o *Coserv) FromBase64Url(s string) error
- func (o *Coserv) FromCBOR(data []byte) error
- func (o *Coserv) Sign(signer cose.Signer) ([]byte, error)
- func (o Coserv) ToBase64Url() (string, error)
- func (o Coserv) ToCBOR() ([]byte, error)
- func (o Coserv) ToEDN() (string, error)
- func (o Coserv) Valid() error
- func (o *Coserv) Verify(verifier cose.Verifier, data []byte) error
- type EnvironmentSelector
- type Query
- type RefValQuad
- type ResultSet
- func (o *ResultSet) AddAttestationKeys(v AKQuad) *ResultSet
- func (o *ResultSet) AddCoTS(v CoTSStmt) *ResultSet
- func (o *ResultSet) AddReferenceValues(v RefValQuad) *ResultSet
- func (o *ResultSet) AddSourceArtifacts(v cmw.CMW) *ResultSet
- func (o *ResultSet) SetExpiry(exp time.Time) *ResultSet
- func (o ResultSet) Valid() error
- type ResultType
- type StatefulClass
- type StatefulGroup
- type StatefulInstance
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AKQuad ¶
type AKQuad struct {
Authorities *comid.CryptoKeys `cbor:"1,keyasint"`
AKTriple *comid.KeyTriple `cbor:"2,keyasint"`
}
type ArtifactType ¶
type ArtifactType uint8
const ( ArtifactTypeEndorsedValues ArtifactType = iota ArtifactTypeTrustAnchors ArtifactTypeReferenceValues )
func (ArtifactType) String ¶
func (a ArtifactType) String() string
String returns the string representation of the target ArtifactType
type CoTSStmt ¶
type CoTSStmt struct {
Authorities *comid.CryptoKeys `cbor:"1,keyasint"`
CoTS *cots.ConciseTaStore `cbor:"2,keyasint"`
}
type Coserv ¶
type Coserv struct {
Profile eat.Profile `cbor:"0,keyasint"`
Query Query `cbor:"1,keyasint"`
Results *ResultSet `cbor:"2,keyasint,omitempty"`
}
Coserv is the internal representation of a CoSERV data item
func NewCoserv ¶
NewCoserv creates a new Coserv instance. An error is returned if the supplied profile or query are invalid
func (*Coserv) AddResults ¶
AddResults add the result set to the Coserv target after validating it
func (*Coserv) FromBase64Url ¶
FromBase64Url deserializes from base64url-encoded into the target Coserv An error is returned if either decoding or validation of the CoSERV payload fails
func (*Coserv) FromCBOR ¶
FromCBOR deserializes from CBOR into the target Coserv An error is returned if either decoding or validation of the CoSERV payload fails
func (Coserv) ToBase64Url ¶
ToBase64Url validates and serializes to base64url the target Coserv An error is returned if either validation or encoding of the Coserv target fails
func (Coserv) ToCBOR ¶
ToCBOR validates and serializes to CBOR the target Coserv An error is returned if either validation or encoding of the Coserv target fails
type EnvironmentSelector ¶
type EnvironmentSelector struct {
Classes *[]StatefulClass `cbor:"0,keyasint,omitempty"`
Instances *[]StatefulInstance `cbor:"1,keyasint,omitempty"`
Groups *[]StatefulGroup `cbor:"2,keyasint,omitempty"`
}
func NewEnvironmentSelector ¶
func NewEnvironmentSelector() *EnvironmentSelector
NewEnvironmentSelector creates a new EnvironmentSelector instance
func (*EnvironmentSelector) AddClass ¶
func (o *EnvironmentSelector) AddClass(v StatefulClass) *EnvironmentSelector
AddClass adds the supplied CoMID class to the target EnvironmentSelector
func (*EnvironmentSelector) AddGroup ¶
func (o *EnvironmentSelector) AddGroup(v StatefulGroup) *EnvironmentSelector
AddGroup adds the supplied CoMID group to the target EnvironmentSelector
func (*EnvironmentSelector) AddInstance ¶
func (o *EnvironmentSelector) AddInstance(v StatefulInstance) *EnvironmentSelector
AddInstance adds the supplied CoMID instance to the target EnvironmentSelector
func (EnvironmentSelector) Valid ¶
func (o EnvironmentSelector) Valid() error
Valid ensures that the target EnvironmentSelector is correctly populated
type Query ¶
type Query struct {
ArtifactType ArtifactType `cbor:"0,keyasint"`
EnvironmentSelector EnvironmentSelector `cbor:"1,keyasint"`
ResultType ResultType `cbor:"2,keyasint"`
}
Query is the internal representation of a Query data item
func NewQuery ¶
func NewQuery( artifactType ArtifactType, envSelector EnvironmentSelector, resultType ResultType, ) (*Query, error)
NewQuery creates a new Query instance. An error is returned if the supplied environment selector is invalid.
type RefValQuad ¶
type RefValQuad struct {
Authorities *comid.CryptoKeys `cbor:"1,keyasint"`
RVTriple *comid.ValueTriple `cbor:"2,keyasint"`
}
type ResultSet ¶
type ResultSet struct {
RVQ *[]RefValQuad `cbor:"0,keyasint,omitempty"`
AKQ *[]AKQuad `cbor:"3,keyasint,omitempty"`
TAS *[]CoTSStmt `cbor:"4,keyasint,omitempty"`
// TODO(tho) add endorsed values
Expiry *time.Time `cbor:"10,keyasint"`
SourceArtifacts *[]cmw.CMW `cbor:"11,keyasint,omitempty"`
}
func (*ResultSet) AddAttestationKeys ¶
AddAttestationKeys adds the supplied ak quad to the target ResultSet
func (*ResultSet) AddReferenceValues ¶
func (o *ResultSet) AddReferenceValues(v RefValQuad) *ResultSet
AddReferenceValues adds the supplied ref-val quad to the target ResultSet
func (*ResultSet) AddSourceArtifacts ¶
AddSourceArtifacts adds the supplied CMW to the target ResultSet
type ResultType ¶
type ResultType uint8
const ( ResultTypeCollectedArtifacts ResultType = iota ResultTypeSourceArtifacts ResultTypeBoth )
func (ResultType) String ¶
func (a ResultType) String() string
String returns the string representation of the target ResultType
type StatefulClass ¶
type StatefulClass struct {
Class *comid.Class
Measurements *comid.Measurements
}
func (StatefulClass) MarshalCBOR ¶
func (o StatefulClass) MarshalCBOR() ([]byte, error)
func (*StatefulClass) UnmarshalCBOR ¶
func (o *StatefulClass) UnmarshalCBOR(data []byte) error
type StatefulGroup ¶
type StatefulGroup struct {
Group *comid.Group
Measurements *comid.Measurements
}
func (StatefulGroup) MarshalCBOR ¶
func (o StatefulGroup) MarshalCBOR() ([]byte, error)
func (*StatefulGroup) UnmarshalCBOR ¶
func (o *StatefulGroup) UnmarshalCBOR(data []byte) error
type StatefulInstance ¶
type StatefulInstance struct {
Instance *comid.Instance
Measurements *comid.Measurements
}
func (StatefulInstance) MarshalCBOR ¶
func (o StatefulInstance) MarshalCBOR() ([]byte, error)
func (*StatefulInstance) UnmarshalCBOR ¶
func (o *StatefulInstance) UnmarshalCBOR(data []byte) error