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 = ber_encoder.encode(x)
Except, obviously, no such function as remove
exists in the class. del x[2]
doesn't work either, because the __del__
function is not implemented.