x509_cert_pubkey: windows build fix
Revised build system - autotools
luvit needs the header file being installed when not using bundled sources this makes it easier for us to patch the luvit build system and point it to the correct lib/header
libtoolize --copy --force --install --automake && aclocal -I m4 && autoconf && autoheader && automake --add-missing --copy
base files added
dist.cmake patched to work with autotools added EXCLUDE patterns for Makefile* in install-rules
Fix rsa openssl mismatch
check the return codes of wrote_bio_PrivateKey for any error.
Detect what type of key we are dealing with and use the right to_pem function. This way we match the enconding that the openssl dsa|rsa apps use for certificates.
add docs for the x509_cert and x509_ca objects.
With this patch we can now do things like verify a x509 cert against a x509_ca then extract its pubkey and test a message signature. cert = crypto.x509_cert() cert:from_pem(server_cert) kpub = cert:pubkey() message = 'Hello world' verified = crypto.verify('md5', message, signature, kpub)
return a boolean instead of nothing on success
inlines at best are a micro optimization and all modern compilers figure it out. On GCC 4.4 the exact same code is output with and without the inline. And as a bonus this all should compile under Windows now.
Add x509 ca verify
Initial commit of code to verify an x509 cert against a CA. Here is an example usage of the API: ca = assert(crypto.x509_ca()) ca:add_pem(ca_cert) assert(ca:verify_pem(cert_to_verify) == true, "failed to verify good cert")