xlnt
document_security.hpp
1 // Copyright (c) 2014-2022 Thomas Fussell
2 // Copyright (c) 2010-2015 openpyxl
3 // Copyright (c) 2024 xlnt-community
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE
22 //
23 // @license: http://www.opensource.org/licenses/mit-license.php
24 // @author: see AUTHORS file
25 
26 #pragma once
27 
28 #include <string>
29 
30 #include <xlnt/xlnt_config.hpp>
31 
32 namespace xlnt {
33 
38 class XLNT_API document_security
39 {
40 public:
45  {
49  std::string hash_algorithm;
50 
54  std::string salt;
55 
59  std::string hash;
60 
65  std::size_t spin_count;
66  };
67 
71  document_security() = default;
72 
76  bool lock_revision = false;
77 
81  bool lock_structure = false;
82 
87  bool lock_windows = false;
88 
93 
98 };
99 
100 } // namespace xlnt
Enumerates the possible types a cell can be determined by it&#39;s current value.
Definition: cell.hpp:37
std::string hash_algorithm
The algorithm used to create and verify this lock.
Definition: document_security.hpp:49
lock_verifier workbook_lock
The settings to allow the structure and windows lock to be removed.
Definition: document_security.hpp:97
std::size_t spin_count
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.
Definition: document_security.hpp:65
lock_verifier revision_lock
The settings to allow the revision lock to be removed.
Definition: document_security.hpp:92
Properties governing how the data in a workbook should be protected. These values can be ignored by c...
Definition: document_security.hpp:38
std::string salt
The initial salt combined with the password used to prevent rainbow table attacks ...
Definition: document_security.hpp:54
Holds data describing the verifier that locks revisions or a workbook.
Definition: document_security.hpp:44
std::string hash
The actual hash value represented as a string
Definition: document_security.hpp:59