]> WPIA git - cassiopeia.git/commitdiff
add: Read the CSR (naive approach)
authorFelix Dörre <felix@dogcraft.de>
Sat, 1 Nov 2014 23:30:24 +0000 (00:30 +0100)
committerBenny Baumann <BenBE@geshi.org>
Fri, 7 Nov 2014 22:52:18 +0000 (23:52 +0100)
src/main.cpp

index e0a6c10190276444bde61cfadb35e2766dd123d1..ce89594fdf51f72abe3a830f6b8215a2d952554f 100644 (file)
@@ -17,6 +17,8 @@
     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 #include <iostream>
+#include <fstream>
+#include <streambuf>
 
 #include "database.h"
 #include "mysql.h"
@@ -42,6 +44,9 @@ int main( int argc, const char* argv[] ) {
         std::cout << cert->md << std::endl;
         std::cout << cert->csr << std::endl;
         std::cout << cert->csr_type << std::endl;
+        std::ifstream t( cert->csr );
+        std::string str( std::istreambuf_iterator<char>( t ), std::istreambuf_iterator<char>() );
+        std::cout << "CSR:  " << str << std::endl;
     }
 
     if( !jp->finishJob( job ) ) {