⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (574 Bytes)
Bug #6703
» o.c
C example, but using OBJ_txt2nid() as well -
vbatts (Vincent Batts)
, 07/06/2012 06:27 AM
#include
<openssl/x509v3.h>
#include
<openssl/ssl.h>
int
main
(
int
ac
,
char
**
av
)
{
int
i
;
int
nid
;
int
new_nid
;
if
(
ac
==
1
)
{
printf
(
"Usage: %s 1.2.3.4.5 ...
\n
"
,
av
[
0
]);
return
1
;
}
for
(
i
=
1
;
i
<
ac
;
i
++
)
{
new_nid
=
OBJ_create
(
av
[
i
],
"NewOID"
,
"New Object Identifier"
);
printf
(
"created: %d
\n
"
,
new_nid
);
nid
=
OBJ_txt2nid
(
av
[
i
]);
if
(
!
nid
)
nid
=
OBJ_ln2nid
(
"New Object Identifier"
);
if
(
!
nid
)
nid
=
OBJ_sn2nid
(
"NewOID"
);
if
(
nid
)
{
printf
(
"%d %s
\n
"
,
nid
,
av
[
i
]);
}
else
{
printf
(
"%s did not find anything
\n
"
,
av
[
i
]);
}
}
return
0
;
}
« Previous
1
2
Next »
(2-2/2)
Loading...