| 234 | } |
| 235 | |
| 236 | FileDecryptionProperties::FileDecryptionProperties( |
| 237 | SecureString footer_key, std::shared_ptr<DecryptionKeyRetriever> key_retriever, |
| 238 | bool check_plaintext_footer_integrity, std::string aad_prefix, |
| 239 | std::shared_ptr<AADPrefixVerifier> aad_prefix_verifier, |
| 240 | ColumnPathToDecryptionPropertiesMap column_decryption_properties, |
| 241 | bool plaintext_files_allowed) |
| 242 | : footer_key_(std::move(footer_key)), |
| 243 | aad_prefix_(std::move(aad_prefix)), |
| 244 | aad_prefix_verifier_(std::move(aad_prefix_verifier)), |
| 245 | column_decryption_properties_(std::move(column_decryption_properties)), |
| 246 | key_retriever_(std::move(key_retriever)), |
| 247 | check_plaintext_footer_integrity_(check_plaintext_footer_integrity), |
| 248 | plaintext_files_allowed_(plaintext_files_allowed) { |
| 249 | DCHECK(!footer_key_.empty() || nullptr != key_retriever_ || |
| 250 | 0 != column_decryption_properties_.size()); |
| 251 | if (!footer_key_.empty()) { |
| 252 | DCHECK(footer_key_.length() == 16 || footer_key_.length() == 24 || |
| 253 | footer_key_.length() == 32); |
| 254 | } |
| 255 | if (footer_key_.empty() && check_plaintext_footer_integrity) { |
| 256 | DCHECK(nullptr != key_retriever_); |
| 257 | } |
| 258 | } |
| 259 | |
| 260 | FileEncryptionProperties::Builder* FileEncryptionProperties::Builder::footer_key_id( |
| 261 | std::string key_id) { |