mirror of
https://github.com/guanzhi/GmSSL.git
synced 2026-05-06 16:36:16 +08:00
Update tools use v3 API
This commit is contained in:
@@ -70,7 +70,8 @@ int main(int argc, char **argv)
|
||||
FILE *certfp = NULL;
|
||||
FILE *infp = stdin;
|
||||
FILE *outfp = stdout;
|
||||
X509_CERTIFICATE cert;
|
||||
uint8_t cert[1024];
|
||||
size_t certlen;
|
||||
SM2_KEY key;
|
||||
uint8_t inbuf[SM2_MAX_PLAINTEXT_SIZE];
|
||||
uint8_t outbuf[SM2_MAX_CIPHERTEXT_SIZE];
|
||||
@@ -122,11 +123,11 @@ help:
|
||||
error_print();
|
||||
return -1;
|
||||
}
|
||||
if (x509_certificate_from_pem(&cert, certfp) != 1) {
|
||||
if (x509_cert_from_pem(cert, &certlen, sizeof(cert), certfp) != 1) {
|
||||
error_print();
|
||||
return -1;
|
||||
}
|
||||
if (x509_certificate_get_public_key(&cert, &key) != 1) {
|
||||
if (x509_cert_get_subject_public_key(cert, certlen, &key) != 1) {
|
||||
error_print();
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user