Adding encryption decryption feature

Signed-off-by: Tarun1 Gupta <gupttaru@deshaw.com>
This commit is contained in:
gupttaru
2022-08-18 20:26:48 +05:30
committed by Tarun1 Gupta
parent f50ce4aea4
commit 3bb9ed4f09
19 changed files with 391 additions and 8 deletions

View File

@ -151,4 +151,20 @@ var _ = Describe("Common functions test", func() {
Entry("Docker not in cgroup file", "/tmp/cgroup.test", false, true, false),
)
It("Test WriteRSAKeyPair", func() {
fileName := "/tmp/test_key"
bitSize := 1024
publicKeyFileName, privateKeyFileName, err := WriteRSAKeyPair(fileName, bitSize)
Expect(err).To(BeNil(), "Failed to write RSA key pair to files.")
read, err := os.Open(publicKeyFileName)
Expect(err).To(BeNil(), "Cannot find the public key file after we write it.")
defer read.Close()
read, err = os.Open(privateKeyFileName)
Expect(err).To(BeNil(), "Cannot find the private key file after we write it.")
defer read.Close()
})
})