Documentation
¶
Index ¶
- Variables
- func ClientIDAndSecretKey(prv ed25519.PrivateKey) (ID string, secret []byte, err error)
- func DecodeKey(key string) (d []byte, err error)
- func EncodeKey(key []byte) string
- func FatalError(err error, m string)
- func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
- func InstallHTML() string
- func MustDecodeKey(key string) []byte
- func PanicError(err error, m string)
- func Print(v ...interface{})
- func PrintError(err error, m string)
- func PrintKey()
- func Sign(priv ed25519.PrivateKey, message []byte) ([]byte, error)
- func TestError(t *testing.T, v ...interface{})
- func TestErrorf(t *testing.T, format string, v ...interface{})
- func TestLog(t *testing.T, v ...interface{})
- func TestLogf(t *testing.T, format string, v ...interface{})
- func Verbose(v ...interface{})
- func Verify(pub ed25519.PublicKey, message, sign []byte) (bool, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // PrivateKey is the private key PrivateKey ed25519.PrivateKey = MustDecodeKey(os.Getenv("PRIVATE_KEY")) // PublicKey is the private key PublicKey ed25519.PublicKey = MustDecodeKey(os.Getenv("PUBLIC_KEY")) )
Functions ¶
func ClientIDAndSecretKey ¶
func ClientIDAndSecretKey(prv ed25519.PrivateKey) (ID string, secret []byte, err error)
ClientIDAndSecretKey generate new signed client and secret key
func FatalError ¶
FatalError print error(if any) and exists the program
func GenerateKey ¶
func GenerateKey() (ed25519.PublicKey, ed25519.PrivateKey, error)
GenerateKey generate new private and public key
func PrintError ¶
PrintError just print an error(if any) as warning
func Sign ¶
func Sign(priv ed25519.PrivateKey, message []byte) ([]byte, error)
Sign signs the message with privateKey and returns a signature. it returns nil of []byte and error if the size of the private key is not equal to 64
func TestErrorf ¶
TestErrorf equivalent to t.Errorf with colors
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.