aboutsummaryrefslogtreecommitdiff
path: root/scripts/rpki/x509.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-09-23 23:32:37 +0000
committerRob Austein <sra@hactrn.net>2007-09-23 23:32:37 +0000
commit81d8e851fe9fed622bc298732b42148ed1716e6c (patch)
treea4ede4c1987baa09dde392ab3ecc473cb7ae5b10 /scripts/rpki/x509.py
parent9faa8e61bedb91f316593c428af77a9378b610e1 (diff)
Implement up-down "list" command.
svn path=/scripts/rpki/sql.py; revision=1011
Diffstat (limited to 'scripts/rpki/x509.py')
-rw-r--r--scripts/rpki/x509.py10
1 files changed, 7 insertions, 3 deletions
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.