// Copyright (c) 2014-2021 Thomas Fussell // Copyright (c) 2010-2015 openpyxl // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE // // @license: http://www.opensource.org/licenses/mit-license.php // @author: see AUTHORS file #pragma once #include #include namespace xlnt { /// /// Properties governing how the data in a workbook should be protected. /// These values can be ignored by consumers. /// class XLNT_API document_security { public: /// /// Holds data describing the verifier that locks revisions or a workbook. /// struct lock_verifier { /// /// The algorithm used to create and verify this lock. /// std::string hash_algorithm; /// /// The initial salt combined with the password used to prevent rainbow table attacks /// std::string salt; /// /// The actual hash value represented as a string /// std::string hash; /// /// The number of times the hash should be applied to the password combined with the salt. /// This allows the difficulty of the hash to be increased as computing power increases. /// std::size_t spin_count; }; /// /// Constructs a new document security object with default values. /// document_security() = default; /// /// If true, the workbook is locked for revisions. /// bool lock_revision = false; /// /// If true, worksheets can't be moved, renamed, (un)hidden, inserted, or deleted. /// bool lock_structure = false; /// /// If true, workbook windows will be opened at the same position with the same size /// every time they are loaded. /// bool lock_windows = false; /// /// The settings to allow the revision lock to be removed. /// lock_verifier revision_lock; /// /// The settings to allow the structure and windows lock to be removed. /// lock_verifier workbook_lock; }; } // namespace xlnt