Versions in this module Expand all Collapse all v0 v0.0.2 Aug 3, 2018 Changes in this version + const EncryptionCipher + const PrivateKeyPEMType + const PublicKeyPEMType + var Curve = elliptic.P256() + var ErrGeneratingECDSAPublicKey = errors.New("could not generate ecdsa public key from ecdsa private key") + var ErrGeneratingECIESPrivateKey = errors.New("could not generate ecies private key from ecdsa private key") + var ErrGeneratingECIESPublicKey = errors.New("could not generate ecies public key from ecda public key") + var ErrInvalidPublicKey = errors.New("invalid public key") + var ErrNilData = errors.New("data is nil") + var ErrNilPrivateKey = errors.New("private key is nil") + var ErrNilPublicKey = errors.New("public key is nil") + var ErrNilSigParams = errors.New("r and s params cannot be nil") + var ErrNotECDSAPubKey = errors.New("not an ecdsa public key") + func DecodeAddress(address string) (*ecdsa.PublicKey, error) + func DecodePemToPrivateKey(block *pem.Block, password *string) (*ecdsa.PrivateKey, error) + func DecodePemToPublicKey(block *pem.Block, password *string) (*ecdsa.PublicKey, error) + func Decrypt(priv *ecdsa.PrivateKey, data []byte) ([]byte, error) + func DeserializePrivateKey(privBytes []byte) (*ecdsa.PrivateKey, error) + func DeserializePublicKey(pubBytes []byte) (*ecdsa.PublicKey, error) + func EncodeAddress(pub *ecdsa.PublicKey) (string, error) + func EncodePrivateKeyToPem(priv *ecdsa.PrivateKey, password *string) (*pem.Block, error) + func EncodePublicKeyToPem(pub *ecdsa.PublicKey, password *string) (*pem.Block, error) + func Encrypt(pub *ecdsa.PublicKey, data []byte) ([]byte, error) + func GetPublicKey(priv *ecdsa.PrivateKey) (*ecdsa.PublicKey, error) + func NewKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error) + func NewPrivateKey() (*ecdsa.PrivateKey, error) + func PublicKeyFromBytes(pub []byte) (*ecdsa.PublicKey, error) + func PublicKeyToBytes(pub *ecdsa.PublicKey) ([]byte, error) + func ReadKeyPairFromPem(fileName string, password *string) (*ecdsa.PrivateKey, *ecdsa.PublicKey, error) + func ReadPrivateKeyFromPem(fileName string, password *string) (*ecdsa.PrivateKey, error) + func ReadPublicKeyFromPem(fileName string, password *string) (*ecdsa.PublicKey, error) + func SerializePrivateKey(priv *ecdsa.PrivateKey) ([]byte, error) + func SerializePublicKey(pub *ecdsa.PublicKey) ([]byte, error) + func Sign(priv *ecdsa.PrivateKey, data []byte) (*big.Int, *big.Int, error) + func Verify(pub *ecdsa.PublicKey, data []byte, r, s *big.Int) (bool, error) + func WriteKeyPairToPem(priv *ecdsa.PrivateKey, pub *ecdsa.PublicKey, password *string, ...) error + func WritePrivateKeyToPemFile(priv *ecdsa.PrivateKey, password *string, fileName string) error + func WritePublicKeyToPemFile(pub *ecdsa.PublicKey, password *string, fileName string) error