Beispiel #1
0
        protected object CopyTo(EncryptedHeaderBlock headerBlock)
        {
            if (headerBlock == null)
            {
                throw new ArgumentNullException("headerBlock");
            }

            headerBlock.HeaderCrypto = HeaderCrypto;
            return(headerBlock);
        }
 private void SetDataEncryptingCryptoForEncryptedHeaderBlocks(IList <HeaderBlock> headerBlocks)
 {
     foreach (HeaderBlock headerBlock in headerBlocks)
     {
         EncryptedHeaderBlock encryptedHeaderBlock = headerBlock as EncryptedHeaderBlock;
         if (encryptedHeaderBlock == null)
         {
             continue;
         }
         encryptedHeaderBlock.HeaderCrypto = GetHeaderCrypto(encryptedHeaderBlock.HeaderBlockType);
     }
 }
        private void SetMasterKeyForEncryptedHeaderBlocks(IList <HeaderBlock> headerBlocks)
        {
            ICrypto headerCrypto = Resolve.CryptoFactory.Legacy.CreateCrypto(HeadersSubkey.Key, null, 0);

            foreach (HeaderBlock headerBlock in headerBlocks)
            {
                EncryptedHeaderBlock encryptedHeaderBlock = headerBlock as EncryptedHeaderBlock;
                if (encryptedHeaderBlock != null)
                {
                    encryptedHeaderBlock.HeaderCrypto = headerCrypto;
                }
            }
        }