signature

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: Apache-2.0 Imports: 22 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Fulcio cert-extensions, documented here: https://github.com/sigstore/fulcio/blob/main/docs/oid-info.md
	CertExtensionOIDCIssuer               = "1.3.6.1.4.1.57264.1.1"
	CertExtensionGithubWorkflowTrigger    = "1.3.6.1.4.1.57264.1.2"
	CertExtensionGithubWorkflowSha        = "1.3.6.1.4.1.57264.1.3"
	CertExtensionGithubWorkflowName       = "1.3.6.1.4.1.57264.1.4"
	CertExtensionGithubWorkflowRepository = "1.3.6.1.4.1.57264.1.5"
	CertExtensionGithubWorkflowRef        = "1.3.6.1.4.1.57264.1.6"

	CertExtensionMap = map[string]string{
		CertExtensionOIDCIssuer:               "oidcIssuer",
		CertExtensionGithubWorkflowTrigger:    "githubWorkflowTrigger",
		CertExtensionGithubWorkflowSha:        "githubWorkflowSha",
		CertExtensionGithubWorkflowName:       "githubWorkflowName",
		CertExtensionGithubWorkflowRepository: "githubWorkflowRepository",
		CertExtensionGithubWorkflowRef:        "githubWorkflowRef",
	}
)

Functions

func CertExtensions added in v1.6.0

func CertExtensions(cert *x509.Certificate) map[string]string

func CertIssuerExtension added in v1.3.1

func CertIssuerExtension(cert *x509.Certificate) string

func CertSubject added in v1.3.1

func CertSubject(c *x509.Certificate) string

func LoadPublicKey

func LoadPublicKey(ctx context.Context, keyRef string) (verifier signature.Verifier, err error)

LoadPublicKey is a wrapper for VerifierForKeyRef, hardcoding SHA256 as the hash algorithm

func LoadPublicKeyRaw added in v1.5.0

func LoadPublicKeyRaw(raw []byte, hashAlgorithm crypto.Hash) (signature.Verifier, error)

LoadPublicKeyRaw loads a verifier from a raw public key passed in

func PublicKeyFromKeyRef

func PublicKeyFromKeyRef(ctx context.Context, keyRef string) (signature.Verifier, error)

func PublicKeyFromKeyRefWithHashAlgo added in v1.4.0

func PublicKeyFromKeyRefWithHashAlgo(ctx context.Context, keyRef string, hashAlgorithm crypto.Hash) (signature.Verifier, error)

func PublicKeyPem

func PublicKeyPem(key signature.PublicKeyProvider, pkOpts ...signature.PublicKeyOption) ([]byte, error)

func SignerFromKeyRef

func SignerFromKeyRef(ctx context.Context, keyRef string, pf cosign.PassFunc) (signature.Signer, error)

func SignerVerifierFromKeyRef

func SignerVerifierFromKeyRef(ctx context.Context, keyRef string, pf cosign.PassFunc) (signature.SignerVerifier, error)

func VerifierForKeyRef added in v1.4.0

func VerifierForKeyRef(ctx context.Context, keyRef string, hashAlgorithm crypto.Hash) (verifier signature.Verifier, err error)

VerifierForKeyRef parses the given keyRef, loads the key and returns an appropriate verifier using the provided hash algorithm

Types

type AnnotationsMap

type AnnotationsMap struct {
	Annotations map[string]interface{}
}

func (*AnnotationsMap) Set

func (a *AnnotationsMap) Set(s string) error

func (*AnnotationsMap) String

func (a *AnnotationsMap) String() string

Jump to

Keyboard shortcuts

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