utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNewKeysX25519 added in v1.1.0

func CreateNewKeysX25519() (*X25519.PublicKey, *X25519.PrivateKey, error)

CreateNewKeysX25519 returns a new X25519 key pair.

func CreatePrivateKeyED25519FromBase64

func CreatePrivateKeyED25519FromBase64(privateKeyBase64 string) (*ED25519.PrivateKey, error)

CreatePrivateKeyED25519FromBase64 accepts a base64 encoded ED25519 private key (88 chars) and returns an ED25519 private key.

func CreatePrivateKeyX25519FromBase64 added in v1.1.0

func CreatePrivateKeyX25519FromBase64(privateKeyBase64 string) (*X25519.PrivateKey, error)

CreatePrivateKeyX25519FromBase64 accepts a base64 encoded X25519 private key (44 chars) and returns an X25519 private key.

func CreatePublicKeyX25519FromBase64 added in v1.1.0

func CreatePublicKeyX25519FromBase64(publicKeyBase64 string) (*X25519.PublicKey, error)

CreatePublicKeyX25519FromBase64 accepts a base64 encoded X25519 public key (44 chars) and returns an X25519 public key.

func GetUri

func GetUri(basePath string, paths []string, queryValues map[string]string) (*url.URL, error)

GetUri joins the base path and paths array and adds the query values to return a new url.

func MarshalAndSortJSON

func MarshalAndSortJSON(jsonValue interface{}) ([]byte, error)

MarshalAndSortJSON sorts alphabetically the json representation of an interface and returns its marshaled value.

Types

type JSONWrapper

type JSONWrapper struct {
	Value json.RawMessage `json:"value"`
	Type  string          `json:"type"`
}

JSONWrapper wraps an interface with its corresponding custom type.

Jump to

Keyboard shortcuts

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