Example #1
0
        internal static EncryptedFileKey FromApiFileKey(ApiFileKey apiEncryptedFileKey)
        {
            EncryptedFileKey encryptedFileKey = new EncryptedFileKey {
                Key     = apiEncryptedFileKey.Key,
                Iv      = apiEncryptedFileKey.Iv,
                Tag     = apiEncryptedFileKey.Tag,
                Version = apiEncryptedFileKey.Version
            };

            return(encryptedFileKey);
        }
Example #2
0
        internal static ApiFileKey ToApiFileKey(EncryptedFileKey encryptedFileKey)
        {
            ApiFileKey apiEncryptedFileKey = new ApiFileKey {
                Key     = encryptedFileKey.Key,
                Iv      = encryptedFileKey.Iv,
                Tag     = encryptedFileKey.Tag,
                Version = encryptedFileKey.Version
            };

            return(apiEncryptedFileKey);
        }
Example #3
0
        public void FromApiFileKey()
        {
            // ARRANGE
            EncryptedFileKey expected = FactoryFile.EncryptedFileKey;

            ApiFileKey param = new ApiFileKey {
                Iv      = expected.Iv,
                Key     = expected.Key,
                Tag     = expected.Tag,
                Version = expected.Version
            };

            // ACT
            EncryptedFileKey actual = FileMapper.FromApiFileKey(param);

            // ASSERT
            Assert.Equal(expected, actual, new EncryptedFileKeyComparer());
        }