Documentation ¶
Index ¶
- func DecryptAES(key, data []byte) ([]byte, error)
- func DecryptRSA(msg []byte, pk *rsa.PrivateKey, label []byte) ([]byte, error)
- func ECDSAPrivateKeyFromBytes(data []byte) (*ecdsa.PrivateKey, error)
- func ECDSAPrivateKeyToBytes(pk *ecdsa.PrivateKey) ([]byte, error)
- func ECDSAPublicKeyFromBytes(pub []byte) (*ecdsa.PublicKey, error)
- func ECDSAPublicKeyToBytes(pub *ecdsa.PublicKey) ([]byte, error)
- func EncryptAES(key, data []byte) ([]byte, error)
- func EncryptRSA(msg []byte, pub *rsa.PublicKey, label []byte) ([]byte, error)
- func GenerateECDSAKeyPair(c elliptic.Curve) (*ecdsa.PrivateKey, *ecdsa.PublicKey, error)
- func GenerateRSAKeyPair(bits int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func RSAPrivateKeyFromBytes(data []byte) (*rsa.PrivateKey, error)
- func RSAPrivateKeyToBytes(pk *rsa.PrivateKey) []byte
- func RSAPublicKeyFromBytes(pub []byte) (*rsa.PublicKey, error)
- func RSAPublicKeyToBytes(pub *rsa.PublicKey) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptAES ¶
DecryptAES decrypts data with AES key
func DecryptRSA ¶
DecryptRSA decrypts data with RSA private key
func ECDSAPrivateKeyFromBytes ¶ added in v0.2.0
func ECDSAPrivateKeyFromBytes(data []byte) (*ecdsa.PrivateKey, error)
ECDSAPrivateKeyFromBytes bytes to ECDSA private key
func ECDSAPrivateKeyToBytes ¶ added in v0.2.0
func ECDSAPrivateKeyToBytes(pk *ecdsa.PrivateKey) ([]byte, error)
ECDSAPrivateKeyToBytes ECDSA private key to bytes
func ECDSAPublicKeyFromBytes ¶ added in v0.2.0
ECDSAPublicKeyFromBytes bytes to ECDSA public key
func ECDSAPublicKeyToBytes ¶ added in v0.2.0
ECDSAPublicKeyToBytes ECDSA public key to bytes
func EncryptAES ¶
EncryptAES encrypts data with AES key
func EncryptRSA ¶
EncryptRSA encrypts data with RSA public key
func GenerateECDSAKeyPair ¶ added in v0.2.0
GenerateECDSAKeyPair generates a new ECDSA key pair
func GenerateRSAKeyPair ¶ added in v0.2.0
GenerateRSAKeyPair generates a new RSA key pair
func RSAPrivateKeyFromBytes ¶ added in v0.2.0
func RSAPrivateKeyFromBytes(data []byte) (*rsa.PrivateKey, error)
RSAPrivateKeyFromBytes bytes to RSA private key
func RSAPrivateKeyToBytes ¶ added in v0.2.0
func RSAPrivateKeyToBytes(pk *rsa.PrivateKey) []byte
RSAPrivateKeyToBytes RSA private key to bytes
func RSAPublicKeyFromBytes ¶ added in v0.2.0
RSAPublicKeyFromBytes bytes to RSA public key
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.