<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>ne7ssh.kdevelop: ne7ssh_keys.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.9 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_dd1c5291a9065b7545d10d656e7badb5.html">projects</a> » <a class="el" href="dir_0149abaf0c2b822b0c584e3b6dde2eae.html">ne7ssh</a> » <a class="el" href="dir_f38c3faaed4ee86c894d75645400fcb5.html">src</a> </div> </div> <div class="contents"> <h1>ne7ssh_keys.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/***************************************************************************</span> <a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2005-2007 by NetSieben Technologies INC *</span> <a name="l00003"></a>00003 <span class="comment"> * Author: Andrew Useckas *</span> <a name="l00004"></a>00004 <span class="comment"> * Email: andrew@netsieben.com *</span> <a name="l00005"></a>00005 <span class="comment"> * *</span> <a name="l00006"></a>00006 <span class="comment"> * Windows Port and bugfixes: Keef Aragon <keef@netsieben.com> *</span> <a name="l00007"></a>00007 <span class="comment"> * *</span> <a name="l00008"></a>00008 <span class="comment"> * This program may be distributed under the terms of the Q Public *</span> <a name="l00009"></a>00009 <span class="comment"> * License as defined by Trolltech AS of Norway and appearing in the *</span> <a name="l00010"></a>00010 <span class="comment"> * file LICENSE.QPL included in the packaging of this file. *</span> <a name="l00011"></a>00011 <span class="comment"> * *</span> <a name="l00012"></a>00012 <span class="comment"> * This program is distributed in the hope that it will be useful, *</span> <a name="l00013"></a>00013 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of *</span> <a name="l00014"></a>00014 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *</span> <a name="l00015"></a>00015 <span class="comment"> ***************************************************************************/</span> <a name="l00016"></a>00016 <a name="l00017"></a>00017 <span class="preprocessor">#ifndef NE7SSH_KEYS_H</span> <a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define NE7SSH_KEYS_H</span> <a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#include <botan/pubkey.h></span> <a name="l00020"></a>00020 <span class="preprocessor">#include <botan/pem.h></span> <a name="l00021"></a>00021 <span class="preprocessor">#include <botan/dsa.h></span> <a name="l00022"></a>00022 <span class="preprocessor">#include <botan/rsa.h></span> <a name="l00023"></a>00023 <span class="preprocessor">#include <botan/numthry.h></span> <a name="l00024"></a>00024 <span class="preprocessor">#include <botan/der_enc.h></span> <a name="l00025"></a>00025 <span class="preprocessor">#include <botan/ber_dec.h></span> <a name="l00026"></a>00026 <a name="l00027"></a>00027 <span class="preprocessor">#include "ne7ssh_types.h"</span> <a name="l00028"></a>00028 <span class="preprocessor">#include "ne7ssh_string.h"</span> <a name="l00029"></a>00029 <a name="l00030"></a>00030 <span class="preprocessor">#define MAX_KEYSIZE 8192</span> <a name="l00031"></a>00031 <span class="preprocessor"></span> <a name="l00032"></a>00032 <a name="l00036"></a><a class="code" href="classne7ssh__keys.html">00036</a> <span class="keyword">class </span><a class="code" href="classne7ssh__keys.html">ne7ssh_keys</a> <a name="l00037"></a>00037 { <a name="l00038"></a>00038 <span class="keyword">private</span>: <a name="l00039"></a>00039 Botan::DSA_PrivateKey *dsaPrivateKey; <a name="l00040"></a>00040 Botan::RSA_PrivateKey *rsaPrivateKey; <a name="l00041"></a>00041 <a class="code" href="classne7ssh__string.html">ne7ssh_string</a> publicKeyBlob; <a name="l00042"></a>00042 Botan::SecureVector<Botan::byte> signature; <a name="l00043"></a>00043 <a name="l00044"></a>00044 uint8 keyAlgo; <a name="l00045"></a>00045 <a name="l00052"></a>00052 <span class="keywordtype">bool</span> <a class="code" href="classne7ssh__keys.html#9dba05ee332fd2b3947807d9ef8b0a95">getDSAKeys</a> (<span class="keywordtype">char</span>* buffer, uint32 size); <a name="l00053"></a>00053 <a name="l00060"></a>00060 <span class="keywordtype">bool</span> <a class="code" href="classne7ssh__keys.html#faddb661a61e70eb9bc714d097d8980b">getRSAKeys</a> (<span class="keywordtype">char</span>* buffer, uint32 size); <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">public</span>: <a name="l00063"></a>00063 <span class="keyword">enum</span> keyAlgos { DSA, RSA }; <a name="l00064"></a>00064 <a name="l00068"></a>00068 <a class="code" href="classne7ssh__keys.html#d9edaab331f5e56112d035b904a59dca">ne7ssh_keys</a>(); <a name="l00069"></a>00069 <a name="l00074"></a>00074 <a class="code" href="classne7ssh__keys.html#dbe80f9c6f7806d5909bb811b4a73cb8">~ne7ssh_keys</a>(); <a name="l00075"></a>00075 <a name="l00084"></a>00084 <span class="keywordtype">bool</span> <a class="code" href="classne7ssh__keys.html#4e1d32a1fcdf8599e1d9cc0f8382a5ce">generateDSAKeys</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* fqdn, <span class="keyword">const</span> <span class="keywordtype">char</span>* privKeyFileName, <span class="keyword">const</span> <span class="keywordtype">char</span>* pubKeyFileName, uint16 keySize = 2048); <a name="l00085"></a>00085 <a name="l00094"></a>00094 <span class="keywordtype">bool</span> <a class="code" href="classne7ssh__keys.html#3cbce01402069e4d78a5a80f12d74ad4">generateRSAKeys</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* fqdn, <span class="keyword">const</span> <span class="keywordtype">char</span>* privKeyFileName, <span class="keyword">const</span> <span class="keywordtype">char</span>* pubKeyFileName, uint16 keySize = 2048); <a name="l00095"></a>00095 <a name="l00102"></a>00102 <span class="keywordtype">bool</span> <a class="code" href="classne7ssh__keys.html#dbc39ba71fd5b7a3c613c90d8620711b">getKeyPairFromFile</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* privKeyFileName); <a name="l00103"></a>00103 <a name="l00111"></a>00111 Botan::SecureVector<Botan::byte>& <a class="code" href="classne7ssh__keys.html#faf77aad8057e0a2e616040677ab696b">generateSignature</a> (Botan::SecureVector<Botan::byte>& sessionID, Botan::SecureVector<Botan::byte>& signingData); <a name="l00112"></a>00112 <a name="l00119"></a>00119 Botan::SecureVector<Botan::byte> <a class="code" href="classne7ssh__keys.html#77df178024644ea4fffab1354bf7a872">generateDSASignature</a> (Botan::SecureVector<Botan::byte>& sessionID, Botan::SecureVector<Botan::byte>& signingData); <a name="l00120"></a>00120 <a name="l00127"></a>00127 Botan::SecureVector<Botan::byte> <a class="code" href="classne7ssh__keys.html#79baa24130d9207119840f481bb03841">generateRSASignature</a> (Botan::SecureVector<Botan::byte>& sessionID, Botan::SecureVector<Botan::byte>& signingData); <a name="l00128"></a>00128 <a name="l00133"></a>00133 Botan::SecureVector<Botan::byte>& <a class="code" href="classne7ssh__keys.html#b798aaf9dcffb0098a02c3faa755c362">getPublicKeyBlob</a> (); <a name="l00134"></a>00134 <a name="l00139"></a><a class="code" href="classne7ssh__keys.html#70fa62aa01e0104f8d414ca0ef398cee">00139</a> uint8 <a class="code" href="classne7ssh__keys.html#70fa62aa01e0104f8d414ca0ef398cee">getKeyAlgo</a> () { <span class="keywordflow">return</span> keyAlgo; } <a name="l00140"></a>00140 <a name="l00141"></a>00141 }; <a name="l00142"></a>00142 <a name="l00143"></a>00143 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Tue May 5 14:10:41 2009 for ne7ssh.kdevelop by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address> </body> </html>