private void TestGetEnvelopeEncryptionBytes() { IEnvelopeEncryption <byte[]> envelopeEncryption = sessionFactory.GetEnvelopeEncryptionBytes(TestPartitionId); Assert.NotNull(envelopeEncryption); }
public void ParameterizedTests( IEnvelopeEncryption <byte[]> envelopeEncryptionJson, Mock <IMetastore <JObject> > metastore, KeyState cacheIK, KeyState metaIK, KeyState cacheSK, KeyState metaSK, Partition partition) { using (Session <JObject, byte[]> sessionJsonImpl = new SessionJsonImpl <byte[]>(envelopeEncryptionJson)) { EncryptMetastoreInteractions encryptMetastoreInteractions = new EncryptMetastoreInteractions(cacheIK, metaIK, cacheSK, metaSK); DecryptMetastoreInteractions decryptMetastoreInteractions = new DecryptMetastoreInteractions(cacheIK, cacheSK); // encrypt with library object(sessionJsonImpl) byte[] encryptedPayload = sessionJsonImpl.Encrypt(payload); Assert.NotNull(encryptedPayload); VerifyEncryptFlow(metastore, encryptMetastoreInteractions, partition); metastore.Invocations.Clear(); JObject decryptedPayload = sessionJsonImpl.Decrypt(encryptedPayload); VerifyDecryptFlow(metastore, decryptMetastoreInteractions, partition); Assert.True(JToken.DeepEquals(payload, decryptedPayload)); } }
public void ParameterizedTests( IEnvelopeEncryption <byte[]> envelopeEncryptionJson, Mock <MemoryPersistenceImpl <JObject> > metastorePersistence, KeyState cacheIK, KeyState metaIK, KeyState cacheSK, KeyState metaSK, AppEncryptionPartition appEncryptionPartition) { using (AppEncryption <JObject, byte[]> appEncryptionJsonImpl = new AppEncryptionJsonImpl <byte[]>(envelopeEncryptionJson)) { EncryptMetastoreInteractions encryptMetastoreInteractions = new EncryptMetastoreInteractions(cacheIK, metaIK, cacheSK, metaSK); DecryptMetastoreInteractions decryptMetastoreInteractions = new DecryptMetastoreInteractions(cacheIK, cacheSK); // encrypt with library object(appEncryptionJsonImpl) byte[] encryptedPayload = appEncryptionJsonImpl.Encrypt(payload); Assert.NotNull(encryptedPayload); VerifyEncryptFlow(metastorePersistence, encryptMetastoreInteractions, appEncryptionPartition); metastorePersistence.Reset(); JObject decryptedPayload = appEncryptionJsonImpl.Decrypt(encryptedPayload); VerifyDecryptFlow(metastorePersistence, decryptMetastoreInteractions, appEncryptionPartition); Assert.True(JToken.DeepEquals(payload, decryptedPayload)); } }
public Session <byte[], byte[]> GetSessionBytes(string partitionId) { IEnvelopeEncryption <byte[]> envelopeEncryption = GetEnvelopeEncryptionBytes(partitionId); return(new SessionBytesImpl <byte[]>(envelopeEncryption)); }
public Session <byte[], JObject> GetSessionBytesAsJson(string partitionId) { IEnvelopeEncryption <JObject> envelopeEncryption = GetEnvelopeEncryptionJson(partitionId); return(new SessionBytesImpl <JObject>(envelopeEncryption)); }
public SessionJsonImpl(IEnvelopeEncryption <TD> envelopeEncryption) { this.envelopeEncryption = envelopeEncryption; }
public AppEncryptionBytesImpl(IEnvelopeEncryption <TD> envelopeEncryption) { this.envelopeEncryption = envelopeEncryption; }
public AppEncryption <JObject, byte[]> GetAppEncryptionJson(string partitionId) { IEnvelopeEncryption <byte[]> envelopeEncryption = GetEnvelopeEncryptionBytes(partitionId); return(new AppEncryptionJsonImpl <byte[]>(envelopeEncryption)); }
public AppEncryption <JObject, JObject> GetAppEncryptionJsonAsJson(string partitionId) { IEnvelopeEncryption <JObject> envelopeEncryption = GetEnvelopeEncryptionJson(partitionId); return(new AppEncryptionJsonImpl <JObject>(envelopeEncryption)); }
public EnvelopeEncryptionBytesImpl(IEnvelopeEncryption <JObject> envelopeEncryptionJson) { this.envelopeEncryptionJson = envelopeEncryptionJson; }