crypto

package
v0.2.14 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: MIT Imports: 14 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt added in v0.1.7

func Decrypt(key, text []byte) ([]byte, error)

func Encrypt added in v0.1.7

func Encrypt(key, text []byte) (string, error)

func FromPrivKey added in v0.1.13

func FromPrivKey(privKey ic.PrivKey) (string, error)

func FromPubKey added in v0.1.13

func FromPubKey(pubKey ic.PubKey) (string, error)

func GenKeyPairs added in v0.1.7

func GenKeyPairs() (ic.PrivKey, ic.PubKey, error)

func GetPrivKeyFromHexOrBase64 added in v0.2.11

func GetPrivKeyFromHexOrBase64(raw string) (ic.PrivKey, error)

GetPrivKeyFromHexOrBase64 can decode a priv key from either hex or base64 format to satisfy different key storage encoding schemes

func GetPubKeyFromPeerId added in v0.1.8

func GetPubKeyFromPeerId(pid string) (ic.PubKey, error)

func Hex64ToBase64 added in v0.2.11

func Hex64ToBase64(key string) (string, error)

func Pad added in v0.1.7

func Pad(src []byte) []byte

pkcs7 padding

func Sign

func Sign(key ic.PrivKey, channelMessage proto.Message) ([]byte, error)

func ToPrivKey added in v0.1.4

func ToPrivKey(privKey string) (ic.PrivKey, error)

private key string to ic.PrivKey interface btfs config stores base64 of private key

func ToPrivKeyRaw added in v0.1.7

func ToPrivKeyRaw(privKey []byte) (ic.PrivKey, error)

Secp256k1 private key string to ic.PrivKey interface

func ToPubKey added in v0.1.4

func ToPubKey(pubKey string) (ic.PubKey, error)

public key string to ic.PubKey interface

func ToPubKeyRaw added in v0.1.7

func ToPubKeyRaw(pubKey []byte) (ic.PubKey, error)

public key string to ic.PubKey interface

func Unpad added in v0.1.7

func Unpad(src []byte) ([]byte, error)

func Verify

func Verify(key ic.PubKey, channelMessage proto.Message, sig []byte) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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