Closed jumpjack closed 2 years ago
@jumpjack what makes you expect that there is more encoded in the signature than just the binary data?
Your question includes the answer: if it's binary, it's encoding something. Anyway now I found that the X and Y I mentioned, which I found mentioned on a forum, are not in the signature, but in the certificate. Instead, the signature is in P1363 format, i.e. it's made of two strings representing R and S of the algorithm:
Last element of CBOR array contains the signature of the greenpass; it's made of 64 bytes, which must be split in 2 to get values "R" and "S"; in our example:
A4EE9016C1A74CCF9CAAB905492D698F6992A8FA30C20DB6180F06040C4870A845BB4B3A1CE3F4ED529CC78E66322547D62637C74AB17919C0AA52A614795E9E This is a sequence of alphamumeric couples, each one represeting an hexadecimal number. It should (to be confirmed) represent a signature in P1363 format, which should be converted to DER format to be used in OPENSSL.
Splitted:
R: A4EE9016C1A74CCF9CAAB905492D698F6992A8FA30C20DB6180F06040C4870A8 S: 45BB4B3A1CE3F4ED529CC78E66322547D62637C74AB17919C0AA52A614795E9E
@jumpjack so you can then close this ticket? 😁
Any idea how to process the results for "signature" coming from this javascript line?
[headers1, headers2, cbor_data, signature] = CBOR.decode(unzipped)
For signature of Mickey Mouse I get:
d6bfd4244c5f5c532ed4229de23f683a471173c1a8940dbe853186ecce576d7c263f09c91ad5b9c072455dc4ebdda222b27c2bb75c118357ebe85d3286a52654
How do I turn it into something like this?
I decode cbor_data using:
But it does not work for signature.
RangeError: Offset is outside the bounds of the DataView