secrets

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: Apache-2.0 Imports: 10 Imported by: 28

Documentation

Overview

Copyright 2018 Google LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// Public Key constant for Attestation Secrets.
	PrivateKey = "private"
	// Private Key constant for Attestation Secrets.
	PublicKey = "public"
	// Passphrase constant for Attestation Secrets.
	Passphrase = "passphrase"
)

Variables

This section is empty.

Functions

func KeyAndFingerprint added in v0.2.0

func KeyAndFingerprint(publicKeyData string) (key, fingerprint string, err error)

KeyAndFingerprint returns the key and the fingerprint from the base64 encoded public key data

Types

type Fetcher

type Fetcher func(namespace string, name string) (*PGPSigningSecret, error)

Fetcher is the function used to fetch kubernetes secret.

type PGPSigningSecret

type PGPSigningSecret struct {
	PgpKey     *PgpKey
	SecretName string
}

PGPSigningSecret represents gpg private/public key pair secret in your kubernetes cluster, where private key was decrypted with the passphrase. The secret expects private and public key to be stored in "private" and "public" keys, and private key to be decrypted with the "passphrase" key e.g. kubectl create secret generic my-secret --from-file=public=pub.gpg \ --from-file=private=priv.key --from-literal=passphrase=<value>

func Fetch

func Fetch(namespace string, name string) (*PGPSigningSecret, error)

Fetch fetches kubernetes secret

type PgpKey

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

PgpKey struct converts the base64 encoded PEM keys into openpgp private and public keys

func NewPgpKey

func NewPgpKey(privateKeyStr string, passphrase string, publicKeyStr string) (*PgpKey, error)

func (*PgpKey) Fingerprint

func (key *PgpKey) Fingerprint() string

func (*PgpKey) PrivateKey

func (key *PgpKey) PrivateKey() *packet.PrivateKey

func (*PgpKey) PublicKey

func (key *PgpKey) PublicKey() *packet.PublicKey

type SecretTestData added in v0.1.1

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

Jump to

Keyboard shortcuts

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