Questions tagged [pyasn1]

42 questions
4
votes
2 answers

Installing scrapy on mac - pyasn1 distribution not found

I have installed scrapy on my mac (OS El Capital, 10.11.4), there does not seem to be any compatibilty problem between scrapy and my python version (2.7.11) but when I try to start a project with scrapy startproject tutorial I get following error…
vincisson
  • 43
  • 1
  • 5
4
votes
1 answer

Decode using ASN.1 where substrate contains some opaque data

I would like to use pyasn1 to decode some data, part of which is opaque. That is, part of the data contained in the ASN.1-defined structure may or may not be ASN.1 decode-able, and I need to parse the preamble to find out how to decode it. Based on…
neirbowj
  • 635
  • 5
  • 17
3
votes
3 answers

ERROR:SparkContext can only be used on the driver, not in code that it run on workers. For more information, see SPARK-5063

I am presently working with ASN 1 Decoder.I will be getting a Hex decimal code from producer and i will be collecting it in consumer. Then after i will be converting the hex code to RDD and then pass the hex value RDD to another function with in…
Rahul
  • 243
  • 2
  • 6
  • 17
3
votes
1 answer

Pyasn1 how do decoder.decode works?

I have this little part of code: from pyasn1.type import univ from pyasn1.codec.ber import decoder decoder.decode(binary_file.read(5)) my binary_file variable it's a particular binary file encoded (CDR) if i try to decode the readed part it gives…
3
votes
1 answer

Where is my interpretation of ASN1 der wrong?

Here is what my structure looks like: SET OF SEQUENCE: INTEGER: XX INTEGER: YY My encoding looks like this: 11 08 10 06 02 01 XX 02 01 YY 11 08 -- SET OF 10 06 -- SEQUENCE However, when I decode with openssl, I don't see…
ExceptionHandler
  • 213
  • 1
  • 8
  • 24
2
votes
0 answers

Decoding ASN1 encoded "Subject Key Identifier" with weird length

Im trying to decode a field called Subject Key Identifier (RFC 5820), which was contained within a CMS certificate (RFC 6488). I have for most of the previous "work" successfully used pyasn1 and pyasn1_modules to decode ASN1 structures. However i…
shinypants
  • 31
  • 1
2
votes
2 answers

pyasn1 vs indefinite-length structures

Is it a bug that pyasn1 cannot parse unaided (without defining a new type) the indefinite-length constructed data described in the code snippet below, or is my example not valid BER-encoded ASN.1? If pyasn1 can't handle this without help, is there…
1
vote
1 answer

tag-incompatible: How to add a SET OF to a SEQUENCE in pyasn1?

I have successfully used pyasn1 to encode most of my data, but am having trouble adding a SetOf construction to a sequence. Here is a schema that represents the structure: TroubleAddingSetOf DEFINITIONS IMPLICIT TAGS ::= BEGIN TopType ::= CHOICE { …
1
vote
1 answer

How do I remove CT extensions from an x.509 certificate in Python?

I'm working on a Python script in which I need to determine if a precertificate and leaf certificate match. To do this, I need to compare the TBS cert of the precert and leaf cert, after removing the SCT(1.3.6.1.4.1.11129.2.4.2) and Precert…
Tugzrida
  • 491
  • 2
  • 6
  • 17
1
vote
0 answers

How do I remove a field from a ASN.1 structure (pyasn1)?

Basically, I'm looking for something like this: from pyasn1.codec.ber import decoder as ber_decoder from pyasn1.codec.ber import encoder as ber_encoder x, _ = ber_decoder.decode(data) x.remove(2) # remove the second field result =…
Volker
  • 200
  • 1
  • 9
1
vote
0 answers

The equivalent of pyasn decoder.decode in Powershell

I have an array of bytes that is der encoded, I need to decode these bytes into asn1 object using Powershell or by accessing a C# library from powershell. In python there is a module built to do this process called pyasn1. I tried using the C# class…
Henry
  • 23
  • 2
1
vote
1 answer

How to set default values in a SEQUENCE OF object

I'm starting to use the pyasn1 library and I have a question on how to set default values in a SEQUENCE OF object. My ASN1 structure is the following: Asn1Def DEFINITIONS AUTOMATIC TAGS ::= BEGIN CasinoPlayer ::= SEQUENCE { …
zecky
  • 31
  • 3
1
vote
1 answer

Filling values through a file such as excel

Following Python class i created using pyasn and I like to see the feasiblity of passing the value through a file rather than the way of creating an object and passing the values for the members through the object.types of value which are string and…
Awin
  • 91
  • 1
  • 8
1
vote
1 answer

Python script running via shell but not working via supervisord

The error that I'm facing is: File "/usr/local/lib/python3.5/dist-packages/oauth2client/crypt.py", line 23, in from oauth2client import _pure_python_crypt File…
Phil
  • 2,859
  • 5
  • 20
  • 21
1
vote
1 answer

How to parse Object Class from ASN1 grammar to use in pyasn1?

I need to use GSM MAP ASN.1, but there is one Information Object Classes (or here) in that specification and I don't know how to parse this grammar to use in pyasn1 lib. Is there some way (or workaround) to parse it? Here is the case (Taken from…
Fabiano
  • 377
  • 4
  • 12
1
2 3