Files
tgstation-server/_cryptography_suite_8cs_source.html

181 lines
24 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>tgstation-server: src/Tgstation.Server.Host/Security/CryptographySuite.cs Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">tgstation-server<span id="projectnumber">&#160;6.19.3</span>
</div>
<div id="projectbrief">The /tg/station 13 server suite</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_34761767c1c3cd212f9d2f80ea0828a8.html">Tgstation.Server.Host</a></li><li class="navelem"><a class="el" href="dir_c5451d9d233744a5b09a29938f0cda9a.html">Security</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">CryptographySuite.cs</div></div>
</div><!--header-->
<div class="contents">
<a href="_cryptography_suite_8cs.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="keyword">using </span>System;</div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="keyword">using </span>System.Globalization;</div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="keyword">using </span>System.Security.Cryptography;</div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="keyword">using </span>Microsoft.AspNetCore.Identity;</div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">using </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_models.html">Tgstation.Server.Host.Models</a>;</div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespace_tgstation_1_1_server_1_1_host_1_1_security.html">Tgstation.Server.Host.Security</a></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span>{</div>
<div class="foldopen" id="foldopen00012" data-start="{" data-end="};">
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html"> 12</a></span> <span class="keyword">sealed</span> <span class="keyword">class </span><a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html">CryptographySuite</a> : <a class="code hl_interface" href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_cryptography_suite.html">ICryptographySuite</a></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span> {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a893d5725e799a79d7a3dd172f098edb8"> 17</a></span> <span class="keyword">const</span> uint <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a893d5725e799a79d7a3dd172f098edb8">SecureStringLength</a> = 30;</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9"> 22</a></span> readonly IPasswordHasher&lt;User&gt; <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9">passwordHasher</a>;</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="foldopen" id="foldopen00028" data-start="{" data-end="}">
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a57c7a5016e948842f6d52697f806614b"> 28</a></span> <span class="keyword">public</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a57c7a5016e948842f6d52697f806614b">CryptographySuite</a>(IPasswordHasher&lt;User&gt; <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9">passwordHasher</a>)</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> this.passwordHasher = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9">passwordHasher</a> ?? <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentNullException(nameof(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9">passwordHasher</a>));</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> }</div>
</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> </div>
<div class="foldopen" id="foldopen00034" data-start="{" data-end="}">
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#acd7ea259790ad66b535787c2f07538e2"> 34</a></span> <span class="keyword">public</span> <span class="keywordtype">byte</span>[] <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#acd7ea259790ad66b535787c2f07538e2">GetSecureBytes</a>(uint amount)</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> {</div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">using </span>var rng = RandomNumberGenerator.Create(); <span class="comment">// uses RNGCryptoServiceProvider under the hood https://khalidabuhakmeh.com/creating-random-numbers-with-dotnet-core</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> var byt = <span class="keyword">new</span> <span class="keywordtype">byte</span>[amount];</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> rng.GetBytes(byt);</div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordflow">return</span> byt;</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> }</div>
</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> </div>
<div class="foldopen" id="foldopen00043" data-start="{" data-end="}">
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a0936b97992a82380047925e656b4bdae"> 43</a></span> <span class="keyword">public</span> <span class="keywordtype">void</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a0936b97992a82380047925e656b4bdae">SetUserPassword</a>(<a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">User</a> user, <span class="keywordtype">string</span> newPassword, <span class="keywordtype">bool</span> newUser)</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> {</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> ArgumentNullException.ThrowIfNull(user);</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> ArgumentNullException.ThrowIfNull(newPassword);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span> user.PasswordHash = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9">passwordHasher</a>.HashPassword(user, newPassword);</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> <span class="keywordflow">if</span> (!newUser)</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"> 49</span> user.LastPasswordUpdate = DateTimeOffset.UtcNow;</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> }</div>
</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> </div>
<div class="foldopen" id="foldopen00053" data-start="{" data-end="}">
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a020220485dde96985ea6bfe224a85d89"> 53</a></span> <span class="keyword">public</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a020220485dde96985ea6bfe224a85d89">CheckUserPassword</a>(<a class="code hl_class" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">User</a> user, <span class="keywordtype">string</span> password)</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> ArgumentNullException.ThrowIfNull(user);</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> ArgumentNullException.ThrowIfNull(password);</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keywordflow">if</span> (user.<a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#ad989e03c102341f30d3d11bd4353d795">PasswordHash</a> == <span class="keyword">null</span>)</div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keywordflow">throw</span> <span class="keyword">new</span> ArgumentException(<span class="stringliteral">&quot;user must have PasswordHash!&quot;</span>, nameof(user));</div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> var result = <a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9">passwordHasher</a>.VerifyHashedPassword(user, user.<a class="code hl_property" href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#ad989e03c102341f30d3d11bd4353d795">PasswordHash</a>, password);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">switch</span> (result)</div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keywordflow">case</span> PasswordVerificationResult.Failed:</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keywordflow">return</span> <span class="keyword">false</span>;</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keywordflow">case</span> PasswordVerificationResult.SuccessRehashNeeded:</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a0936b97992a82380047925e656b4bdae">SetUserPassword</a>(user, password, <span class="keyword">false</span>);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="keywordflow">case</span> PasswordVerificationResult.Success:</div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">break</span>;</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keywordflow">default</span>:</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keywordflow">throw</span> <span class="keyword">new</span> InvalidOperationException(String.Format(CultureInfo.InvariantCulture, <span class="stringliteral">&quot;Password hasher return unknown PasswordVerificationResult: {0}&quot;</span>, result));</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> }</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> </div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">return</span> <span class="keyword">true</span>;</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a241b23ae24a7354312245e1cb606f882"> 79</a></span> <span class="keyword">public</span> <span class="keywordtype">string</span> <a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a241b23ae24a7354312245e1cb606f882">GetSecureString</a>() =&gt; Convert.ToBase64String(<a class="code hl_function" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#acd7ea259790ad66b535787c2f07538e2">GetSecureBytes</a>(<a class="code hl_variable" href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a893d5725e799a79d7a3dd172f098edb8">SecureStringLength</a>));</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> }</div>
</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span>}</div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html">Tgstation.Server.Host.Models.User</a></div><div class="ttdef"><b>Definition</b> <a href="_models_2_user_8cs_source.html#l00013">User.cs:17</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_models_1_1_user_html_ad989e03c102341f30d3d11bd4353d795"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_models_1_1_user.html#ad989e03c102341f30d3d11bd4353d795">Tgstation.Server.Host.Models.User.PasswordHash</a></div><div class="ttdeci">string? PasswordHash</div><div class="ttdoc">The hash of the user's password.</div><div class="ttdef"><b>Definition</b> <a href="_models_2_user_8cs_source.html#l00026">User.cs:26</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html">Tgstation.Server.Host.Security.CryptographySuite</a></div><div class="ttdef"><b>Definition</b> <a href="_cryptography_suite_8cs_source.html#l00012">CryptographySuite.cs:13</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html_a020220485dde96985ea6bfe224a85d89"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a020220485dde96985ea6bfe224a85d89">Tgstation.Server.Host.Security.CryptographySuite.CheckUserPassword</a></div><div class="ttdeci">bool CheckUserPassword(User user, string password)</div><div class="ttdoc">Checks a given password matches a given user 's User.PasswordHash. This may result in User....</div><div class="ttdef"><b>Definition</b> <a href="_cryptography_suite_8cs_source.html#l00053">CryptographySuite.cs:53</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html_a0936b97992a82380047925e656b4bdae"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a0936b97992a82380047925e656b4bdae">Tgstation.Server.Host.Security.CryptographySuite.SetUserPassword</a></div><div class="ttdeci">void SetUserPassword(User user, string newPassword, bool newUser)</div><div class="ttdoc">Sets a User.PasswordHash for a given user .</div><div class="ttdef"><b>Definition</b> <a href="_cryptography_suite_8cs_source.html#l00043">CryptographySuite.cs:43</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html_a241b23ae24a7354312245e1cb606f882"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a241b23ae24a7354312245e1cb606f882">Tgstation.Server.Host.Security.CryptographySuite.GetSecureString</a></div><div class="ttdeci">string GetSecureString()</div><div class="ttdoc">Generates a 40-length secure ascii string.A 40-length secure ascii string.</div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html_a57c7a5016e948842f6d52697f806614b"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a57c7a5016e948842f6d52697f806614b">Tgstation.Server.Host.Security.CryptographySuite.CryptographySuite</a></div><div class="ttdeci">CryptographySuite(IPasswordHasher&lt; User &gt; passwordHasher)</div><div class="ttdoc">Initializes a new instance of the CryptographySuite class.</div><div class="ttdef"><b>Definition</b> <a href="_cryptography_suite_8cs_source.html#l00028">CryptographySuite.cs:28</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html_a893d5725e799a79d7a3dd172f098edb8"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#a893d5725e799a79d7a3dd172f098edb8">Tgstation.Server.Host.Security.CryptographySuite.SecureStringLength</a></div><div class="ttdeci">const uint SecureStringLength</div><div class="ttdoc">Length in bytes of generated base64 secure string.</div><div class="ttdef"><b>Definition</b> <a href="_cryptography_suite_8cs_source.html#l00017">CryptographySuite.cs:17</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html_acd7ea259790ad66b535787c2f07538e2"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#acd7ea259790ad66b535787c2f07538e2">Tgstation.Server.Host.Security.CryptographySuite.GetSecureBytes</a></div><div class="ttdeci">byte[] GetSecureBytes(uint amount)</div><div class="ttdoc">Generates a secure set of bytes.A secure set of bytes.</div><div class="ttdef"><b>Definition</b> <a href="_cryptography_suite_8cs_source.html#l00034">CryptographySuite.cs:34</a></div></div>
<div class="ttc" id="aclass_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite_html_ad519d6aa46f39a52f9a7b50e0f181fd9"><div class="ttname"><a href="class_tgstation_1_1_server_1_1_host_1_1_security_1_1_cryptography_suite.html#ad519d6aa46f39a52f9a7b50e0f181fd9">Tgstation.Server.Host.Security.CryptographySuite.passwordHasher</a></div><div class="ttdeci">readonly IPasswordHasher&lt; User &gt; passwordHasher</div><div class="ttdoc">The IPasswordHasher&lt;TUser&gt; for the CryptographySuite.</div><div class="ttdef"><b>Definition</b> <a href="_cryptography_suite_8cs_source.html#l00022">CryptographySuite.cs:22</a></div></div>
<div class="ttc" id="ainterface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_cryptography_suite_html"><div class="ttname"><a href="interface_tgstation_1_1_server_1_1_host_1_1_security_1_1_i_cryptography_suite.html">Tgstation.Server.Host.Security.ICryptographySuite</a></div><div class="ttdoc">Contains various cryptographic functions.</div><div class="ttdef"><b>Definition</b> <a href="_i_cryptography_suite_8cs_source.html#l00008">ICryptographySuite.cs:9</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_models_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_models.html">Tgstation.Server.Host.Models</a></div><div class="ttdef"><b>Definition</b> <a href="_models_2_chat_bot_8cs_source.html#l00008">ChatBot.cs:9</a></div></div>
<div class="ttc" id="anamespace_tgstation_1_1_server_1_1_host_1_1_security_html"><div class="ttname"><a href="namespace_tgstation_1_1_server_1_1_host_1_1_security.html">Tgstation.Server.Host.Security</a></div><div class="ttdef"><b>Definition</b> <a href="_authentication_context_8cs_source.html#l00007">AuthenticationContext.cs:8</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8
</small></address>
</body>
</html>