Provider for bulk encryption algorithms (e.g. AES).
상속: CryptoProviderBulk
예제 #1
0
 /// <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
        /// <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;
     }