Documentation ¶
Index ¶
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 GenerateKey ¶
GenerateKey returns a new cryptographic key based on the kind of elliptical curve passed
- Ed25519
- Secp256k1
- NistP256
func NewKey ¶
func NewKey(input NewKeyInput) (Key, error)
NewKey gets a new Key based on the input passed
func (*Key) GetSecretKey ¶
GetSecretKey will return the base58 encoded key with the secret key prefix. This is unencrypted. Example: edskRpfRbhVr7SjmVpMK1kzTDrSzuCKroxjQAsfJn94X7LgbpqJLvRDHfNHFT9KbCZAXVVhMmkQGz4APscezMbJFov5ZNPSY9H
func (*Key) Verify ¶
func (k *Key) Verify(input VerifyInput) bool
Verify will verify the authenticity of the public key, signature and data.
type NewKeyInput ¶
type NewKeyInput struct { Bytes []byte EncodedString string Esk string Password string Mnemonic string Email string Kind ECKind `validate:"required"` }
NewKeyInput is the input for the keys.NewKey function.
Note:
You can generate a key with the following combinations: * Bytes * EncodedString: hex, base64, or base58 * Esk & Password * Mnemonic * Mnemonic & Password * Mnemonic & Password & Email
Function:
func NewKey(input NewKeyInput) (Key, error) {}
type NewPubKeyInput ¶
NewPubKeyInput is the input for the keys.NewPubKey function.
Notes:
The public key can be derived by Bytes, or a String that is encoded in hex, base64, or base58.
Function:
func NewPubKey(input NewPubKeyInput) (PubKey, error) {}
type PubKey ¶
type PubKey struct {
// contains filtered or unexported fields
}
PubKey is the public key to a Tezos Wallet
func GeneratePubKey ¶
GeneratePubKey returns a new cryptographic key based on the kind of elliptical curve passed
- Ed25519
- Secp256k1
- NistP256
func NewPubKey ¶
func NewPubKey(input NewPubKeyInput) (PubKey, error)
NewPubKey gets a new PubKey based on the input passed
func (*PubKey) GetPublicKey ¶
GetPublicKey will return the base58 encoded key with the private key prefix. Example:
edskRpfRbhVr7SjmVpMK1kzTDrSzuCKroxjQAsfJn94X7LgbpqJLvRDHfNHFT9KbCZAXVVhMmkQGz4APscezMbJFov5ZNPSY9H
func (*PubKey) GetPublicKeyHash ¶
GetPublicKeyHash will public key hash (address) of the public key. Example:
tz1L8fUQLuwRuywTZUP5JUw9LL3kJa8LMfoo
func (*PubKey) Verify ¶
func (p *PubKey) Verify(input VerifyInput) bool
Verify will verify the authenticity of the public key, signature and data.
type SignInput ¶
SignInput is the input for the key.Sign function.
Note:
You can sign with the following combinations: * Message or * Bytes
Function:
func FromMnemonic(input FromMnemonicInput) (Key, error) {}
type Signature ¶
Signature represents the signature of an operation
func (*Signature) ToBase58 ¶
ToBase58 returns the signature as a base58 encoded string with the correct prefix
type VerifyInput ¶
VerifyInput is the input for the key.Verify function.
Note:
You can verify with the following combinations: * BytesData & BytesSignature * Data & Signature
Function:
func Verify(input VerifyInput) bool {}