Search found 37 matches

by RebootExpert
Fri Apr 09, 2021 2:53 pm
Forum: NetBurner Software
Topic: sign the auto gen cert
Replies: 4
Views: 67

Re: sign the auto gen cert

I have to generate a caKey.cpp too. compfile caKey.der ca_key ca_key_len caKey.cpp get a caKey from it by using wc_EccPrivateKeyDecode() and use the caKey to sign the cert. ret = wc_SignCert(gNewCert->bodySz, gNewCert->sigType, gDerBuf, derBufSz, nullptr, caKey, gRng); Interestingly, I still have to...
by RebootExpert
Fri Apr 09, 2021 10:43 am
Forum: NetBurner Software
Topic: sign the auto gen cert
Replies: 4
Views: 67

Re: sign the auto gen cert

Thanks Jon. I tried it out, and rebuild system library. but now I can't access the webpage via https.
there's error show in the cert "This certificate has an invalid digital signature."
How does only set the issuer of the cert can replace the process of signing a cert?
by RebootExpert
Wed Apr 07, 2021 12:45 pm
Forum: NetBurner Software
Topic: sign the auto gen cert
Replies: 4
Views: 67

sign the auto gen cert

How do I use my own CA to sign the auto gen certificate? I want to upload my own CA to the module, and every time I call the function SSL_CreateNewSelfSignedCert(), using that CA to sign the cert instead generate a new cert that has a same subject and issuer. Right now when the device boots up, it w...
by RebootExpert
Fri Mar 26, 2021 11:31 am
Forum: NetBurner Software
Topic: validate cert and private key
Replies: 15
Views: 255

Re: validate cert and private key

I use the tool OpenSSL to generate all the certificates.
by RebootExpert
Fri Mar 26, 2021 10:35 am
Forum: NetBurner Software
Topic: validate cert and private key
Replies: 15
Views: 255

Re: validate cert and private key

Yeah, it works smoothly, but I have to null terminate the tempBuf as the sniprintf() not null terminating at this point. One thing I notice, when I test a cert has an expiration date of Mar 16, 2061 4:23:24 PM, the expBuf return as: 2061031616232 23 13 50 48 54 49 48 51 49 54 49 54 50 51 50 0 0 0 0 ...
by RebootExpert
Wed Mar 24, 2021 2:05 pm
Forum: NetBurner Software
Topic: validate cert and private key
Replies: 15
Views: 255

Re: validate cert and private key

Or is the function specific for the self generated cert use only?
by RebootExpert
Wed Mar 24, 2021 1:59 pm
Forum: NetBurner Software
Topic: validate cert and private key
Replies: 15
Views: 255

Re: validate cert and private key

I think the problem is about SSL_GetExpirationDate() since it did the job to get the expiration date of a cert.
by RebootExpert
Wed Mar 24, 2021 1:56 pm
Forum: NetBurner Software
Topic: validate cert and private key
Replies: 15
Views: 255

Re: validate cert and private key

Thanks for the thorough explanation. The reason I use SSL_IsCertExpired() is that my webpage has a feature allow user to upload their cert and key, and I will check the expired date of the cert and then check if the cert and key were match which is why I ask about the function IsSSL_CertNKeyValid in...
by RebootExpert
Tue Mar 23, 2021 2:31 pm
Forum: NetBurner Software
Topic: validate cert and private key
Replies: 15
Views: 255

Re: validate cert and private key

So I update your code a little, now it's working ok. But again should the year in format of yyyy instead yy ? And the ending 'Z' char ? bool SSL_IsCertExpiredMod( unsigned char* certBuff, int certLen, uint16_t certBuffFormat = SSL_FILETYPE_PEM ) { uint16_t expBufLen = 64; unsigned char expBuf[expBuf...
by RebootExpert
Tue Mar 23, 2021 2:02 pm
Forum: NetBurner Software
Topic: validate cert and private key
Replies: 15
Views: 255

Re: validate cert and private key

Try using your code, I print out expBuf that store the expiration date of my cert: expBuf = 210320233312Z expBuf = 23 13 50 49 48 51 50 48 50 51 51 51 49 50 90 (correspond acsii value) why the first two char are 23(ETB), 13(CR) instead of 50('2') and 48('0') (assume it's 2021) and end in 90('Z') ? a...