scheme

package
v0.0.0-...-952bb8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Copyright 2022 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0

Copyright 2022 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppraiseEvidenceArgs

type AppraiseEvidenceArgs struct {
	Evidence     []byte
	Endorsements []string
}

type ExtractVerifiedClaimsArgs

type ExtractVerifiedClaimsArgs struct {
	Token       []byte
	TrustAnchor string
}

type ExtractedClaims

type ExtractedClaims struct {
	ClaimsSet  map[string]interface{} `json:"claims-set"`
	SoftwareID string                 `json:"software-id"`
}

ExtractedClaims contains a map of claims extracted from an attestation token along with the corresponding SoftwareID that is used to fetch the associated endorsements.

XXX(tho) -- not clear why SoftwareID is treated differently from TrustAnchorID

func NewExtractedClaims

func NewExtractedClaims() *ExtractedClaims

type IScheme

type IScheme interface {
	GetName() string
	GetFormat() proto.AttestationFormat
	GetSupportedMediaTypes() []string

	ExtractVerifiedClaims(token *proto.AttestationToken, trustAnchor string) (*ExtractedClaims, error)
	GetTrustAnchorID(token *proto.AttestationToken) (string, error)
	AppraiseEvidence(ec *proto.EvidenceContext, endorsements []string) (*proto.AppraisalContext, error)

	// endorsement lookup keys
	SynthKeysFromSwComponent(tenantID string, swComp *proto.Endorsement) ([]string, error)
	SynthKeysFromTrustAnchor(tenantID string, ta *proto.Endorsement) ([]string, error)
}

IScheme defines the interface to attestation scheme specific functionality. An object implementing this interface encapsulates all functionality specific to a particular AttestationFormat, such as knowledge of evidence and endorsements structure.

type Plugin

type Plugin struct {
	Impl IScheme
}

func (*Plugin) Client

func (p *Plugin) Client(b *plugin.MuxBroker, c *rpc.Client) (interface{}, error)

func (*Plugin) Server

func (p *Plugin) Server(*plugin.MuxBroker) (interface{}, error)

type RPCClient

type RPCClient struct {
	// contains filtered or unexported fields
}

func (*RPCClient) AppraiseEvidence

func (s *RPCClient) AppraiseEvidence(ec *proto.EvidenceContext, endorsements []string) (*proto.AppraisalContext, error)

func (*RPCClient) ExtractEvidence

func (s *RPCClient) ExtractEvidence(token *proto.AttestationToken, trustAnchor string) (*ExtractedClaims, error)

func (*RPCClient) ExtractVerifiedClaims

func (s *RPCClient) ExtractVerifiedClaims(token *proto.AttestationToken, trustAnchor string) (*ExtractedClaims, error)

func (*RPCClient) GetFormat

func (s *RPCClient) GetFormat() proto.AttestationFormat

func (*RPCClient) GetName

func (s *RPCClient) GetName() string

func (*RPCClient) GetSupportedMediaTypes

func (s *RPCClient) GetSupportedMediaTypes() []string

func (*RPCClient) GetTrustAnchorID

func (s *RPCClient) GetTrustAnchorID(token *proto.AttestationToken) (string, error)

func (*RPCClient) SynthKeysFromSwComponent

func (s *RPCClient) SynthKeysFromSwComponent(tenantID string, swComp *proto.Endorsement) ([]string, error)

func (*RPCClient) SynthKeysFromTrustAnchor

func (s *RPCClient) SynthKeysFromTrustAnchor(tenantID string, ta *proto.Endorsement) ([]string, error)

type RPCServer

type RPCServer struct {
	Impl IScheme
}

func (*RPCServer) AppraiseEvidence

func (s *RPCServer) AppraiseEvidence(args AppraiseEvidenceArgs, resp *[]byte) error

func (*RPCServer) ExtractVerifiedClaims

func (s *RPCServer) ExtractVerifiedClaims(args ExtractVerifiedClaimsArgs, resp *[]byte) error

func (*RPCServer) GetFormat

func (s *RPCServer) GetFormat(args interface{}, resp *proto.AttestationFormat) error

func (*RPCServer) GetName

func (s *RPCServer) GetName(args interface{}, resp *string) error

func (*RPCServer) GetSupportedMediaTypes

func (s *RPCServer) GetSupportedMediaTypes(args interface{}, resp *[]string) error

func (*RPCServer) GetTrustAnchorID

func (s *RPCServer) GetTrustAnchorID(data []byte, resp *string) error

func (*RPCServer) SynthKeysFromSwComponent

func (s *RPCServer) SynthKeysFromSwComponent(args SynthKeysArgs, resp *[]string) error

func (*RPCServer) SynthKeysFromTrustAnchor

func (s *RPCServer) SynthKeysFromTrustAnchor(args SynthKeysArgs, resp *[]string) error

type SchemeGoPlugin

type SchemeGoPlugin struct {
	Path                string
	Name                string
	SupportedMediaTypes []string
	Handle              IScheme
	Client              *plugin.Client
}

func NewSchemeGoPlugin

func NewSchemeGoPlugin(path string) (*SchemeGoPlugin, error)

type SynthKeysArgs

type SynthKeysArgs struct {
	TenantID        string
	EndorsementJSON []byte
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL