Comments (4)
Assuming there's only one policy (warning: untested):
cert.certificate_policies_value[0]['policy_identifier'].dotted
EDIT: here's the definition of the CertificatePolicies
type:
Lines 1642 to 1643 in fad689f
from asn1crypto.
Thanks for the fast reply!
I tried it like this before and got always the error:
cert.certificate_policies_value[0]['policy_identifier'].dotted
TypeError: 'NoneType' object is not subscriptable
from asn1crypto.
That's what you would get if the cert doesn't have the cert policies extension at all. Are you sure that this is the same certificate object as the one in your original post? If so, try these in order to see which one fails:
cert.certificate_policies_value[0]
cert.certificate_policies_value[0]['policy_identifier']
cert.certificate_policies_value[0]['policy_identifier'].dotted
from asn1crypto.
Thank you very much!
This was the problem.
My first example does not have any cert policies.
I just tried it with an other cert, now it works.
from asn1crypto.
Related Issues (20)
- Support Versions HOT 1
- Continuous fuzzing by way of OSS-Fuzz HOT 2
- Optional parameters HOT 4
- CRL version 3 HOT 6
- ocsp crash ValueError: not enough values to unpack (expected 3, got 2)
- Can asn1crypto support pickle! HOT 3
- CMS.py Contains TWO Conflicting Definitions of RecipientKeyIdentifier HOT 6
- Exception in ValidationContext.validate_usage() during OCSP response parsing HOT 5
- ERROR: No matching distribution found for ans1crypto HOT 1
- Bug in commit 'Handle BER-encoded indefinite length values better' HOT 7
- PublicKeyAlgorithm does not encode None parameters as ASN1 Null element for RSA Keys HOT 3
- CI Test throw error due to expired certificate HOT 1
- Error parsing Microsoft Root Agency Certificate HOT 2
- What is the difference between x509.Certificate.contents and x509.Certificate.dump() HOT 2
- Calling dump on a SignedData object took 30 seconds HOT 12
- How to add support for custom OIDs in the x509 module HOT 1
- Issue report: x509.Name fails to process the TCG OIDs (2.23.133.2.*) HOT 8
- Crash with UTF8String in Subject (akash provider certificates) HOT 2
- OCSP response extension parsing fails HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asn1crypto.