keymanager

package
v0.0.0-...-8247dfb Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2018 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const KeyIDEnvironmentVariableName = string("SPUTNIK_CLOUDKIT_KEYID")

KeyIDEnvironmentVariableName is the constant used for identifying the Key ID environment variable

Variables

This section is empty.

Functions

This section is empty.

Types

type CloudKitKeyManager

type CloudKitKeyManager struct {
	// contains filtered or unexported fields
}

CloudKitKeyManager is a concrete KeyManager

func New

func New() CloudKitKeyManager

New returns a CloudKitKeyManager with the default secrets folder By default, a CloudKitKeyManager expects the secrets in the .sputnik folder of the home directory

func NewWithSecretsFolder

func NewWithSecretsFolder(secretsFolder string, keyIDFileName string, pemFileName string) CloudKitKeyManager

NewWithSecretsFolder returns a CloudKitKeyManager with a specific secrets folder Use this to specify a different storage location from the default

func (*CloudKitKeyManager) CreateSigningIdentity

func (c *CloudKitKeyManager) CreateSigningIdentity() error

CreateSigningIdentity creates a new signing identity.

You can paste the signing identity to your iCloud Dashboard when creating a new API Access Key.

func (*CloudKitKeyManager) ECKey

func (c *CloudKitKeyManager) ECKey() string

ECKey should be named differently. It returns the public part of the PEM encoded signing identity

func (*CloudKitKeyManager) KeyID

func (c *CloudKitKeyManager) KeyID() string

KeyID looks up the CloudKit Key ID

func (*CloudKitKeyManager) PrivateKey

func (c *CloudKitKeyManager) PrivateKey() *ecdsa.PrivateKey

PrivateKey returns the x509 private key that was generated when creating the signing identity

func (*CloudKitKeyManager) PublicKey

func (c *CloudKitKeyManager) PublicKey() *ecdsa.PublicKey

PublicKey returns the public key that was generated when creating the signing identity

func (*CloudKitKeyManager) PublicKeyString

func (c *CloudKitKeyManager) PublicKeyString() string

PublicKeyString should be named differently. It reads and returns the public part of the PEM encoded signing identity

func (*CloudKitKeyManager) RemoveSigningIdentity

func (c *CloudKitKeyManager) RemoveSigningIdentity() error

RemoveSigningIdentity removes the existing signing identity

func (*CloudKitKeyManager) SecretsFolder

func (c *CloudKitKeyManager) SecretsFolder() string

SecretsFolder returns the path to Sputnik's secrets folder

func (*CloudKitKeyManager) SigningIdentityExists

func (c *CloudKitKeyManager) SigningIdentityExists() (bool, error)

SigningIdentityExists checks if a signing identity has been created

func (*CloudKitKeyManager) StoreKeyID

func (c *CloudKitKeyManager) StoreKeyID(key string) error

StoreKeyID stores the given ID to a file in Sputnik's secrets folder

type KeyManager

type KeyManager interface {
	PublicKey() *ecdsa.PublicKey
	PrivateKey() *ecdsa.PrivateKey
	KeyID() string
	RemoveSigningIdentity() error
	StoreKeyID(key string) error
}

KeyManager exposes methods for creating, reading and removing signing identity relevant keys and IDs

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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