1 /*
2 * Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the License); you may
5 * not use this file except in compliance with the License.
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 */
9
10 #include <stdio.h>
11 #include <string.h>
12 #include <stdlib.h>
13 #include <gmssl/sm2.h>
14
main(void)15 int main(void)
16 {
17 SM2_KEY sm2_key;
18
19 if (sm2_key_generate(&sm2_key) != 1) {
20 fprintf(stderr, "error\n");
21 return 1;
22 }
23
24 sm2_key_print(stdout, 0, 0, "SM2PrivateKey", &sm2_key);
25 sm2_public_key_print(stdout, 0, 0, "SM2PublicKey", &sm2_key);
26
27 return 0;
28 }
29