Documentation
¶
Index ¶
- func ExportPrivateKeyPEM(privateKey crypto.PrivateKey) ([]byte, error)
- func ExportPublicKeyPEM(publicKey crypto.PublicKey) ([]byte, error)
- func ExtractPublicKey(privateKey crypto.PrivateKey) crypto.PublicKey
- func GeneratePrivateKeyEthereum() (crypto.PrivateKey, error)
- func GetPublicKeyFromFile(file string) (string, error)
- func ImportPrivateKeyPEM(pemEncoded []byte) (crypto.PrivateKey, error)
- func ImportPublicKeyPEM(pemEncoded []byte) (crypto.PublicKey, error)
- func MustConvertPrivateKeyToEcdsa(privateKey crypto.PrivateKey) *ecdsa.PrivateKey
- func MustConvertPublicKeyToEcdsa(publicKey crypto.PublicKey) *ecdsa.PublicKey
- type KeyPair
- type KeyPairXCrypto
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExportPrivateKeyPEM ¶ added in v1.3.1
func ExportPublicKeyPEM ¶ added in v1.3.1
func ExtractPublicKey ¶ added in v1.3.1
func ExtractPublicKey(privateKey crypto.PrivateKey) crypto.PublicKey
func GeneratePrivateKeyEthereum ¶ added in v1.3.1
func GeneratePrivateKeyEthereum() (crypto.PrivateKey, error)
func GetPublicKeyFromFile ¶
GetPublicKeyFromFile reads private/public keys pair from json file and return public key
func ImportPrivateKeyPEM ¶ added in v1.3.1
func ImportPublicKeyPEM ¶ added in v1.3.1
func MustConvertPrivateKeyToEcdsa ¶ added in v1.3.1
func MustConvertPrivateKeyToEcdsa(privateKey crypto.PrivateKey) *ecdsa.PrivateKey
func MustConvertPublicKeyToEcdsa ¶ added in v1.3.1
Types ¶
type KeyPair ¶
type KeyPair struct { Private crypto.PrivateKey Public crypto.PublicKey }
KeyPair holds private/public keys pair.
func GenerateKeyPair ¶
GenerateKeyPair generates private/public keys pair. It uses default platform policy.
func ReadKeys ¶
ReadKeysFile reads and parses json from reader, returns parsed private/public keys pair.
func ReadKeysFile ¶
ReadKeysFile reads private/public keys pair from json file.
func ReadKeysFromDir ¶
ReadKeysFromDir reads directory, tries to parse every file in it as json with private/public keys pair returns list of parsed private/public keys pairs.
type KeyPairXCrypto ¶ added in v1.3.1
type KeyPairXCrypto struct { Private crypto.PrivateKey Public crypto.PublicKey }
KeyPairXCrypto holds private/public keys pair from x-crypto package.
func ReadXCryptoKeys ¶ added in v1.3.1
func ReadXCryptoKeys(r io.Reader, publicOnly bool) (*KeyPairXCrypto, error)
ReadXCryptoKeys reads and parses json from reader, returns parsed private/public keys pair.
func ReadXCryptoKeysFile ¶ added in v1.3.1
func ReadXCryptoKeysFile(file string, publicOnly bool) (*KeyPairXCrypto, error)
ReadXCryptoKeysFile reads private/public keys pair from json file.