PyAsn1Error
Python 3.11.2: /usr/bin/python3
Mon Dec 30 15:10:11 2024

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.

 /home/chn/eid/dfri-eid/nginx-test-issuer/cgi-bin/gencert.py in <module>
     92     base64pubkey = arguments['pubkey'].value
     93     personnummer = arguments['personnummer'].value
=>   94     client_cert = doit(base64pubkey, personnummer)
     95     print('Content-Type: application/x-x509-user-cert')
     96     print()
client_cert undefined, doit = <function doit>, base64pubkey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArUts...L11rLnhIgtI2JQvQcuooaAl/vHTJkTdI+mVTMBkb6VQIDAQAB', personnummer = 'asdfasdfsafd'
 /home/chn/eid/dfri-eid/nginx-test-issuer/cgi-bin/gencert.py in doit(base64pubkey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArUts...L11rLnhIgtI2JQvQcuooaAl/vHTJkTdI+mVTMBkb6VQIDAQAB', personnummer='asdfasdfsafd')
     62 
     63 def doit(base64pubkey, personnummer):
=>   64     public_key = extract_browser_pubkey(base64pubkey)
     65     cacert, capriv = read_server_files()
     66 
public_key undefined, global extract_browser_pubkey = <function extract_browser_pubkey>, base64pubkey = 'MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArUts...L11rLnhIgtI2JQvQcuooaAl/vHTJkTdI+mVTMBkb6VQIDAQAB'
 /home/chn/eid/dfri-eid/nginx-test-issuer/cgi-bin/gencert.py in extract_browser_pubkey(base64pubkey='MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArUts...L11rLnhIgtI2JQvQcuooaAl/vHTJkTdI+mVTMBkb6VQIDAQAB')
     48     pubkey = b64decode(base64pubkey)
     49 
=>   50     pubkey, rest_of_input = der_decoder(pubkey, asn1Spec=SPKAC())
     51 
     52     assert rest_of_input == b''
pubkey = b'0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', rest_of_input undefined, global der_decoder = <pyasn1.codec.der.decoder.Decoder object>, asn1Spec undefined, global SPKAC = <class '__main__.SPKAC'>
 /usr/lib/python3/dist-packages/pyasn1/codec/ber/decoder.py in __call__(self=<pyasn1.codec.der.decoder.Decoder object>, substrate=b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', asn1Spec=<SPKAC schema object, tagSet=<TagSet object, tag...3>>>>, sizeSpec=<ConstraintsIntersection object>>, tagSet=<TagSet object, tags 0:32:16>, length=290, state=6, decodeFun=None, substrateFun=None, **options={'fullSubstrate': b'0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'})
   1579 
   1580                 else:
=> 1581                     value, substrate = concreteDecoder.valueDecoder(
=> 1582                         substrate, asn1Spec,
=> 1583                         tagSet, length, stGetValueDecoder,
value = <NoValue object>, substrate = b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', concreteDecoder = <pyasn1.codec.ber.decoder.SequenceDecoder object>, concreteDecoder.valueDecoder = <bound method UniversalConstructedTypeDecoder.va...pyasn1.codec.ber.decoder.SequenceDecoder object>>, asn1Spec = <SPKAC schema object, tagSet=<TagSet object, tag...3>>>>, sizeSpec=<ConstraintsIntersection object>>, tagSet = <TagSet object, tags 0:32:16>, length = 290, global stGetValueDecoder = 2, self = <pyasn1.codec.der.decoder.Decoder object>, substrateFun = None, options = {'fullSubstrate': b'0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'}
 /usr/lib/python3/dist-packages/pyasn1/codec/ber/decoder.py in valueDecoder(self=<pyasn1.codec.ber.decoder.SequenceDecoder object>, substrate=b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', asn1Spec=<SPKAC schema object, tagSet=<TagSet object, tag...3>>>>, sizeSpec=<ConstraintsIntersection object>>, tagSet=<TagSet object, tags 0:32:16>, length=290, state=2, decodeFun=<pyasn1.codec.der.decoder.Decoder object>, substrateFun=None, **options={'fullSubstrate': b'0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'})
    607                         )
    608 
=>  609                 component, head = decodeFun(head, componentType, **options)
    610 
    611                 if not isDeterministic and namedTypes:
component undefined, head = b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', decodeFun = <pyasn1.codec.der.decoder.Decoder object>, componentType = <PublicKeyAndChallenge schema object, tagSet=<Ta...ii>>>, sizeSpec=<ConstraintsIntersection object>>, options = {'fullSubstrate': b'0\x82\x01"0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x0...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'}
 /usr/lib/python3/dist-packages/pyasn1/codec/ber/decoder.py in __call__(self=<pyasn1.codec.der.decoder.Decoder object>, substrate=b'\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', asn1Spec=<PublicKeyAndChallenge schema object, tagSet=<Ta...ii>>>, sizeSpec=<ConstraintsIntersection object>>, tagSet=<TagSet object, tags 0:32:16>, length=13, state=6, decodeFun=None, substrateFun=None, **options={'fullSubstrate': b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'})
   1579 
   1580                 else:
=> 1581                     value, substrate = concreteDecoder.valueDecoder(
=> 1582                         substrate, asn1Spec,
=> 1583                         tagSet, length, stGetValueDecoder,
value = <NoValue object>, substrate = b'\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', concreteDecoder = <pyasn1.codec.ber.decoder.SequenceDecoder object>, concreteDecoder.valueDecoder = <bound method UniversalConstructedTypeDecoder.va...pyasn1.codec.ber.decoder.SequenceDecoder object>>, asn1Spec = <PublicKeyAndChallenge schema object, tagSet=<Ta...ii>>>, sizeSpec=<ConstraintsIntersection object>>, tagSet = <TagSet object, tags 0:32:16>, length = 13, global stGetValueDecoder = 2, self = <pyasn1.codec.der.decoder.Decoder object>, substrateFun = None, options = {'fullSubstrate': b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'}
 /usr/lib/python3/dist-packages/pyasn1/codec/ber/decoder.py in valueDecoder(self=<pyasn1.codec.ber.decoder.SequenceDecoder object>, substrate=b'\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\x03...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01', asn1Spec=<PublicKeyAndChallenge schema object, tagSet=<Ta...ii>>>, sizeSpec=<ConstraintsIntersection object>>, tagSet=<TagSet object, tags 0:32:16>, length=13, state=2, decodeFun=<pyasn1.codec.der.decoder.Decoder object>, substrateFun=None, **options={'fullSubstrate': b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'})
    607                         )
    608 
=>  609                 component, head = decodeFun(head, componentType, **options)
    610 
    611                 if not isDeterministic and namedTypes:
component undefined, head = b'\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00', decodeFun = <pyasn1.codec.der.decoder.Decoder object>, componentType = <SubjectPublicKeyInfo schema object, tagSet=<Tag...3>>>>, sizeSpec=<ConstraintsIntersection object>>, options = {'fullSubstrate': b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'}
 /usr/lib/python3/dist-packages/pyasn1/codec/ber/decoder.py in __call__(self=<pyasn1.codec.der.decoder.Decoder object>, substrate=b'*\x86H\x86\xf7\r\x01\x01\x01\x05\x00', asn1Spec=<SubjectPublicKeyInfo schema object, tagSet=<Tag...3>>>>, sizeSpec=<ConstraintsIntersection object>>, tagSet=<TagSet object, tags 0:0:6>, length=9, state=8, decodeFun=None, substrateFun=None, **options={'fullSubstrate': b'0\r\x06\t*\x86H\x86\xf7\r\x01\x01\x01\x05\x00\...d2dM\xd2>\x99T\xcc\x06F\xfaU\x02\x03\x01\x00\x01'})
   1616 
   1617             if state is stErrorCondition:
=> 1618                 raise error.PyAsn1Error(
=> 1619                     '%s not in asn1Spec: %r' % (tagSet, asn1Spec)
=> 1620                 )
global error = <module 'pyasn1.error' from '/usr/lib/python3/dist-packages/pyasn1/error.py'>, error.PyAsn1Error = <class 'pyasn1.error.PyAsn1Error'>, tagSet = <TagSet object, tags 0:0:6>, asn1Spec = <SubjectPublicKeyInfo schema object, tagSet=<Tag...3>>>>, sizeSpec=<ConstraintsIntersection object>>

PyAsn1Error: <TagSet object, tags 0:0:6> not in asn1Spec: <SubjectPublicKeyInfo schema object, tagSet=<TagSet object, tags 0:32:16>, subtypeSpec=<ConstraintsIntersection object>, componentType=<NamedTypes object, types <NamedType object, type algorithm=<AlgorithmIdentifier schema object, tagSet=<TagSet object, tags 0:32:16>, subtypeSpec=<ConstraintsIntersection object>, componentType=<NamedTypes object, types <NamedType object, type algorithm=<ObjectIdentifier schema object, tagSet <TagSet object, tags 0:0:6>>>, <OptionalNamedType object, type parameters=<Any schema object, encoding iso-8859-1>>>, sizeSpec=<ConstraintsIntersection object>>>, <NamedType object, type subjectPublicKey=<BitString schema object, tagSet <TagSet object, tags 0:0:3>>>>, sizeSpec=<ConstraintsIntersection object>>
      add_note = <built-in method add_note of PyAsn1Error object>
      args = ('<TagSet object, tags 0:0:6> not in asn1Spec: <Su...3>>>>, sizeSpec=<ConstraintsIntersection object>>',)
      with_traceback = <built-in method with_traceback of PyAsn1Error object>