30 static int signed_string_nid= -1;
37 if (signed_string_nid == -1)
39 OBJ_create(
"1.2.3.4.5",
"OID_example",
"Our example OID");
40 os=ASN1_OCTET_STRING_new();
53 if (signed_string_nid == -1)
55 OBJ_create(
"1.2.3.4.5",
"OID_example",
"Our example OID");
66 memcpy(buf,os->
data,i);
73 static int signed_seq2string_nid= -1;
85 if (signed_seq2string_nid == -1)
86 signed_seq2string_nid=
87 OBJ_create(
"1.9.9999",
"OID_example",
"Our example OID");
89 os1=ASN1_OCTET_STRING_new();
90 os2=ASN1_OCTET_STRING_new();
93 i =i2d_ASN1_OCTET_STRING(os1,NULL);
94 i+=i2d_ASN1_OCTET_STRING(os2,NULL);
100 i2d_ASN1_OCTET_STRING(os1,&p);
101 i2d_ASN1_OCTET_STRING(os2,&p);
106 ASN1_OCTET_STRING_free(os1);
107 ASN1_OCTET_STRING_free(os2);
119 if (signed_seq2string_nid == -1)
120 signed_seq2string_nid=
121 OBJ_create(
"1.9.9999",
"OID_example",
"Our example OID");
138 if ((os1=d2i_ASN1_OCTET_STRING(NULL,&c.
p,c.
slen)) == NULL)
143 if ((os2=d2i_ASN1_OCTET_STRING(NULL,&c.
p,c.
slen)) == NULL)
148 *str1=malloc(os1->
length+1);
149 *str2=malloc(os2->
length+1);
152 (*str1)[os1->
length]=
'\0';
153 (*str2)[os2->
length]=
'\0';
154 ASN1_OCTET_STRING_free(os1);
155 ASN1_OCTET_STRING_free(os2);
198 if (signed_string_nid == -1)
200 OBJ_create(
"1.2.3.4.5",
"OID_example",
"Our example OID");
201 os=ASN1_OCTET_STRING_new();
218 if (signed_string_nid == -1)
220 OBJ_create(
"1.2.3.4.5",
"OID_example",
"Our example OID");
231 memcpy(buf,os->
data,i);
249 if (signed_seq2string_nid == -1)
250 signed_seq2string_nid=
251 OBJ_create(
"1.9.9999",
"OID_example",
"Our example OID");
253 os1=ASN1_OCTET_STRING_new();
254 os2=ASN1_OCTET_STRING_new();
257 i =i2d_ASN1_OCTET_STRING(os1,NULL);
258 i+=i2d_ASN1_OCTET_STRING(os2,NULL);
264 i2d_ASN1_OCTET_STRING(os1,&p);
265 i2d_ASN1_OCTET_STRING(os2,&p);
270 ASN1_OCTET_STRING_free(os1);
271 ASN1_OCTET_STRING_free(os2);
284 if (signed_seq2string_nid == -1)
285 signed_seq2string_nid=
286 OBJ_create(
"1.9.9999",
"OID_example",
"Our example OID");
305 if ((os1=d2i_ASN1_OCTET_STRING(NULL,&c.
p,c.
slen)) == NULL)
310 if ((os2=d2i_ASN1_OCTET_STRING(NULL,&c.
p,c.
slen)) == NULL)
315 *str1=malloc(os1->
length+1);
316 *str2=malloc(os2->
length+1);
319 (*str1)[os1->
length]=
'\0';
320 (*str2)[os2->
length]=
'\0';
321 ASN1_OCTET_STRING_free(os1);
322 ASN1_OCTET_STRING_free(os2);