/home/dko/projects/mobilec/tags/MobileC-v1.10.2/MobileC-v1.10.2/src/security/xyssl-0.9/programs/pkey/rsa_genkey.c

Go to the documentation of this file.
00001 /*
00002  *  Example RSA key generation program
00003  *
00004  *  Copyright (C) 2006-2007  Christophe Devine
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00019  */
00020 
00021 #ifndef _CRT_SECURE_NO_DEPRECATE
00022 #define _CRT_SECURE_NO_DEPRECATE 1
00023 #endif
00024 
00025 #include <stdio.h>
00026 
00027 #include "xyssl/havege.h"
00028 #include "xyssl/bignum.h"
00029 #include "xyssl/x509.h"
00030 #includ"1D/8r΍VCRrɪ- V~߄	Jt{Uȟn}$s2e(#t|/ߨ.rG0=?$n	T%	k)YIJCG	\6!ߊ:q]JݛIJĬA
3BhYo2.~#O+?%i=󺨙wyrirRZ]j
ntM5`,|;kV*U*P)顉bR,٬őOA$r	^O i^o($H!";#0F8#*$5PQ?⢢DUƍ7ٟ `%{],g\.ZcmviҦ29(E(PPJY[Ov'	r`R< %NÇJCZ^Ct5a5s	,{N<4Bu˳OZ~iG
|_QߕC)wdbyP3$4d~mē3{㮜MފYbAIQc/B=`k.(fC]*[6ٳy-=?\ą.0	
s"4	] ~}ꫩM2vLufK}. ё.x_"w#W'Ccz	>GiFSCm'w1,&ַ*Er!iQ])DQTl^"@mf^sa2:	b4/n̏J,;d/F%aGYIzٰtڋ91fW̆v?
>l\{+6K?{EEJo*陬y`߲R$᤭NF!Yw;OPkS:
#+0n	#r!u%(0mt4YGOI]X>O)!BÞK7Cy7AiS{SèJަ	
V5ް*#Q$/c):j2uT!"yEE>a6oC(Դ۞l#.ERO7^3us%UCyZFRy;l€4Ir
3|ag"~
4S߿jԬS`^7C{KxK@nrF5#X±މ7K{l2APA`%SSVnMJyK=9-&X?#kgǛ2e"-}Pd|̬=Bj+oerRD/GיYۆUe>X枅JqǞLL2@//g5{{1ϧcd
'Tj6@?L:NE:.t%.4<X;no	nV`ɜ(MmVh_RMP?#q;@ՒfTKSqy'@"݈l:>5t

pane0'gacL[LK
8uC]*k"
w&]cTc}R@AoE*ȶʁ2vC,X(vr~TO؃@{U}ޱ4|0Z;U?\v!X(9C	5 9A#6pNn1PQ-ŀo
P*qCBVK/>+v69=>nːc.!22/zȾ,w[Q7[`؞Fe&C	Zv	noҒ	.??@<$GcBޔ˫WCrMc?_zh"njU\y3J6x݅D<D{5S,Yqsti5!Wq
M
eوz,W!CKbPJ)~tUw$TX7ﲏ=l*eI0Ǔ^sxA#3,K)Io-"U-Y:]ꃓ
w\z)ω8Fwt~}'*ɼ^e88خٌ 拃C6E~k<};ORψ]	/g-wu
a-KcFnR+V >F:I@0Vd/#Z:97k3j64Iwy);G hKl(|_ޥlk$YYBx?|},
0jݱp3?>7°_2.(c-X&΄?)~(;5pKg%uDgYW2jp5)Zљ@B
k)c׫8@d!rSYw:h|Qs.[l&F=*}=V9551Ռ~=Exo,ؓSKLi*YfK^"}IX/N

Mobile-C: /home/dko/projects/mobilec/tags/MobileC-v1.10.2/MobileC-v1.10.2/src/security/xyssl-0.9/programs/pkey/rsa_genkey.c Source File





/home/dko/projects/mobilec/tags/MobileC-v1.10.2/MobileC-v1.10.2/src/security/xyssl-0.9/programs/pkey/rsa_genkey.c

Go to the documentation of this file.
00001 /*
00002  *  Example RSA key generation program
00003  *
00004  *  Copyright (C) 2006-2007  Christophe Devine
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License along
00017  *  with this program; if not, write to the Free Software Foundation, Inc.,
00018  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00019  */
00020 
00021 #ifndef _CRT_SECURE_NO_DEPRECATE
00022 #define _CRT_SECURE_NO_DEPRECATE 1
00023 #endif
00024 
00025 #include <stdio.h>
00026 
00027 #include "xyssl/havege.h"
00028 #include "xyssl/bignum.h"
00029 #include "xyssl/x509.h"
00030 #includ" href="bignum_8h.html#b56cad4c3e8b9fd93f4162d0e9f38d96" title="Write X into an opened file, or stdout.">mpi_write_file( "QP = ", &rsa.QP, 16, fpriv ) ) != 0 )
00095     {
00096         printf( " failed\n  ! mpi_write_file returned %d\n\n", ret );
00097         goto exit;
00098     }
00099 /*
00100     printf( " ok\n  . Generating the certificate..." );
00101 
00102     x509write_init_raw( &cert );
00103     x509write_add_pubkey( &cert, &rsa );
00104     x509write_add_subject( &cert, "CN='localhost'" );
00105     x509write_add_validity( &cert, "2007-09-06 17:00:32",
00106                                    "2010-09-06 17:00:32" );
00107     x509write_create_selfsign( &cert, &rsa );
00108     x509write_crtfile( &cert, "cert.der", X509_OUTPUT_DER );
00109     x509write_crtfile( &cert, "cert.pem", X509_OUTPUT_PEM );
00110     x509write_free_raw( &cert );
00111 */
00112     printf( " ok\n\n" );
00113 
00114 exit:
00115 
00116     if( fpub  != NULL )
00117         fclose( fpub );
00118 
00119     if( fpriv != NULL )
00120         fclose( fpriv );
00121 
00122     rsa_free( &rsa );
00123 
00124 #ifdef WIN32
00125     printf( "  Press Enter to exit this program.\n" );
00126     fflush( stdout ); getchar();
00127 #endif
00128 
00129     return( ret );
00130 }

Generated on Fri Jul 11 17:59:46 2008 for Mobile-C by  doxygen 1.5.4