Documentation ¶
Index ¶
- type ECKind
- type Key
- func FromBase58(privKey string, kind ECKind) (*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)
- type PubKey
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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
type PubKey ¶
type PubKey struct {
// contains filtered or unexported fields
}
PubKey is the public key to a Tezos Wallet
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