Provider for bulk encryption algorithms (e.g. AES).
Inheritance: CryptoProviderBulk
コード例 #1
0
ファイル: JWE.cs プロジェクト: hallambaker/Mathematical-Mesh
 /// <summary>
 /// Construct a JWE encryption object and encrypt the specified data
 /// using the specified encryption provider.
 /// </summary>
 /// <param name="Encryptor">Encryption provider to use.</param>
 /// <param name="Data">The data to be encrypted.</param>
 public JoseWebEncryption(byte[] Data, CryptoProviderEncryption Encryptor) {
     Encrypt(Data, Encryptor);
     }
コード例 #2
0
ファイル: JWE.cs プロジェクト: hallambaker/Mathematical-Mesh
        /// <summary>
        /// Create a new encryption context and encrypt the data under the 
        /// generated content key and IV.
        /// </summary>
        /// <param name="Data">The data to encrypt</param>
        /// <param name="Encryptor">The encryption provider to use.</param>
        public void Encrypt(byte[] Data, CryptoProviderEncryption Encryptor) {
            //Trace.WriteHex("Encryption Key", Encryptor.Key);


            CryptoData = Encryptor.Encrypt(Data);
            var Preheader = new Header(Encryptor);
            Protected = Preheader.GetBytes(false); // get the data bytes untagged
            IV = CryptoData.IV;
            JTag = CryptoData.Integrity;
            CipherText = CryptoData.Data;
            }
コード例 #3
0
 /// <summary>
 /// Initialize the alg parameter to match the specified provider.
 /// </summary>
 /// <param name="Provider"></param>
 public Header(CryptoProviderEncryption Provider) {
     alg = Provider.JSONName;
     }