mirror of
https://github.com/brunoos/luasec.git
synced 2025-07-13 06:24:22 +02:00
LuaSec 20120616 (unofficial) + patches
This commit is contained in:
22
samples/chain/util.lua
Normal file
22
samples/chain/util.lua
Normal file
@ -0,0 +1,22 @@
|
||||
local print = print
|
||||
local ipairs = ipairs
|
||||
|
||||
local _ENV = {}
|
||||
|
||||
function _ENV.show(cert)
|
||||
print("Serial:", cert:serial())
|
||||
print("NotBefore:", cert:notbefore())
|
||||
print("NotAfter:", cert:notafter())
|
||||
print("--- Issuer ---")
|
||||
for k, v in ipairs(cert:issuer()) do
|
||||
print(v.name .. " = " .. v.value)
|
||||
end
|
||||
|
||||
print("--- Subject ---")
|
||||
for k, v in ipairs(cert:subject()) do
|
||||
print(v.name .. " = " .. v.value)
|
||||
end
|
||||
print("----------------------------------------------------------------------")
|
||||
end
|
||||
|
||||
return _ENV
|
Reference in New Issue
Block a user