From 81d8e851fe9fed622bc298732b42148ed1716e6c Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 23 Sep 2007 23:32:37 +0000 Subject: Implement up-down "list" command. svn path=/scripts/rpki/sql.py; revision=1011 --- scripts/rpki/x509.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts/rpki/x509.py') diff --git a/scripts/rpki/x509.py b/scripts/rpki/x509.py index 2082986c..0c3639b2 100644 --- a/scripts/rpki/x509.py +++ b/scripts/rpki/x509.py @@ -12,7 +12,7 @@ bring together the functionality I need in a way that hides at least some of the nasty details. This involves a lot of format conversion. """ -import POW, tlslite.api, POW.pkix, base64, rpki.exceptions +import POW, tlslite.api, POW.pkix, base64, rpki.exceptions, rpki.resource_set class PEM_converter(object): """Convert between DER and PEM encodings for various kinds of ASN.1 data.""" @@ -202,14 +202,18 @@ class X509(DER_object): self.POW_extensions = exts return self.POW_extensions - def getAKI(self): + def get_AKI(self): """Get the AKI extension from this certificate.""" return self._get_POW_extensions().get("authorityKeyIdentifier") - def getSKI(self): + def get_SKI(self): """Get the SKI extension from this certificate.""" return self._get_POW_extensions().get("subjectKeyIdentifier") + def get_3779resources(self): + """Get RFC 3779 resources as rpki.resource_set objects.""" + return rpki.resource_set.parse_extensions(self.get_POWpkix().getExtensions()) + class X509_chain(list): """Collections of certs. -- cgit v1.2.3