Documentation ¶
Index ¶
- func AddressFromPub(addrType AddrType, pub []byte) (addr []byte)
- func GetAllAddresses(keysDirPath string) (addresses [][]byte, err error)
- func GetKeyFile(keysDirPath string, keyAddr []byte) (fileContent []byte, err error)
- func IsEncryptedKey(ks KeyStore, keyAddr []byte) (bool, error)
- func IsValidKeyJson(j []byte) []byte
- func PKCS7Pad(in []byte) []byte
- func PKCS7Unpad(in []byte) []byte
- func Ripemd160(data ...[]byte) []byte
- func Sha256(data ...[]byte) []byte
- func Sha3(data ...[]byte) []byte
- func Verify(curveType CurveType, hash, sig, pub []byte) (bool, error)
- func WriteKeyFile(addr []byte, keysDirPath string, content []byte) (err error)
- type AddrType
- type CurveType
- type InvalidCurveErr
- type Key
- type KeyStore
- type KeyType
- type NoPrivateKeyErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddressFromPub ¶
func GetAllAddresses ¶
func GetKeyFile ¶
func IsValidKeyJson ¶
returns the address if valid, nil otherwise
func PKCS7Unpad ¶
Types ¶
type InvalidCurveErr ¶
type InvalidCurveErr string
func (InvalidCurveErr) Error ¶
func (err InvalidCurveErr) Error() string
type Key ¶
type Key struct { Id uuid.UUID // Version 4 "random" for unique id not derived from key data Type KeyType // contains curve and addr types Address []byte // reference id PrivateKey []byte // we don't store pub }
func GenerateNewKeyDefault ¶
func (*Key) MarshalJSON ¶
func (*Key) UnmarshalJSON ¶
type KeyStore ¶
type KeyStore interface { GenerateNewKey(tpy KeyType, auth string) (*Key, error) GetKey(addr []byte, auth string) (*Key, error) GetAllAddresses() ([][]byte, error) StoreKey(key *Key, auth string) error DeleteKey(addr []byte, auth string) error }
func NewKeyStorePassphrase ¶
func NewKeyStorePlain ¶
type KeyType ¶
func KeyTypeFromString ¶
type NoPrivateKeyErr ¶
type NoPrivateKeyErr string
func (NoPrivateKeyErr) Error ¶
func (err NoPrivateKeyErr) Error() string
Directories ¶
Path | Synopsis |
---|---|
Package ed25519 implements the Ed25519 signature algorithm.
|
Package ed25519 implements the Ed25519 signature algorithm. |
edwards25519
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519.
|
Package edwards25519 implements operations in GF(2**255-19) and on an Edwards curve that is isomorphic to curve25519. |
Package sha3 implements the SHA3 hash algorithm (formerly called Keccak) chosen by NIST in 2012.
|
Package sha3 implements the SHA3 hash algorithm (formerly called Keccak) chosen by NIST in 2012. |
Click to show internal directories.
Click to hide internal directories.