Merge pull request #16329 from gupttaru/encryption-decryption-feature

Add encryption decryption feature
This commit is contained in:
OpenShift Merge Robot
2022-11-28 06:33:59 -05:00
committed by GitHub
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()
})
})