apikeys

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NIL_KEYPAIR_TYPE = iota
	HMAC_KEYPAIR_TYPE
	Ed25519_KEYPAIR_TYPE
	RSA_KEYPAIR_TYPE
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Ed25519_KeyPair

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

func (*Ed25519_KeyPair) FromBase64

func (keypair *Ed25519_KeyPair) FromBase64(APIKEY string, privateKey_base64 string) error

func (*Ed25519_KeyPair) FromFiles

func (keypair *Ed25519_KeyPair) FromFiles(APIKEY string, privateKey_path string) error

func (*Ed25519_KeyPair) GetAPIKEY

func (keypair *Ed25519_KeyPair) GetAPIKEY() string

func (*Ed25519_KeyPair) GetType

func (*Ed25519_KeyPair) GetType() int

func (*Ed25519_KeyPair) Sign

func (keypair *Ed25519_KeyPair) Sign(value string) (string, error)

type HMAC_KeyPair

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

func (*HMAC_KeyPair) FromString

func (keypair *HMAC_KeyPair) FromString(APIKEY string, APISECRET string)

func (*HMAC_KeyPair) GetAPIKEY

func (keypair *HMAC_KeyPair) GetAPIKEY() string

func (*HMAC_KeyPair) GetType

func (*HMAC_KeyPair) GetType() int

func (*HMAC_KeyPair) Sign

func (keypair *HMAC_KeyPair) Sign(value string) (string, error)

type KeyPair

type KeyPair interface {
	// Returns which APIKEY type, unlikely to be used by the developer, only used by the library itself
	GetType() int

	// Returns the APIKEY for the keypair, "" is returned if the keypair is invalid or empty
	GetAPIKEY() string

	// Creates a signature with the provided APISECRET, returns "" if the keypair is invalid or empty
	Sign(string) (string, error)
}

type Nil_KeyPair

type Nil_KeyPair struct{}

func (*Nil_KeyPair) GetAPIKEY

func (*Nil_KeyPair) GetAPIKEY() string

func (*Nil_KeyPair) GetType

func (*Nil_KeyPair) GetType() int

func (*Nil_KeyPair) Sign

func (*Nil_KeyPair) Sign(string) (string, error)

type RSA_KeyPair

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

func (*RSA_KeyPair) FromBase64

func (keypair *RSA_KeyPair) FromBase64(APIKEY string, privateKey_base64 string) error

func (*RSA_KeyPair) FromFiles

func (keypair *RSA_KeyPair) FromFiles(APIKEY string, privateKey_path string) error

func (*RSA_KeyPair) GetAPIKEY

func (keypair *RSA_KeyPair) GetAPIKEY() string

func (*RSA_KeyPair) GetType

func (keypair *RSA_KeyPair) GetType() int

func (*RSA_KeyPair) Sign

func (keypair *RSA_KeyPair) Sign(payload string) (string, error)

Jump to

Keyboard shortcuts

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