Documentation ¶
Index ¶
- func GetPkhFromBytes(b []byte) (string, error)
- func IsValidBlockHash(input string) bool
- func IsValidOperationHash(input string) bool
- func IsValidPk(pk string) bool
- func IsValidPkh(pkh string) bool
- func IsValidSignature(input string) bool
- type ECKind
- type Key
- func FromBase58(privKey string) (*Key, error)
- func FromBase64(privKey string, kind ECKind) (*Key, error)
- func FromBytes(privKey []byte, kind ECKind) (*Key, error)
- func FromEncryptedSecret(esk, passwd string) (*Key, error)
- func FromHex(privKey string, kind ECKind) (*Key, error)
- func FromMnemonic(mnemonic, email, passwd string, kind ECKind) (*Key, error)
- func Generate(kind ECKind) (*Key, error)
- func (k *Key) GetBytes() []byte
- func (k *Key) GetSecretKey() string
- func (k *Key) SignData(msg []byte, magic_bytes []byte) (Signature, error)
- func (k *Key) SignDataRaw(msg []byte) (Signature, error)
- func (k *Key) SignGeneric(msg string) (Signature, error)
- func (k *Key) SignHexRaw(msg string) (Signature, error)
- type PubKey
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPkhFromBytes ¶ added in v4.0.13
func IsValidBlockHash ¶ added in v4.0.16
func IsValidOperationHash ¶ added in v4.0.16
func IsValidPkh ¶ added in v4.0.14
func IsValidSignature ¶ added in v4.0.16
Types ¶
type ECKind ¶
type ECKind string
ECKind is the key type
const ( // Ed25519 https://tools.ietf.org/html/rfc8032 Ed25519 ECKind = "Ed25519" // Secp256k1 https://tools.ietf.org/html/rfc4492 Secp256k1 ECKind = "Secp256k1" // NistP256 https://tools.ietf.org/html/rfc5656 NistP256 ECKind = "NistP256" )
type Key ¶
type Key struct { PubKey PubKey // contains filtered or unexported fields }
Key is the cryptographic key to a Tezos Wallet
func FromBase58 ¶
FromBase58 returns a new key from a private key in base58 form
func FromBase64 ¶
FromBase64 returns a new key from a private key in base64 form
func FromEncryptedSecret ¶
FromEncryptedSecret returns a new key from an encrypted private key
func FromMnemonic ¶
FromMnemonic returns a new key from a mnemonic
func Generate ¶
Generate returns a new cryptographic key based on the kind of elliptical curve passed
- Ed25519
- Secp256k1
- NistP256
func (*Key) GetSecretKey ¶
GetSecretKey will return the base58 encoded key with the secret key prefix. This is unencrypted. Example: edskRpfRbhVr7SjmVpMK1kzTDrSzuCKroxjQAsfJn94X7LgbpqJLvRDHfNHFT9KbCZAXVVhMmkQGz4APscezMbJFov5ZNPSY9H
func (*Key) SignDataRaw ¶ added in v4.0.21
SignBytes will sign a byte message
func (*Key) SignGeneric ¶ added in v4.0.21
SignHex will sign a hex encoded string for operation, add 0x03 magic bytes
type PubKey ¶
type PubKey struct {
// contains filtered or unexported fields
}
PubKey is the public key to a Tezos Wallet
func FromBase58Pk ¶ added in v4.0.6
func (*PubKey) CheckSignature ¶ added in v4.0.14
SignBytes will sign a byte message for operation
func (*PubKey) GetAddress ¶
GetAddress will public key hash (address) of the public key. Example:
tz1L8fUQLuwRuywTZUP5JUw9LL3kJa8LMfoo
func (*PubKey) GetPublicKey ¶
GetPublicKey will return the base58 encoded key with the private key prefix. Example:
edskRpfRbhVr7SjmVpMK1kzTDrSzuCKroxjQAsfJn94X7LgbpqJLvRDHfNHFT9KbCZAXVVhMmkQGz4APscezMbJFov5ZNPSY9H
type Signature ¶
type Signature struct { Bytes []byte // contains filtered or unexported fields }
Signature represents the signature of an operation
func (*Signature) AppendToBytes ¶
AppendToBytes takes a bytes message and adds the signature to it for injection
func (*Signature) AppendToHex ¶
AppendToHex takes a hex encoded message and adds the signature to it for injection
func (*Signature) ToBase58 ¶
ToBase58 returns the signature as a base58 encoded string with the correct prefix