envelope

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCertToEnvelope

func AddCertToEnvelope(signedAtt, cert []byte) ([]byte, error)

AddCertToEnvelope takes a signed DSSE Envelope and a PEM-encoded certificate, and returns an Envelope with the certificate inside the Signature of the Envelope. This assumes there is only one signature present in the envelope.

func GetCertFromEnvelope

func GetCertFromEnvelope(signedAtt []byte) ([]byte, error)

GetCertFromEnvelope takes a signed Envelope and extracts the PEM-encoded certificate from the signature. This assumes there is only one signature present in the envelope.

Types

type Envelope

type Envelope struct {
	PayloadType string      `json:"payloadType"`
	Payload     string      `json:"payload"`
	Signatures  []Signature `json:"signatures"`
}

Envelope captures an envelope as described by the Secure Systems Lab Signing Specification. See here: https://github.com/secure-systems-lab/signing-spec/blob/master/envelope.md

type Signature

type Signature struct {
	KeyID string `json:"keyid"`
	Sig   string `json:"sig"`
	Cert  string `json:"cert"`
}

Signature represents a generic in-toto signature that contains the identifier of the key which was used to create the signature. The used signature scheme has to be agreed upon by the signer and verifer out of band. The signature is a base64 encoding of the raw bytes from the signature algorithm. The cert is a PEM encoded string of the signing certificate.

Jump to

Keyboard shortcuts

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