aboutsummaryrefslogtreecommitdiff
path: root/scripts/rpki/sql.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-09-25 19:48:42 +0000
committerRob Austein <sra@hactrn.net>2007-09-25 19:48:42 +0000
commit2ce89c1051fec4b39a8e49b53e4b862f8f7d4fcb (patch)
tree29a124206b003d1b514310da6b29a88533722ae4 /scripts/rpki/sql.py
parentbca32923364c4e28c54622c78eb072a4a2e0d0d4 (diff)
Implement child_cert
svn path=/scripts/rpki/left_right.py; revision=1029
Diffstat (limited to 'scripts/rpki/sql.py')
-rw-r--r--scripts/rpki/sql.py20
1 files changed, 17 insertions, 3 deletions
diff --git a/scripts/rpki/sql.py b/scripts/rpki/sql.py
index d74be7fb..ea9299cd 100644
--- a/scripts/rpki/sql.py
+++ b/scripts/rpki/sql.py
@@ -158,6 +158,11 @@ class sql_persistant(object):
# Some persistant objects are defined in rpki.left_right, since
# they're also left-right PDUs. The rest are defined below, for now.
+class ca_obj(sql_persistant):
+ """Internal CA object."""
+
+ sql_template = template("ca", "ca_id", "last_crl_sn", "next_crl_update", "last_issued_sn", "last_manifest_sn", "next_manifest_update", "sia_uri", "parent_id")
+
class ca_detail_obj(sql_persistant):
"""Internal CA detail object."""
@@ -192,7 +197,16 @@ class ca_detail_obj(sql_persistant):
d["manifest_ee_cert"] = self.manifest_ee_cert.get_DER()
return d
-class ca_obj(sql_persistant):
- """Internal CA object."""
+class child_cert_obj(sql_persistant):
+ """Certificate that has been issued to a child."""
- sql_template = template("ca", "ca_id", "last_crl_sn", "next_crl_update", "last_issued_sn", "last_manifest_sn", "next_manifest_update", "sia_uri", "parent_id")
+ sql_template = template("child_cert", "child_cert_id", "cert", "child_id", "ca_detail_id")
+
+ def sql_decode(self, vals):
+ sql_persistant.sql_decode(self, vals)
+ self.cert = rpki.x509.X509(DER = self.cert)
+
+ def sql_encode(self):
+ d = sql_persistant.sql_encode(self)
+ d["cert"] = self.cert.get_DER()
+ return d