mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
Adding encryption decryption feature
Signed-off-by: Tarun1 Gupta <gupttaru@deshaw.com>
This commit is contained in:
@ -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()
|
||||
})
|
||||
|
||||
})
|
||||
|
Reference in New Issue
Block a user