Re: 請問openssl的問題
==My Code==
#include <sys/types.h>
/* #include <md5.h>*/
/*With this line I got such error:
In file included from test01.c:2:
/usr/include/md5.h:27: error: syntax error before "UINT4"
/usr/include/md5.h:30: error: syntax error before '}' token
/usr/include/md5.h:38: error: syntax error before "PROTO_LIST"
/usr/include/md5.h:39: error: syntax error before "PROTO_LIST"
/usr/include/md5.h:41: error: syntax error before "PROTO_LIST"
/usr/include/md5.h:43: error: syntax error before "PROTO_LIST"
*/
#include <openssl/rsa.h>
#include <openssl/engine.h>
#include <stdlib.h>
int main()
{
RSA* rsa;
rsa=RSA_generate_key(1024,65537,NULL,NULL);
system("ls");
return 0; /* Add This to prevent gcc warning */
}
==EOF
Command:
$ gcc -o test test01.c -lssl -lcrypto
Please notice that...
1. I use "gcc" instead of "g++"
2. With 2 more link lib command "-lssl -lcrypto"
==Exe Result==
$ ./tset
test01.c tset
==EOF
It's quite hard to tell if it really works or not...
--
夫兵者不祥之器物或惡之故有道者不處君子居則貴左用兵則貴右兵者不祥之器非君子
之器不得已BBS telnet://bbs.wretch.cc 開個人板 超快 不用連署不可得志於天下
矣吉事尚左凶事尚右偏將軍居左上將軍居右言以喪禮處之殺人之眾以哀悲泣之戰勝以
喪禮處之道常無名樸雖小天下莫能臣侯王若能守之萬物將自賓天地相合以降甘露民莫
之令而自均始制有名名亦既有夫亦將 203-204-199-142.adsl.static.giga.net.tw海
討論串 (同標題文章)
NetSecurity 近期熱門文章
PTT數位生活區 即時熱門文章