11111111

发布时间 2023-04-26 08:17:25作者: 20201319吴向林
// Include necessary libraries
#include <stdio.h>
#include <stdlib.h>
#include <openssl/evp.h>

// Define the input number
int input_num = 20201319;

// Create a buffer to store the DER encoding
unsigned char *der_buf = NULL;
int der_len = i2d_ASN1_INTEGER(input_num, &der_buf);

// Open the file for writing
FILE *der_file = fopen("1.der", "wb");

// Write the DER encoding to the file
fwrite(der_buf, 1, der_len, der_file);

// Close the file and free the buffer
fclose(der_file);
OPENSSL_free(der_buf);