Documentation ¶
Index ¶
- Constants
- func Decrypt(key, text []byte) ([]byte, error)
- func Encode58CheckBytes(input []byte) (string, error)
- func Encrypt(key, text []byte) (string, error)
- func FromHex(input string) ([]byte, error)
- func FromPrivKey(privKey ic.PrivKey) (string, error)
- func FromPubKey(pubKey ic.PubKey) (string, error)
- func GenKeyPairs() (ic.PrivKey, ic.PubKey, error)
- func GetPrivKeyFromHexOrBase64(raw string) (ic.PrivKey, error)
- func GetPubKeyFromPeerId(pid string) (ic.PubKey, error)
- func GetTronPubKeyFromPeerIdPretty(peerId string) (*string, error)
- func Hex64ToBase64(key string) (string, error)
- func Pad(src []byte) []byte
- func Sign(key ic.PrivKey, channelMessage proto.Message) ([]byte, error)
- func ToPrivKey(privKey string) (ic.PrivKey, error)
- func ToPrivKeyRaw(privKey []byte) (ic.PrivKey, error)
- func ToPubKey(pubKey string) (ic.PubKey, error)
- func ToPubKeyRaw(pubKey []byte) (ic.PubKey, error)
- func Unpad(src []byte) ([]byte, error)
- func Verify(key ic.PubKey, channelMessage proto.Message, sig []byte) (bool, error)
- type TronAddress
Constants ¶
View Source
const ( AddressLength = 21 AddressPrefix = "41" )
Variables ¶
This section is empty.
Functions ¶
func Encode58CheckBytes ¶
func GetPrivKeyFromHexOrBase64 ¶ added in v0.2.11
GetPrivKeyFromHexOrBase64 can decode a priv key from either hex or base64 format to satisfy different key storage encoding schemes
func GetTronPubKeyFromPeerIdPretty ¶ added in v0.7.16
func Hex64ToBase64 ¶ added in v0.2.11
func ToPrivKey ¶ added in v0.1.4
private key string to ic.PrivKey interface btfs config stores base64 of private key
func ToPrivKeyRaw ¶ added in v0.1.7
Secp256k1 private key string to ic.PrivKey interface
func ToPubKeyRaw ¶ added in v0.1.7
public key string to ic.PubKey interface
Types ¶
type TronAddress ¶
type TronAddress [AddressLength]byte
func BytesToAddress ¶ added in v0.5.5
func BytesToAddress(b []byte) TronAddress
func EcdsaPublicKeyToAddress ¶ added in v0.7.16
func EcdsaPublicKeyToAddress(p ecdsa.PublicKey) (TronAddress, error)
func (*TronAddress) Bytes ¶
func (a *TronAddress) Bytes() []byte
Click to show internal directories.
Click to hide internal directories.