Merge branch 'master' of github.com:cyassl/cyassl
This commit is contained in:
commit
8a6bd081c4
@ -2800,10 +2800,19 @@ int DerToPem(const byte* der, word32 derSz, byte* output, word32 outSz,
|
||||
if (type == CERT_TYPE) {
|
||||
XSTRNCPY(header, "-----BEGIN CERTIFICATE-----\n", sizeof(header));
|
||||
XSTRNCPY(footer, "-----END CERTIFICATE-----\n", sizeof(footer));
|
||||
} else {
|
||||
}
|
||||
else if (type == PRIVATEKEY_TYPE) {
|
||||
XSTRNCPY(header, "-----BEGIN RSA PRIVATE KEY-----\n", sizeof(header));
|
||||
XSTRNCPY(footer, "-----END RSA PRIVATE KEY-----\n", sizeof(footer));
|
||||
}
|
||||
#ifdef HAVE_ECC
|
||||
else if (type == ECC_PRIVATEKEY_TYPE) {
|
||||
XSTRNCPY(header, "-----BEGIN EC PRIVATE KEY-----\n", sizeof(header));
|
||||
XSTRNCPY(footer, "-----END EC PRIVATE KEY-----\n", sizeof(footer));
|
||||
}
|
||||
#endif
|
||||
else
|
||||
return BAD_FUNC_ARG;
|
||||
|
||||
headerLen = (int)XSTRLEN(header);
|
||||
footerLen = (int)XSTRLEN(footer);
|
||||
|
@ -40,7 +40,8 @@ enum CertType {
|
||||
PRIVATEKEY_TYPE,
|
||||
DH_PARAM_TYPE,
|
||||
CRL_TYPE,
|
||||
CA_TYPE
|
||||
CA_TYPE,
|
||||
ECC_PRIVATEKEY_TYPE
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user