vaultsigner

package
v0.0.0-...-4ce4a32 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Ed25519Signer

type Ed25519Signer struct {
	Client     *api.Client
	KeyName    string
	KeyVersion uint
}

Ed25519Signer signer / verifier that uses the vault transit backend

func (*Ed25519Signer) Public

func (vs *Ed25519Signer) Public() crypto.PublicKey

Public returns the public key

func (*Ed25519Signer) Sign

func (vs *Ed25519Signer) Sign(rand io.Reader, message []byte, opts crypto.SignerOpts) ([]byte, error)

Sign the included message using the vault held keypair. rand and opts are not used

func (*Ed25519Signer) String

func (vs *Ed25519Signer) String() string

String returns the public key as a hex encoded string

func (*Ed25519Signer) Verify

func (vs *Ed25519Signer) Verify(message, signature []byte, opts crypto.SignerOpts) (bool, error)

Verify the included signature over message using the vault held keypair. opts are not used

type HmacSigner

type HmacSigner struct {
	Client     *api.Client
	KeyName    string
	KeyVersion uint
}

HmacSigner signer / verifier that uses the vault transit backend

func (*HmacSigner) HMACSha384

func (vs *HmacSigner) HMACSha384(message []byte) ([]byte, error)

HMACSha384 the included message using the vault held keypair

type WrappedClient

type WrappedClient struct {
	Client *api.Client
}

WrappedClient holds an api client for interacting with vault

func Connect

func Connect() (*WrappedClient, error)

Connect connects to the vaultsigner backend server, sets token written by vault

func (*WrappedClient) FromKeypair

func (wc *WrappedClient) FromKeypair(privKey ed25519.PrivateKey, pubKey ed25519.PublicKey, importName string) (*Ed25519Signer, error)

FromKeypair create a new vault transit key by importing privKey and pubKey under importName

func (*WrappedClient) GenerateEd25519Signer

func (wc *WrappedClient) GenerateEd25519Signer(name string) (*Ed25519Signer, error)

GenerateEd25519Signer create Ed25519Signer by generating a keypair with name using vault backend

func (*WrappedClient) GenerateHmacSecret

func (wc *WrappedClient) GenerateHmacSecret(name string, algo string) (*HmacSigner, error)

GenerateHmacSecret create hmac key using vault backend

func (*WrappedClient) GenerateMounts

func (wc *WrappedClient) GenerateMounts() error

GenerateMounts generates the appropriate mount points if they do not exist

func (*WrappedClient) GetEd25519Signer

func (wc *WrappedClient) GetEd25519Signer(name string) (*Ed25519Signer, error)

GetEd25519Signer gets a key pair but doesn't generate new key

func (*WrappedClient) GetHmacSecret

func (wc *WrappedClient) GetHmacSecret(name string) (*HmacSigner, error)

GetHmacSecret gets a key pair but doesn't generate new key

func (*WrappedClient) ImportHmacSecret

func (wc *WrappedClient) ImportHmacSecret(secret []byte, importName string) (*HmacSigner, error)

ImportHmacSecret create a new vault transit key by importing privKey under importName

Jump to

Keyboard shortcuts

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