Parsing Contextual Objects again
Jeremy Hylton
jeremy at beopen.com
Mon Sep 18 20:02:47 CEST 2000
>>>>> "MS" == Michael Ströder <michael at stroeder.com>> writes:
>> The second decode call gets the directoryName that is tagged with
>> [4].
MS> Yes. But this is the ASN.1 type GeneralName (which holds a
MS> distinguished name in the above example). But I would expect a
MS> sequence (type GeneralNames, not GeneralName)!
I also expect a sequence, but that's not what is encoded! I am fairly
confident that this part of the decoding is correct. I've confirmed
it with Peter Gutmann's dumpasn1 program. (output attached)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: out
URL: <http://mail.python.org/pipermail/python-crypto/attachments/20000918/e5d7b04a/attachment.ksh>
-------------- next part --------------
The sequence that results from the decoding appears to be the
RDNSequence for the Name [4].
>Name ::= CHOICE { -- only one possibility for now --
> rdnSequence RDNSequence }
>
>RDNSequence ::= SEQUENCE OF RelativeDistinguishedName
>
>DistinguishedName ::= RDNSequence
>
>RelativeDistinguishedName ::=
> SET SIZE (1 .. MAX) OF AttributeTypeAndValue
>> The decode method modifies the contextual object in place,
MS> Aaaaaaaah! I will try using module copy now...
Why? It modifies the object in place only so that after calling
decode, the repr method is more helpful. I think it would be wasteful
to copy it.
Jeremy
More information about the python-crypto
mailing list