crypto

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2019 License: MIT Imports: 11 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 GenKeyPairs added in v0.1.7

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

func GetPubKeyFromPeerId added in v0.1.8

func GetPubKeyFromPeerId(pid string) (ic.PubKey, 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