Call the OpenSSL code is as follows:
X509 * x;
The FILE * fp=NULL;
Unsigned char buf [5000], * p;
int len;
Serial ASN1_INTEGER *=NULL;
Fopen_s (& amp; Fp, "1. The cer", "rb");
if (! Fp) return;
Len=fread (buf, 1, 5000, fp);
fclose(fp);
P=(unsigned char *) base64_decode ((const char *) buf, len);
X=X509_new ();
D2i_X509 (& amp; X, (const unsigned char * *) & amp; P, len);
Serial=X509_get_serialNumber (x);
Printf (" serial number is: ");
For (int I=0; i
}
X509_free (x);
Call OpenSSL retrieve the certificate serial number is as follows:
Problems: through the OpenSSL get certificate serial number in front of 0 is filtered out, how can let the OpenSSL to obtain the complete certificate serial number?
Passing by the great god, give younger brother a little hint
CodePudding user response:
Will no one encountered such a problem, ask the great spirit,CodePudding user response:
Dude, did you solve?