我有一个使用 radius 服务器的 wpa2 企业网络。
我有一个 client.p12 证书,我已经成功地将我的 windows pc 连接到网络。
我需要将嵌入式设备连接到相同的设备,这需要将证书文本粘贴到三个文件cacert.h , client-key.h and client-cert.h.
中。如何将 client.p12 文件分解为上述文件。
我已经使用 openssl 获得了 client-key.h 和 client-cert.h 文件。
如何获取 cacert.h 文件?
除了这个,我还需要什么东西来连接网络吗?文件 client-key.h 的内容
static unsigned char client_key[] = { "\
-----BEGIN PRIVATE KEY-----\n\
MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANsp73rNO2njvl9J\n\
TYuP6bBOfyVNO3wzkBblw+wtnCuqq1Np5/ZD5i6emhNNXNGIOnODrmZR1udCbMyn\n\
puLdkvei6LLHxbKOheHwCgij0QqZ1mB9PHbGEPW3+Pmxuquhy/LVegGNweGRCTe6\n\
yCte7x+DUO9p5YFabGIPCcD6lL4nAgMBAAECgYBAgTo8AZXAF8jbUL7jGctlGeVw\n\
PCgK6T46jwu4QsBZVdUxKtWb9OYVyJZ+oeF0xky13QcClInU7QcKwTlsQlzTvE0s\n\
Nh30lrgh3vbHx2TtXHRzuRXq5Tfw1FBoOKjRLriGs+knUkaNj28MpfGulJG+t8Rt\n\
o5UI+S7IAlHvkQRiKQJBAPu8M8VHEtP1TZbGItHoy4MZ46//JeUnvKZWoNW4um3y\n\
Y9cft0sWF4WVXxxu7MaF1qQVwfd7rUKp69VtWwV5J0UCQQDe4HfnzYP37I7/ti9K\n\
VuxfsaRfAjQafH/lrL6/COKtEK8ea1deBqMQywBGWiPZbPGhK5Pnui6Tv4a1EOm7\n\
4WB7AkBQcM1iRtnfXU2T1nCd/vO5SvaU8MVdOptv09LFOKhqJcB9p6bcmYyepSKl\n\
ZVTIA1CZUlKPELhGyyGPK8igMRy5AkEAn6VqPkCYJx7rz39QoI9jAajddLC/YbmM\n\
Y5g5id1zgURSLBf3nQJkC8NdjwdCZpwC+M+eQn66nlqyw0A6LLpjwQJBAI/aZbb7\n\
EMa/64dIjKWS8FIDECBWmyxt2Fh6vJI1uoWU2Fbt9Z2r6Z4JxhWe56kcHnasuDql\n\
ae+oK/9MXLpdc0c=\n\
-----END PRIVATE KEY-----\n\
" };
unsigned int client_key_size = sizeof(client_key);
文件 client-cert.h 的内容
static unsigned char client_cert[] = { "\
-----BEGIN CERTIFICATE-----\n\
MIIECDCCA3GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADCBnjELMAkGA1UEBhMCVVMx\n\
EzARBgNVBAgTCkNhbGlmb3JuaWExFDASBgNVBAcTC1NhbnRhIENsYXJhMRAwDgYD\n\
VQQKEwdNYXJ2ZWxsMQswCQYDVQQLEwJCVTETMBEGA1UEAxMKTWFydmVsbCBDQTEQ\n\
MA4GA1UEKRMHRWFzeVJTQTEeMBwGCSqGSIb3DQEJARYPYWJjQG1hcnZlbGwuY29t\n\
MB4XDTEzMDkxMDExMTgzNVoXDTIzMDkwODExMTgzNVowgZsxCzAJBgNVBAYTAlVT\n\
MRMwEQYDVQQIEwpDYWxpZm9ybmlhMRQwEgYDVQQHEwtTYW50YSBDbGFyYTEQMA4G\n\
A1UEChMHTWFydmVsbDELMAkGA1UECxMCQlUxEDAOBgNVBAMTB2NsaWVudDExEDAO\n\
BgNVBCkTB0Vhc3lSU0ExHjAcBgkqhkiG9w0BCQEWD2FiY0BtYXJ2ZWxsLmNvbTCB\n\
nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA2ynves07aeO+X0lNi4/psE5/JU07\n\
fDOQFuXD7C2cK6qrU2nn9kPmLp6aE01c0Yg6c4OuZlHW50JszKem4t2S96LossfF\n\
so6F4fAKCKPRCpnWYH08dsYQ9bf4+bG6q6HL8tV6AY3B4ZEJN7rIK17vH4NQ72nl\n\
gVpsYg8JwPqUvicCAwEAAaOCAVUwggFRMAkGA1UdEwQCMAAwLQYJYIZIAYb4QgEN\n\
BCAWHkVhc3ktUlNBIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUBt/C\n\
cmVQ/aUU0dOMWkXArG03IZQwgdMGA1UdIwSByzCByIAUtqXThrziw2LZKlnp8Ff/\n\
QHPtRcmhgaSkgaEwgZ4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh\n\
MRQwEgYDVQQHEwtTYW50YSBDbGFyYTEQMA4GA1UEChMHTWFydmVsbDELMAkGA1UE\n\
CxMCQlUxEzARBgNVBAMTCk1hcnZlbGwgQ0ExEDAOBgNVBCkTB0Vhc3lSU0ExHjAc\n\
BgkqhkiG9w0BCQEWD2FiY0BtYXJ2ZWxsLmNvbYIJAOt7HbxXB0MCMBMGA1UdJQQM\n\
MAoGCCsGAQUFBwMCMAsGA1UdDwQEAwIHgDANBgkqhkiG9w0BAQsFAAOBgQAvwYD4\n\
r7Ie0ZWRuzkI+zzG3WiLYt8pYHYAG0wDPNYt1aqT7QUyZSludQfWuq9JGimBciqq\n\
IM6rtpkqWiNJ8S/n5FK8dj+OGA2t/sgGREgUaXOtUDDu4fgJi+ejUbykaI+yiHyr\n\
Ayi0mm2qbJxojMdbtl1KNosyA8T8wJwMMXqSsg==\n\
-----END CERTIFICATE-----\n\
" };
unsigned int client_cert_size = sizeof(client_cert);
文件 cacert.h 的内容
static unsigned char ca_cert[] = { "\
-----BEGIN CERTIFICATE-----\n\
MIIDxTCCAy6gAwIBAgIJAOt7HbxXB0MCMA0GCSqGSIb3DQEBCwUAMIGeMQswCQYD\n\
VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEUMBIGA1UEBxMLU2FudGEgQ2xh\n\
cmExEDAOBgNVBAoTB01hcnZlbGwxCzAJBgNVBAsTAkJVMRMwEQYDVQQDEwpNYXJ2\n\
ZWxsIENBMRAwDgYDVQQpEwdFYXN5UlNBMR4wHAYJKoZIhvcNAQkBFg9hYmNAbWFy\n\
dmVsbC5jb20wHhcNMTMwOTEwMTExODIxWhcNMjMwOTA4MTExODIxWjCBnjELMAkG\n\
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