keystore

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package keystore implements the ACI keystore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckSignature

func CheckSignature(prefix string, signed, signature io.Reader) (*openpgp.Entity, error)

CheckSignature is a convenience method for creating a Keystore with a default configuration and invoking CheckSignature.

Types

type Config

type Config struct {
	RootPath         string
	PrefixPath       string
	SystemRootPath   string
	SystemPrefixPath string
}

A Config structure is used to configure a Keystore.

type Keystore

type Keystore struct {
	*Config
}

A Keystore represents a repository of trusted keys which can be used to verify ACI images.

func New

func New(config *Config) *Keystore

New returns a new Keystore based on config.

func NewTestKeystore

func NewTestKeystore() (*Keystore, string, error)

NewTestKeystore creates a new KeyStore backed by a temp directory. NewTestKeystore returns a KeyStore, the path to the temp directory, and an error if any.

func (*Keystore) CheckSignature

func (ks *Keystore) CheckSignature(prefix string, signed, signature io.Reader) (*openpgp.Entity, error)

CheckSignature takes a signed file and a detached signature and returns the signer if the signature is signed by a trusted signer. If the signer is unknown or not trusted, opengpg.ErrUnknownIssuer is returned.

func (*Keystore) DeleteTrustedKeyPrefix

func (ks *Keystore) DeleteTrustedKeyPrefix(prefix, fingerprint string) error

DeleteTrustedKeyPrefix deletes the prefix trusted key identified by fingerprint.

func (*Keystore) DeleteTrustedKeyRoot

func (ks *Keystore) DeleteTrustedKeyRoot(fingerprint string) error

DeleteTrustedKeyRoot deletes the root trusted key identified by fingerprint.

func (*Keystore) MaskTrustedKeySystemPrefix

func (ks *Keystore) MaskTrustedKeySystemPrefix(prefix, fingerprint string) (string, error)

MaskTrustedKeySystemPrefix masks the system prefix trusted key identified by fingerprint.

func (*Keystore) MaskTrustedKeySystemRoot

func (ks *Keystore) MaskTrustedKeySystemRoot(fingerprint string) (string, error)

MaskTrustedKeySystemRoot masks the system root trusted key identified by fingerprint.

func (*Keystore) StoreTrustedKeyPrefix

func (ks *Keystore) StoreTrustedKeyPrefix(prefix string, r io.Reader) (string, error)

StoreTrustedKeyPrefix stores the contents of public key r as a prefix trusted key.

func (*Keystore) StoreTrustedKeyRoot

func (ks *Keystore) StoreTrustedKeyRoot(r io.Reader) (string, error)

StoreTrustedKeyRoot stores the contents of public key r as a root trusted key.

Directories

Path Synopsis
Package keystoretest provides utilities for ACI keystore testing.
Package keystoretest provides utilities for ACI keystore testing.

Jump to

Keyboard shortcuts

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