Documentation
¶
Index ¶
- func AESDecrypt(password, data []byte) ([]byte, error)
- func AESEncrypt(password []byte, data []byte) ([]byte, error)
- func PGPDecryptAndVerifyMessage(privateKey *crypto.Key, publicKey *crypto.Key, message []byte) ([]byte, error)
- func PGPEncryptAndSignMessage(privateKey *crypto.Key, publicKey *crypto.Key, message []byte) ([]byte, error)
- func PGPGenerateKeyPair(accountName string) (*crypto.Key, error)
- func PGPPrivateKeyToBytes(key *crypto.Key, password string) ([]byte, error)
- func PGPPrivateKeyToMem(privateBytes []byte, password string) (*crypto.Key, error)
- func PGPPublicKeyToBytes(key *crypto.Key) ([]byte, error)
- func PGPPublicKeyToMem(publicBytes []byte) (*crypto.Key, error)
- func PackMessage(message []byte, signature []byte, pubkey []byte) (string, error)
- func RSADecryptAndVerifyMessage(receiverPrivateKey *rsa.PrivateKey, senderPublicKey *rsa.PublicKey, ...) ([]byte, error)
- func RSAEncryptAndSignMessage(senderPrivateKey *rsa.PrivateKey, recipientPublicKey *rsa.PublicKey, ...) ([]byte, []byte, error)
- func RSAGenerateKeyPair(size int) (*rsa.PrivateKey, *rsa.PublicKey, error)
- func RSAPrivateKeyToBytes(privateKey *rsa.PrivateKey, password string) ([]byte, error)
- func RSAPrivateKeyToMem(privateKeyBytes []byte, password string) (*rsa.PrivateKey, error)
- func RSAPublicKeyToBytes(publicKey *rsa.PublicKey) ([]byte, error)
- func RSAPublicKeyToMem(publicKeyPEM []byte) (*rsa.PublicKey, error)
- func UnpackMessage(message string) ([]byte, []byte, []byte, error)
- type MessageWrapper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
func PGPPrivateKeyToBytes ¶
func PGPPrivateKeyToMem ¶
func PackMessage ¶
func RSADecryptAndVerifyMessage ¶
func RSADecryptAndVerifyMessage(receiverPrivateKey *rsa.PrivateKey, senderPublicKey *rsa.PublicKey, message []byte, signature []byte) ([]byte, error)
Decrypts and verifies the message using the recipient's private key and sender's public key. Returns the decrypted message on success and an error otherwise.
func RSAEncryptAndSignMessage ¶
func RSAEncryptAndSignMessage(senderPrivateKey *rsa.PrivateKey, recipientPublicKey *rsa.PublicKey, message []byte) ([]byte, []byte, error)
Encrypts and signs the message using the sender's private key and recipient's public key. Returns the encrypted message on success and an error otherwise.
func RSAGenerateKeyPair ¶
Generates a new RSA Key Pair and returns them as pointers.
func RSAPrivateKeyToBytes ¶
func RSAPrivateKeyToBytes(privateKey *rsa.PrivateKey, password string) ([]byte, error)
Converts a Private Key to a PEM encoded byte array.
func RSAPrivateKeyToMem ¶
func RSAPrivateKeyToMem(privateKeyBytes []byte, password string) (*rsa.PrivateKey, error)
Converts a PEM encoded byte array to a Private Key Pointer.
func RSAPublicKeyToBytes ¶
Converts a Public Key to a PEM encoded byte array.
func RSAPublicKeyToMem ¶
Converts a PEM encoded byte array to a Public Key Pointer.
Types ¶
type MessageWrapper ¶
Click to show internal directories.
Click to hide internal directories.