Documentation
¶
Index ¶
- Constants
- func Decode58Check(input string) ([]byte, error)
- func Decrypt(key, text []byte) ([]byte, error)
- func EcdsaSign(ecdsa *ecdsa.PrivateKey, bytes []byte) ([]byte, error)
- func Encode58Check(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 GetRawFullFromPeerIdPretty(peerid string) ([]byte, error)
- func GetTronPubKeyFromIcPubKey(pubkey ic.PubKey) (*string, error)
- func GetTronPubKeyFromPeerIdPretty(peerId string) (*string, error)
- func GetTronPubKeyFromPubkey(pubkeyS string) (*string, error)
- func Hash(s []byte) ([]byte, error)
- func Hex64ToBase64(key string) (string, error)
- func HexToECDSA(hexkey string) (*ecdsa.PrivateKey, error)
- func Pad(src []byte) []byte
- func Secp256k1PublicKeyRaw(pk ic.PubKey) (res []byte, err error)
- 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 TronSign(privKey ic.PrivKey, msg proto.Message) ([]byte, error)
- func TronSignRaw(privKey ic.PrivKey, data []byte) ([]byte, error)
- func Unpad(src []byte) ([]byte, error)
- func Verify(key ic.PubKey, channelMessage proto.Message, sig []byte) (bool, error)
- type Address
- type Keys
Constants ¶
View Source
const ( AddressLength = 21 AddressPrefix = "41" )
Variables ¶
This section is empty.
Functions ¶
func GetPrivKeyFromHexOrBase64 ¶
GetPrivKeyFromHexOrBase64 can decode a priv key from either hex or base64 format to satisfy different key storage encoding schemes
func GetTronPubKeyFromPubkey ¶
func Hex64ToBase64 ¶
func HexToECDSA ¶
func HexToECDSA(hexkey string) (*ecdsa.PrivateKey, error)
func Secp256k1PublicKeyRaw ¶
Raw returns the bytes of the key
func ToPrivKey ¶
private key string to ic.PrivKey interface btfs config stores base64 of private key
func ToPrivKeyRaw ¶
Secp256k1 private key string to ic.PrivKey interface
func ToPubKeyRaw ¶
public key string to ic.PubKey interface
Types ¶
type Address ¶
type Address [AddressLength]byte
func AddressLedgerToTron ¶
Get Tron address from ledger address
func BytesToAddress ¶
func PublicKeyToAddress ¶
ecdsa key to Tron address
Click to show internal directories.
Click to hide internal directories.