Documentation
¶
Index ¶
- func GenerateEd25519KeyPairHex() (string, string, error)
- func UnwrapTinkKeyset(wrapped WrappedTinkKeyset, password string) (*keyset.Handle, error)
- type EncryptionFile
- func (e *EncryptionFile) Decrypt(localFile LocalEncryptedWalletFile, password string) ([]byte, error)
- func (e *EncryptionFile) Encrypt(data []byte, password string) (*LocalEncryptedWalletFile, error)
- func (e *EncryptionFile) Read() (*LocalEncryptedWalletFile, error)
- func (e *EncryptionFile) Write(localFile LocalEncryptedWalletFile) error
- type EncryptionKey
- type IEncryptionFile
- type IEncryptionKey
- type IWalletManager
- type KeysetKDFParams
- type LocalEncryptedWalletFile
- type PasswordAEAD
- type SignTransactionInput
- type WalletAction
- type WalletFile
- type WalletManager
- func (w *WalletManager) ChangePassword(currentPassword string, newPassword string) error
- func (w *WalletManager) ImportPrivateKey(privateKey []byte, password string) error
- func (w *WalletManager) IsUnlocked() bool
- func (w *WalletManager) Lock() error
- func (w *WalletManager) OwnerAddress() string
- func (w *WalletManager) SignPreparedTransaction(input protocol.PreparedTransaction) (protocol.SignedTransaction, error)
- func (w *WalletManager) SignTransaction(input SignTransactionInput) (*transaction.Transaction, error)
- func (w *WalletManager) UnlockWithPassword(password string) error
- type WrappedTinkKeyset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func UnwrapTinkKeyset ¶
func UnwrapTinkKeyset(wrapped WrappedTinkKeyset, password string) (*keyset.Handle, error)
Types ¶
type EncryptionFile ¶
type EncryptionFile struct {
FilePath string
}
func (*EncryptionFile) Decrypt ¶
func (e *EncryptionFile) Decrypt(localFile LocalEncryptedWalletFile, password string) ([]byte, error)
func (*EncryptionFile) Encrypt ¶
func (e *EncryptionFile) Encrypt(data []byte, password string) (*LocalEncryptedWalletFile, error)
func (*EncryptionFile) Read ¶
func (e *EncryptionFile) Read() (*LocalEncryptedWalletFile, error)
func (*EncryptionFile) Write ¶
func (e *EncryptionFile) Write(localFile LocalEncryptedWalletFile) error
type EncryptionKey ¶
func (*EncryptionKey) DecryptPrivateKey ¶
func (e *EncryptionKey) DecryptPrivateKey(encryptedPrivateKey []byte) ([]byte, error)
func (*EncryptionKey) EncryptPrivateKey ¶
func (e *EncryptionKey) EncryptPrivateKey(privateKey []byte) ([]byte, error)
type IEncryptionFile ¶
type IEncryptionFile interface {
Encrypt(data []byte, password string) (*LocalEncryptedWalletFile, error)
Decrypt(localFile LocalEncryptedWalletFile, password string) ([]byte, error)
Write(localFile LocalEncryptedWalletFile) error
Read() (*LocalEncryptedWalletFile, error)
}
func NewEncryptionFile ¶
func NewEncryptionFile(filePath string) IEncryptionFile
type IEncryptionKey ¶
type IEncryptionKey interface {
NewAEAD() (*keyset.Handle, error)
LoadAEAD(kh *keyset.Handle) error
EncryptPrivateKey(privateKey []byte) ([]byte, error)
DecryptPrivateKey(encryptedPrivateKey []byte) ([]byte, error)
}
func NewEncryption ¶
func NewEncryption(owner string) IEncryptionKey
type IWalletManager ¶
type IWalletManager interface {
ImportPrivateKey(privateKey []byte, password string) error
Lock() error
UnlockWithPassword(password string) error
IsUnlocked() bool
ChangePassword(currentPassword string, newPassword string) error
OwnerAddress() string
SignTransaction(input SignTransactionInput) (*transaction.Transaction, error)
SignPreparedTransaction(input protocol.PreparedTransaction) (protocol.SignedTransaction, error)
}
func NewWalletManager ¶
func NewWalletManager(filePath string) IWalletManager
type KeysetKDFParams ¶
type KeysetKDFParams struct {
Alg string `json:"alg"`
Time uint32 `json:"time"`
MemoryKB uint32 `json:"memory_kb"`
Parallel uint8 `json:"parallel"`
KeyLen uint32 `json:"key_len"`
Salt []byte `json:"salt"`
}
func NewKeysetKDFParams ¶
func NewKeysetKDFParams() (KeysetKDFParams, error)
type LocalEncryptedWalletFile ¶
type LocalEncryptedWalletFile struct {
KDF KeysetKDFParams `json:"kdf"`
Cipher []byte `json:"cipher"`
}
type PasswordAEAD ¶
type PasswordAEAD struct {
// contains filtered or unexported fields
}
func NewPasswordAEAD ¶
func NewPasswordAEAD(password string, params KeysetKDFParams) (*PasswordAEAD, error)
type SignTransactionInput ¶
type WalletAction ¶
type WalletAction string
const ( ActionExportPrivateKey WalletAction = "export_private_key" ActionChangePassword WalletAction = "change_password" ActionDeleteWallet WalletAction = "delete_wallet" ActionWithdraw WalletAction = "withdraw" )
type WalletFile ¶
type WalletManager ¶
type WalletManager struct {
// contains filtered or unexported fields
}
func (*WalletManager) ChangePassword ¶
func (w *WalletManager) ChangePassword(currentPassword string, newPassword string) error
func (*WalletManager) ImportPrivateKey ¶
func (w *WalletManager) ImportPrivateKey(privateKey []byte, password string) error
func (*WalletManager) IsUnlocked ¶
func (w *WalletManager) IsUnlocked() bool
func (*WalletManager) Lock ¶
func (w *WalletManager) Lock() error
func (*WalletManager) OwnerAddress ¶
func (w *WalletManager) OwnerAddress() string
func (*WalletManager) SignPreparedTransaction ¶
func (w *WalletManager) SignPreparedTransaction(input protocol.PreparedTransaction) (protocol.SignedTransaction, error)
func (*WalletManager) SignTransaction ¶
func (w *WalletManager) SignTransaction(input SignTransactionInput) (*transaction.Transaction, error)
func (*WalletManager) UnlockWithPassword ¶
func (w *WalletManager) UnlockWithPassword(password string) error
type WrappedTinkKeyset ¶
type WrappedTinkKeyset struct {
KDF KeysetKDFParams `json:"kdf"`
EncryptedKeysetJSON []byte `json:"encrypted_keyset_json"`
}
func WrapTinkKeyset ¶
func WrapTinkKeyset(kh *keyset.Handle, password string) (WrappedTinkKeyset, error)
Click to show internal directories.
Click to hide internal directories.