stackapps

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SigningKeySecretType = "features.criticalstack.com/signing-key"
	SystemNamespace      = "stackapps-system"
)

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, cli client.Client, sa *featuresv1alpha1.StackApp, ns string, objs []unstructured.Unstructured, signingKeys []string) error

func CreateKeyPair

func CreateKeyPair(ctx context.Context, cli client.Client, keyName string, mut ...func(*metav1.ObjectMeta)) (*corev1.Secret, *featuresv1alpha1.VerificationKey, error)

func CreateSigningKey

func CreateSigningKey(ctx context.Context, cli client.Client, name string, mut ...func(*metav1.ObjectMeta)) (*corev1.Secret, *rsa.PublicKey, error)

func CreateStackValues

func CreateStackValues(ctx context.Context, cli client.Client, ns string) error

func EncodePublicKeyBytes

func EncodePublicKeyBytes(key *rsa.PublicKey) ([]byte, error)

func Export

func Export(ctx context.Context, cli client.Client, name string) ([]byte, error)

func GetSigningKey

func GetSigningKey(ctx context.Context, cli client.Client, name string) (*rsa.PrivateKey, error)

func SignManifests

func SignManifests(k *rsa.PrivateKey, manifests []byte) ([]byte, error)

Sign function takes PrivateKey and stackApp manifests and returns byte slice containing signature

func SigningKey

func SigningKey(name string, key *rsa.PrivateKey) *corev1.Secret

func ToManifests

func ToManifests(objs ...unstructured.Unstructured) ([]byte, error)

func Update

func Update(ctx context.Context, cli client.Client, sa *featuresv1alpha1.StackApp, ns string, objs []unstructured.Unstructured, signingKeys []string) error

func VerificationKey

func VerificationKey(name string, pub []byte) *featuresv1alpha1.VerificationKey

func VerifySignature

func VerifySignature(k *rsa.PublicKey, s []byte, manifests []byte) error

VerifySignature Takes rsa.PublicKey (rsa.PrivateKey.PublicKey), a signature and the previously signed message returns error == nil if the signature is valid

Types

This section is empty.

Jump to

Keyboard shortcuts

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