diff options
Diffstat (limited to 'rpkid/rpki/x509.py')
-rw-r--r-- | rpkid/rpki/x509.py | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/rpkid/rpki/x509.py b/rpkid/rpki/x509.py index ebf8e089..7fda419d 100644 --- a/rpkid/rpki/x509.py +++ b/rpkid/rpki/x509.py @@ -13,7 +13,7 @@ some of the nasty details. This involves a lot of format conversion. $Id$ -Copyright (C) 2009--2010 Internet Systems Consortium ("ISC") +Copyright (C) 2009--2011 Internet Systems Consortium ("ISC") Permission to use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -1218,6 +1218,39 @@ class XML_CMS_object(CMS_object): self.schema_check() return self.saxify(self.get_content()) +class GBR_object(CMS_object): + """ + Class to hold CMS-wrapped VCard (Ghostbuster record). + """ + + pem_converter = PEM_converter("GHOSTBUSTERS RECORD") + econtent_oid = POWify_OID("id-ct-rpkiGhostbusters") + + def encode(self): + """ + Encode inner content for signing. At the moment we're treating + the VCard as an opaque byte string, so no encoding needed here. + """ + return self.get_content() + + def decode(self, vcard): + """ + Decode XML and set inner content. At the moment we're treating + the VCard as an opaque byte string, so no encoding needed here. + """ + self.content = vcard + + @classmethod + def build(cls, vcard, keypair, certs): + """ + Build a Ghostbusters record. + """ + self = cls() + self.set_content(vcard) + self.sign(keypair, certs) + return self + + class CRL(DER_object): """ Class to hold a Certificate Revocation List. |