Beispiel #1
0
        /// <summary>
        /// Decrypts the <see cref="FileIndex"/> data structure contained in the given <see cref="EncryptedPacket"/>.
        /// </summary>
        /// <param name="encryptedPacket">The encrypted data to decrypt the <see cref="FileIndex"/> from.</param>
        /// <param name="archiveKey">The key used for decryption.</param>
        /// <param name="securitySettings">The <see cref="SecuritySettings"/> for the secure archive.</param>
        /// <returns>The decrypted <see cref="FileIndex"/>.</returns>
        public static FileIndex DecryptFrom(
            EncryptedPacket encryptedPacket,
            ArchiveKey archiveKey,
            SecuritySettings securitySettings)
        {
            var indexEntries = JsonHelpers.DecryptAndDeserialize <List <FileIndexEntry> >(
                encryptedPacket,
                archiveKey,
                securitySettings);

            return(new FileIndex(indexEntries));
        }