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WupAEYcFcJIBqGR/1nlRtpCjXSHFWBkx3gTDeu5r21xcsQAdl9dL5BXe0Bt0nmdhmmLdEvzn55HdAqW3Wfi9fjbY0r6WeGbmMvVB8R0wucPugDkpti2HbQtU6u67/jgpnKvOdMsn4Y3RWgvK/64O72PuV7rRg+Z5J/XdqLmNLkCgYAGqmQJ3pW6yn/Ilet3idR6HSxpi3BrmQYqjdHSP5dTam9mjM94HQUK4UnmlnKlFzQuHveMotXjSCaSKsupQoNvQnA0emrjUIVfPRFC4+qtY3VnIVixxCrV55b9ITfvk07ejHkrx87Qmygyb52OEyzIBp/LyqId7alJ5f0ArbgeDwKBgQDDONXscChQQLPAFO9xLVLTU2JSCWcJAt4Dh8xhfDkGtYg+AcRb75+pVGW7jpg3311N8suuF2Eq3RWoCdvzUHD+TLUNMQrw7IfpKhtL1Po6KA/+G6xwh00ZkXL5o6AbmQ/fZW6/Yk5yx5PRxuwhLYCn6zVGJnENWmzkhVtawtHHFw==
我需要将其解连接/拆分回一个看起来像这样的块。即,将其恢复为正确的格式以用作 X509 证书。
-----BEGIN CERTIFICATE-----
MIIGNTCCBR2gAwIBAgIKYWYgXQABAAACazANBgkqhkiG9w0BAQUFADBDMRMwEQYK
CZImiZPyLGQBGRYDY29tMRcwFQYKCZImiZPyLGQBGRYHY2puZGVtbzETMBEGA1UE
AxMKY2puZGVtby1DQTAeFw0xMzA0MTIxNjM4MTVaFw0xNDAzMDgxMjM0NDhaMHwx
CzAJBgNVBAYTAkdCMRIwEAYDVQQIEwlCZXJrc2hpcmUxEDAOBgNVBAcTB1NFIFRl
YW0xDzANBgNVBAoTBlZlbmFmaTERMA8GA1UEAxMIbmV3Y2VydDQxIzAhBgkqhkiG
9w0BCQEWFGphc29uLmJvdXJuZUB2ZWQuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAv+ILegq1B81jOosGpySK+FO4+WQXJk4dyGWbC/MRw5JU2ShQ
Mjkpab8FDBgpZUmG6mvwr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