signingattr

package
v2.0.0-...-98cc131 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ATTR_KEY   = "github.com/mandelsoft/ocm/signing"
	ATTR_SHORT = "signing"
)
View Source
const (
	ConfigType   = "keys" + cfgcpi.OCM_CONFIG_TYPE_SUFFIX
	ConfigTypeV1 = ConfigType + runtime.VersionSeparator + "v1"
)

Variables

This section is empty.

Functions

func Get

func Set

func Set(ctx datacontext.Context, registry signing.KeyRegistry) error

Types

type AttributeType

type AttributeType struct{}

func (AttributeType) Decode

func (a AttributeType) Decode(data []byte, unmarshaller runtime.Unmarshaler) (interface{}, error)

func (AttributeType) Description

func (a AttributeType) Description() string

func (AttributeType) Encode

func (a AttributeType) Encode(v interface{}, marshaller runtime.Marshaler) ([]byte, error)

func (AttributeType) Name

func (a AttributeType) Name() string

type Config

type Config struct {
	runtime.ObjectVersionedType `json:",inline"`
	PublicKeys                  map[string]KeySpec `json:"publicKeys"`
	PrivateKeys                 map[string]KeySpec `json:"privateKeys"`
}

Config describes a memory based repository interface.

func New

func New() *Config

New creates a new memory ConfigSpec.

func (*Config) AddPrivateKey

func (a *Config) AddPrivateKey(name string, key interface{})

func (*Config) AddPrivateKeyData

func (a *Config) AddPrivateKeyData(name string, data []byte)

func (*Config) AddPrivateKeyFile

func (a *Config) AddPrivateKeyFile(name, path string, fss ...vfs.FileSystem)

func (*Config) AddPublicKey

func (a *Config) AddPublicKey(name string, key interface{})

func (*Config) AddPublicKeyData

func (a *Config) AddPublicKeyData(name string, data []byte)

func (*Config) AddPublicKeyFile

func (a *Config) AddPublicKeyFile(name, path string, fss ...vfs.FileSystem)

func (*Config) ApplyTo

func (a *Config) ApplyTo(ctx cfgcpi.Context, target interface{}) error

func (*Config) ApplyToRegistry

func (a *Config) ApplyToRegistry(registry signing.KeyRegistry) error

func (*Config) GetType

func (a *Config) GetType() string

type KeySpec

type KeySpec struct {
	Data       RawData        `json:"data,omitempty"`
	StringData string         `json:"stringdata,omitempty"`
	Path       string         `json:"path,omitempty"`
	Parsed     interface{}    `json:"-"`
	FileSystem vfs.FileSystem `json:"-"`
}

func (*KeySpec) Get

func (k *KeySpec) Get() (interface{}, error)

type RawData

type RawData []byte

func (RawData) MarshalJSON

func (r RawData) MarshalJSON() ([]byte, error)

func (*RawData) UnmarshalJSON

func (r *RawData) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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