Versions in this module Expand all Collapse all v0 v0.2.3 Feb 27, 2015 v0.2.2 Feb 27, 2015 Changes in this version + const RSA + var ErrBadKeyType = errors.New("invalid or unsupported key type") + func ConfigDecodeKey(b string) ([]byte, error) + func ConfigEncodeKey(b []byte) string + func GenerateKeyPair(typ, bits int) (PrivKey, PubKey, error) + func GenerateKeyPairWithReader(typ, bits int, src io.Reader) (PrivKey, PubKey, error) + func KeyEqual(k1, k2 Key) bool + func KeyHash(k Key) ([]byte, error) + func KeyStretcher(cipherType string, hashType string, secret []byte) (StretchedKeys, StretchedKeys) + func MarshalPrivateKey(k PrivKey) ([]byte, error) + func MarshalPublicKey(k PubKey) ([]byte, error) + func MarshalRsaPrivateKey(k *RsaPrivateKey) []byte + func MarshalRsaPublicKey(k *RsaPublicKey) ([]byte, error) + type GenSharedKey func([]byte) ([]byte, error) + func GenerateEKeyPair(curveName string) ([]byte, GenSharedKey, error) + type Key interface + Bytes func() ([]byte, error) + Equals func(Key) bool + Hash func() ([]byte, error) + type PrivKey interface + Decrypt func(b []byte) ([]byte, error) + GenSecret func() []byte + GetPublic func() PubKey + Sign func([]byte) ([]byte, error) + func UnmarshalPrivateKey(data []byte) (PrivKey, error) + type PubKey interface + Encrypt func(data []byte) ([]byte, error) + Verify func(data []byte, sig []byte) (bool, error) + func UnmarshalPublicKey(data []byte) (PubKey, error) + type RsaPrivateKey struct + func UnmarshalRsaPrivateKey(b []byte) (*RsaPrivateKey, error) + func (sk *RsaPrivateKey) Bytes() ([]byte, error) + func (sk *RsaPrivateKey) Decrypt(b []byte) ([]byte, error) + func (sk *RsaPrivateKey) Equals(k Key) bool + func (sk *RsaPrivateKey) GenSecret() []byte + func (sk *RsaPrivateKey) GetPublic() PubKey + func (sk *RsaPrivateKey) Hash() ([]byte, error) + func (sk *RsaPrivateKey) Sign(message []byte) ([]byte, error) + type RsaPublicKey struct + func UnmarshalRsaPublicKey(b []byte) (*RsaPublicKey, error) + func (pk *RsaPublicKey) Bytes() ([]byte, error) + func (pk *RsaPublicKey) Encrypt(b []byte) ([]byte, error) + func (pk *RsaPublicKey) Equals(k Key) bool + func (pk *RsaPublicKey) Hash() ([]byte, error) + func (pk *RsaPublicKey) Verify(data, sig []byte) (bool, error) + type StretchedKeys struct + CipherKey []byte + IV []byte + MacKey []byte