mirror of
https://github.com/brunoos/luasec.git
synced 2024-11-07 22:18:27 +01:00
Add cert:issued(leafcert) for checking chains
This commit is contained in:
parent
21aefcf67d
commit
d2c87d71f7
12
src/x509.c
12
src/x509.c
@ -393,6 +393,17 @@ static int meth_notafter(lua_State *L)
|
||||
return push_asn1_time(L, X509_get_notAfter(cert));
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if this certificate issued some other certificate
|
||||
*/
|
||||
static int meth_issued(lua_State *L)
|
||||
{
|
||||
X509* issuer = lsec_checkx509(L, 1);
|
||||
X509* subject = lsec_checkx509(L, 2);
|
||||
lua_pushboolean(L, X509_check_issued(issuer, subject) == X509_V_OK);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Collect X509 objects.
|
||||
*/
|
||||
@ -459,6 +470,7 @@ static luaL_Reg methods[] = {
|
||||
{"issuer", meth_issuer},
|
||||
{"notbefore", meth_notbefore},
|
||||
{"notafter", meth_notafter},
|
||||
{"issued", meth_issued},
|
||||
{"pem", meth_pem},
|
||||
{"serial", meth_serial},
|
||||
{"subject", meth_subject},
|
||||
|
Loading…
Reference in New Issue
Block a user