Questions tagged [pyasn1]

42 questions
0
votes
1 answer

Handling nested DER, packed into OCTET STRINGs, in pyasn1

Here's how RFC 5280 defines an X.509 extension field: Extension ::= SEQUENCE { extnID OBJECT IDENTIFIER, critical BOOLEAN DEFAULT FALSE, extnValue OCTET STRING -- contains the DER encoding of an ASN.1…
0
votes
1 answer

How to recover the substrate from a pyasn1 object?

I have a complicated nested ASN.1 structure as bytes. I want to find all T61Strings (say) in that structure, in the original byte encoding. Is this possible in pyasn1? So far, I only know how to locate the the T61Strings (or whatever) in the…
0
votes
1 answer

Converting OID of public key,etc in HEX data to the dot format

Hello guys, I have CV1 RSA certificates that are slightly modified.So, I dont want to use asn1wrap to parse a 'der' file as it makes it too complex sometimes,instead as tags are already fixed for a CV1 certificate i can parse the HEX data of this…
0
votes
1 answer

how do i get the number of clients from an Ap cisco and save it in a variable?

I hope you can help me, The goal is to get the number of clients that have conected to the ap using pysnmp, I think I'm close, I know I have to use probably pyasn1, but I get to a part that gives me the following error: ('---------->',…
0
votes
1 answer

PySNMP SNMPV3 Trap not being sent

I am implementing the pysnmp code for snmpv3, trying to send a trap over to a machine in my network. I can see that the trap is being seen in Wireshark but it does not show up in any of my trap receivers. The code is as below : from pysnmp.hlapi…
0
votes
1 answer

pyasn1 prettyPrint() - display integers in hex

I have many univ.Integer(), but would like to print all of them in hex, which are easy to related to the decoding of substrate. How can I do it ? one such example is namedtype.NamedType('vendor-id', univ.Integer()) namedtype.NamedType('device-id',…
mungayree
  • 313
  • 1
  • 12
0
votes
1 answer

Implement ASN1 structure properly using pyasn1

I am new to ASN1 and want to implement this structure using pyasn1 ECPrivateKey ::= SEQUENCE { version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1), privateKey OCTET STRING, parameters [0] ECParameters {{ NamedCurve }}…
abhi
  • 366
  • 6
  • 17
0
votes
1 answer

[Python ASN1]: GeneralizedTime pyasn1 implementation

Here is my asn1 grammar representation:- MiepPullWtdr ::= [0] SEQUENCE { timeStamp [8] GeneralizedTime } I need help in implementing the same using pyasn1. Here is my code snippet:- from pyasn1.type import univ, namedtype,…
sam
  • 635
  • 4
  • 9
  • 18
0
votes
0 answers

Pyasn1 nested sequence - incompatible tags

I need help with my code. I have two structs, which are using third. class Bar(univ.Sequence): componentType = namedtype.NamedTypes( …
saders
  • 33
  • 1
  • 6
0
votes
1 answer

pyasn1.error.PyAsn1Error: Unknown bit identifier

I tried to use the method prettyIn from the python library pyasn1.type.univ.BitString. This method takes a string, but whatever I pass in, in the python interactive shell raises the exception pyasn1.error.PyAsn1Error: Unknown bit identifier. I…
0
votes
1 answer

Invalid files when creating X509 certificates containing extensions with newer versions of PyASN1

I have a python script that used to work for generating X509 certificates with certificate extensions using PyASN1 and pyasn1_modules modules. But now that I've updated these modules to the latest versions from pypi (previously they were from Ubuntu…
zaadeh
  • 1,711
  • 2
  • 23
  • 37
0
votes
1 answer

Parsing X509 extensions with pyasn1

I've got an extension which is described as follows: Extension().setComponentByPosition(0, ObjectIdentifier(2.5.29.19)) .setComponentByPosition(1, Boolean('False')) .setComponentByPosition(2, Any(hexValue='04023000')) So based…
viraptor
  • 33,322
  • 10
  • 107
  • 191
1 2
3