common

package
v0.0.2409 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

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

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

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClaimsToMap

func ClaimsToMap(mapper ClaimMapper) (map[string]interface{}, error)

func DecodePemSubjectPubKeyInfo

func DecodePemSubjectPubKeyInfo(key []byte) (crypto.PublicKey, error)

DecodePemSubjectPubKeyInfo decodes a PEM encoded SubjectPublicKeyInfo

func GetImplID

func GetImplID(scheme string, attr json.RawMessage) (string, error)

func GetInstID

func GetInstID(scheme string, attr json.RawMessage) (string, error)

func MapToClaims

func MapToClaims(in map[string]interface{}) (psatoken.IClaims, error)

func UnsignedCorimDecoder

func UnsignedCorimDecoder(
	data []byte,
	xtr IExtractor,
) (*handler.EndorsementHandlerResponse, error)

Types

type ClaimMapper

type ClaimMapper interface {
	ToJSON() ([]byte, error)
}

type IExtractor

type IExtractor interface {
	RefValExtractor(comid.ValueTriples) ([]*handler.Endorsement, error)
	TaExtractor(comid.KeyTriple) (*handler.Endorsement, error)
	SetProfile(string)
}

IExtractor is the interface that CoRIM plugins need to implement to hook into the UnsignedCorimDecoder logics. Each extractor consumes a specific CoMID triple and produces a corresponding Veraison Endorsement format (or an error).

Note: At the moment the interface is limited by the known use cases. We anticipate that in the future there will to be an extractor for each of the defined CoMID triples, plus maybe a way to handle cross-triples checks as well as extraction from the "global" CoRIM context. See also https://github.com/veraison/services/issues/70

Directories

Path Synopsis
arm
cca

Jump to

Keyboard shortcuts

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