/// <summary>
        ///     Initializes a new instance of ProtectedDocumentConsumer with the file that needs to be decrypted
        /// </summary>
        /// <param name="encryptedfile">Encrypted or protected file</param>
        /// <param name="consentCallback">Consent callback method</param>
        /// <param name="authCallback">Authentication callback method</param>
        /// <param name="userId">User id or Email id</param>
        public ProtectedDocumentConsumer(IStorageFile encryptedfile, IConsentCallback consentCallback,
                                         IAuthenticationCallback authCallback, string userId)
        {
            if (encryptedfile == null)
            {
                throw new ArgumentNullException("encryptedfile");
            }

            if (!Utility.IsValidProtectedFileExtension(encryptedfile.FileType))
            {
                throw new ArgumentException("Invalid File.");
            }

            EncryptedFile          = encryptedfile;
            UnencryptedFileName    = Utility.GetUnencryptedFileName(encryptedfile.Name);
            AuthenticationCallback = authCallback;
            IsLoaded        = false;
            UserId          = userId;
            Result          = null;
            ConsentCallback = consentCallback;
        }
コード例 #2
0
 /// <summary>
 /// Initializes a new instance of ProtectedTextDocumentConsumer class with the file that needs to be decrypted
 /// </summary>
 /// <param name="encryptedfile">Protected file that needs to be decrypted</param>
 /// <param name="consentCallback">consent callback method</param>
 /// <param name="authCallback">Authentication callback method</param>
 /// <param name="userId">User id or Email id</param>
 public ProtectedTextDocumentConsumer(IStorageFile encryptedfile, IConsentCallback consentCallback, IAuthenticationCallback authCallback, string userId) :
     base(encryptedfile, consentCallback, authCallback, userId)
 {
     _decryptedText = null;
 }