Documentation ¶
Index ¶
- func DecodeTKPublicKey(encodedPublicKey string) (*ecdsa.PublicKey, error)
- func EncodePrivateKey(privateKey *ecdsa.PrivateKey) string
- func EncodePublicKey(publicKey *ecdsa.PublicKey) (string, error)
- func SerializeRequest(method, host, path, body string) string
- func Sign(message string, apiKey *ApiKey) (string, error)
- type ApiKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeTKPublicKey ¶
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 ¶
Encode an ECDSA public key into the Turnkey format. For now, "Turnkey format" = standard compressed form for ECDSA keys
func SerializeRequest ¶
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 ¶
Takes a TK-encoded private key and creates an ECDSA private key
Click to show internal directories.
Click to hide internal directories.