diff options
author | Rob Austein <sra@hactrn.net> | 2014-11-13 01:42:29 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2014-11-13 01:42:29 +0000 |
commit | c52d27c72d9a480284ff97faa218fd54c85c8485 (patch) | |
tree | 983d70ef6ccd5dc3c11a52c835c69b1b1eb8fbd0 /rpki/x509.py | |
parent | 50f092a4485b071dedbef3cf1e52e7cb421b85c2 (diff) |
More RRDP retrieval.
svn path=/branches/tk705/; revision=6021
Diffstat (limited to 'rpki/x509.py')
-rw-r--r-- | rpki/x509.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/rpki/x509.py b/rpki/x509.py index 1b1dafba..99e96d61 100644 --- a/rpki/x509.py +++ b/rpki/x509.py @@ -82,6 +82,18 @@ def first_rsync_uri(xia): return uri return None +def first_http_uri(xia): + """ + Find first HTTP URI in a sequence of AIA or SIA URIs. + Returns the URI if found, otherwise None. + """ + + if xia is not None: + for uri in xia: + if uri.startswith("http://"): + return uri + return None + def sha1(data): """ Calculate SHA-1 digest of some data. @@ -493,6 +505,15 @@ class DER_object(object): sia = self.get_POW().getSIA() return None if sia is None else first_rsync_uri(sia[2]) + def get_sia_rrdp_notify(self): + """ + Get SIA RRDP (id-ad-rpkiNotify) URI from this object. + Only works for subclasses that support getSIA(). + """ + + sia = self.get_POW().getSIA() + return None if sia is None else first_http_uri(sia[3]) + def get_AIA(self): """ Get the SIA extension from this object. Only works for subclasses |