Documentation
¶
Overview ¶
Package internal declares a Raw private key type, only available for use in the keystore sub-tree.
Index ¶
- func Bytes(raw Raw) []byte
- func FromEncryptedJSON[E Encrypted, K any](identifier string, keyJSON []byte, password string, ...) (K, error)
- func RawBytes(key interface{ ... }) []byte
- func ToEncryptedJSON[E Encrypted, K Key](identifier string, key K, password string, scryptN, scryptP int, ...) (export []byte, err error)
- type Encrypted
- type EncryptedKeyExport
- type Key
- type Raw
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bytes ¶
Bytes is a func for accessing the internal bytes field of Raw. It is not declared as a method, because that would allow access from callers which cannot otherwise access this internal package.
func FromEncryptedJSON ¶ added in v1.0.2
func FromEncryptedJSON[E Encrypted, K any]( identifier string, keyJSON []byte, password string, passwordFunc func(string) string, privKeyToKey func(export E, rawPrivKey Raw) (K, error), ) (K, error)
FromEncryptedJSON gets key [K] from keyJSON [E] and password
func ToEncryptedJSON ¶ added in v1.0.2
func ToEncryptedJSON[E Encrypted, K Key]( identifier string, key K, password string, scryptN, scryptP int, passwordFunc func(string) string, buildExport func(id string, key K, cryptoJSON keystore.CryptoJSON) E, ) (export []byte, err error)
ToEncryptedJSON returns encrypted JSON [E] representing key [K]
Types ¶
type Encrypted ¶ added in v1.0.2
type Encrypted interface {
GetCrypto() keystore.CryptoJSON
}
type EncryptedKeyExport ¶ added in v1.0.2
type EncryptedKeyExport struct {
KeyType string `json:"keyType"`
PublicKey string `json:"publicKey"`
Crypto keystore.CryptoJSON `json:"crypto"`
}
EncryptedKeyExport represents a chain specific encrypted key
func (EncryptedKeyExport) GetCrypto ¶ added in v1.0.2
func (x EncryptedKeyExport) GetCrypto() keystore.CryptoJSON
type Raw ¶
type Raw struct {
// contains filtered or unexported fields
}
Raw is a wrapper type that holds private key bytes and is designed to prevent accidental logging. The only way to access the internal bytes (without reflection) is to use Bytes, which is only available to ancestor packages of the parent keystore/ directory.