ecdsa.com
OpenSSL 3.x CLI (asn1parse, d2i loaders)OpenSSL CLI

Error message

error:0680009B:asn1 encoding routines:ASN1_get_object:too long

Reproduced on OpenSSL 3.6; version 1.1.x phrased it "asn1 encoding routines:ASN1_get_object:header too long" (error:0D07207B) — the widely-searched wording. Both mean the same parse failure.

What it means

The DER parser read what should be an ASN.1 tag-length header and got a length that exceeds the data available — the classic signature of "these bytes are not DER". Usually the input is base64 text, PEM, or truncated data being parsed as raw DER, not a subtly broken structure.

Why it happens

How to fix it

  1. 1.

    Match the input format to the parser

    Decode base64 first, or tell the tool it is PEM. asn1parse defaults to PEM input; -inform der is only for actual binary.

    bash
    # base64 signature/blob → DER, then parse
    openssl base64 -d -in sig.b64 | openssl asn1parse -inform der
    
    # PEM object: let asn1parse handle the armor itself
    openssl asn1parse -in cert.pem
  2. 2.

    Check sizes before parsing

    For an ECDSA P-256 DER signature expect ~70–72 bytes starting with 0x30. A 96-byte "signature" is probably base64; 64 bytes is raw r‖s, which is not DER at all.

    bash
    wc -c < sig.der
    head -c 8 sig.der | xxd   # 30 44/45/46 ... → DER SEQUENCE
  3. 3.

    If it is a raw r‖s signature, convert it

    JWS and WebCrypto emit 64-byte raw ECDSA signatures that no DER parser will accept. The converter below turns raw into DER (and back) and shows the r and s integers — paste the bytes and see which format you actually hold.

Related errors

← Browse the full signature error database