apikey

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeTKPublicKey

func DecodeTKPublicKey(encodedPublicKey string) (*ecdsa.PublicKey, error)

Takes a TK-encoded public key and creates an ECDSA public key

func EncodePrivateKey

func EncodePrivateKey(privateKey *ecdsa.PrivateKey) string

Encode an ECDSA private key into the Turnkey format For now, "Turnkey format" = raw DER form

func EncodePublicKey

func EncodePublicKey(publicKey *ecdsa.PublicKey) (string, error)

Encode an ECDSA public key into the Turnkey format. For now, "Turnkey format" = standard compressed form for ECDSA keys

func SerializeRequest

func SerializeRequest(method, host, path, body string) string

func Sign

func Sign(message string, apiKey *ApiKey) (string, error)

Types

type ApiKey

type ApiKey struct {
	TkPrivateKey string
	TkPublicKey  string
	// contains filtered or unexported fields
}

Struct to hold both serialized and ecdsa lib friendly version of a public/private key pair

func FromEcdsaPrivateKey

func FromEcdsaPrivateKey(privateKey *ecdsa.PrivateKey) (*ApiKey, error)

Takes an ECDSA private key and create a new TkApiKey. Assumes that privateKey.PublicKey has been derived.

func FromTkPrivateKey

func FromTkPrivateKey(encodedPrivateKey string) (*ApiKey, error)

Takes a TK-encoded private key and creates an ECDSA private key

func NewTkApiKey

func NewTkApiKey() (*ApiKey, error)

Create a new Turnkey API key

Jump to

Keyboard shortcuts

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