brunoos/luasec — pull request #19 by Zash (2014-04-19 21:14:35+00:00)
Title: Zash/pubkey

This lets you extract the public key in PEM format, along with type (eg RSA, DSA etc) and size in bits.

local pubkey, key_type, key_size = cert:pubkey();
print("This certificate has a ".. key_size .. "-bit " .. key_type .. " key.") -- eg 4096-bit RSA key
print(pubkey);

(Re-doing as it looks like I broke the other branch)