Documentation ¶
Overview ¶
Use this code snippet in your app. If you need more information about configurations or implementing the sample code, visit the AWS docs: https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/setting-up.html
Index ¶
- Constants
- func DecryptEvmKeyStore(ksData, pw []byte) (*ecdsa.PrivateKey, error)
- func DecryptICONKeyStore(ksData *KeyStoreData, pw []byte) (*crypto.PrivateKey, error)
- func DecryptNearKeyStore(ksData, pw []byte) (*ed25519.PrivateKey, error)
- func EncryptKeyAsKeyStore(s *crypto.PrivateKey, pw []byte) ([]byte, error)
- func GetSecret(secretName string, region string) (string, error)
- func KeyStoreFromWallet(w interface{}, pw []byte) ([]byte, error)
- func New() *softwareWallet
- func NewIcxWalletFromPrivateKey(sk *crypto.PrivateKey) (*softwareWallet, error)
- func ReadAddressFromKeyStore(data []byte) (*common.Address, error)
- func SHA3SumKeccak256(data ...[]byte) []byte
- type AES128CTRParams
- type CryptoData
- type Encrypted
- type EvmWallet
- type KeyStoreData
- type NearWallet
- type ScryptParams
- type Wallet
Constants ¶
View Source
const ( EncryptSaltSize = 4 HKDFInfo = "BTP_SECRET_HKDF" AES128KeySize = 16 HKDFKeySize = 2 * AES128KeySize )
Variables ¶
This section is empty.
Functions ¶
func DecryptEvmKeyStore ¶
func DecryptEvmKeyStore(ksData, pw []byte) (*ecdsa.PrivateKey, error)
func DecryptICONKeyStore ¶
func DecryptICONKeyStore(ksData *KeyStoreData, pw []byte) (*crypto.PrivateKey, error)
func DecryptNearKeyStore ¶
func DecryptNearKeyStore(ksData, pw []byte) (*ed25519.PrivateKey, error)
func EncryptKeyAsKeyStore ¶
func EncryptKeyAsKeyStore(s *crypto.PrivateKey, pw []byte) ([]byte, error)
func KeyStoreFromWallet ¶
func NewIcxWalletFromPrivateKey ¶
func NewIcxWalletFromPrivateKey(sk *crypto.PrivateKey) (*softwareWallet, error)
func SHA3SumKeccak256 ¶
Types ¶
type AES128CTRParams ¶
type AES128CTRParams struct {
IV common.RawHexBytes `json:"iv"`
}
type CryptoData ¶
type CryptoData struct { Cipher string `json:"cipher"` CipherParams json.RawMessage `json:"cipherparams"` CipherText common.RawHexBytes `json:"ciphertext"` KDF string `json:"kdf"` KDFParams json.RawMessage `json:"kdfparams"` MAC common.RawHexBytes `json:"mac"` }
type Encrypted ¶
func (*Encrypted) Aes128CTRStream ¶
type EvmWallet ¶
type EvmWallet struct { Skey *ecdsa.PrivateKey Pkey *ecdsa.PublicKey }
func NewEvmWalletFromPrivateKey ¶
func NewEvmWalletFromPrivateKey(sk *ecdsa.PrivateKey) (*EvmWallet, error)
type KeyStoreData ¶
type KeyStoreData struct { Address common.Address `json:"address"` ID string `json:"id"` Version int `json:"version"` CoinType string `json:"coinType"` Crypto CryptoData `json:"crypto"` }
func NewKeyStoreData ¶
func NewKeyStoreData(data []byte) (*KeyStoreData, error)
type NearWallet ¶
type NearWallet struct { Skey *ed25519.PrivateKey Pkey *ed25519.PublicKey }
func NewNearwalletFromPrivateKey ¶
func NewNearwalletFromPrivateKey(sk *ed25519.PrivateKey) (*NearWallet, error)
func (*NearWallet) Address ¶
func (w *NearWallet) Address() string
func (*NearWallet) PublicKey ¶
func (w *NearWallet) PublicKey() []byte
type ScryptParams ¶
type ScryptParams struct { DKLen int `json:"dklen"` N int `json:"n"` R int `json:"r"` P int `json:"p"` Salt common.RawHexBytes `json:"salt"` }
func (*ScryptParams) Init ¶
func (p *ScryptParams) Init() error
Click to show internal directories.
Click to hide internal directories.