-
-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to add support for custom OIDs in the x509 module #259
Comments
It looks like Also, I was thinking that it might be a good idea to define a function that registers a new Extension; something like: class Extension(Sequence):
...
@classmethod
def register_extension(cls, name, oid, ext_cls):
if name in cls._oid_specs:
raise Exception("Duplicate extension name: " + name)
if oid in ExtensionId._map:
raise Exception("Duplicate extension oid: " + oid)
cls._oid_specs[name] = ext_cls
ExtensionId._map[oid] = name
class Certificate(Sequence):
...
def get_extension(self, name):
if not self._processed_extensions:
self._set_extensions() # Add code so the next line works
return self._extensions[name] # or return None instead of raising KeyError?
def has_extension(self, name):
...
return name in self._extensions @wbond Do you think about this? |
I'm working with a lot of MS issued certificates and one of the properties I need to expose is the certificate template. I'm trying to figure out how to modify the x509 code to add support for the extra value. I know the OID is 1.3.6.1.4.1.311.21.7, but I can't figure out what code changes are needed to add it as a property.
I've added a new property to the Certificate class (based on similar properties), and the OID to the NameType class, but I'm clearly missing something to get the field pulled out of the certificate data. Can someone point me in the right direction, or to a PR that does something similar?
The text was updated successfully, but these errors were encountered: