We're currently working to produce on software to decrypt S-63 maps: <http://www.iho.shom.fr/publicat/free/files/S-63_e1.1_EN_2008.pdf>
We're trying to use OpenSSL to perform the data authentication and integrity checking. However, the descriptions of data formats in the OpenSSL documentation don't seem to match the formats of data that the S-63 specification requires us to use. Specifically, part of the authentication process uses a signature file with the following format (section 5.4.2.7 of the PDF document referenced above): // Signature part R: 77D3 4D86 DA6E 6E01 7058 7140 74FC 7E3D 21CD E80B. // Signature part S: 04A1 7B52 081F B6CE 10FE 5AD9 1CCE 3F25 FEAC DA05. // Signature part R: 8FD6 2AC7 27D2 8D0B CD27 BDF2 5CC6 9656 10E3 751F. // Signature part S: 3DE7 DA37 5A40 80FC 4203 5C6E 37DE A984 2A88 2BDC. // BIG p D0A0 2D76 D210 58DA 4D91 BBC7 30AC 9186 5CB4 036C CDA4 6B49 4650 16BB 6931 2F12 DF14 A0CC F38E B77C AD84 E6A1 2F2A A0D0 441A 734B 1D2B E944 5D10 BA87 609B 75E3. // BIG q 8E00 82E3 C046 DFE6 C422 F44C C111 DBF6 ADEE 9467. // BIG g B08D 786D 0ED3 4E39 7C6B 3ACF 8843 C3BF BAB1 A44D 0846 BB2A C3EE D432 B270 E710 E083 B239 AF0E A5B8 693B F2FC A03B 6A73 E289 84FF 8623 1394 996F 6263 0845 AA94. // BIG y 444B BA17 1758 0DAF 71AB 52A5 6CCA 8EAB 4C51 E970 0E37 B17B BB46 C0B9 4A36 F73F 0244 7FBD AE5B 7CA9 3870 5AB9 E9EE 471C E7B0 1004 6DF1 3505 42B3 0332 AE67 69C6. This file divides in many interesting ways, as can be seen in the PDF document. As part of the authentication process, my understanding is that the last four parts (p, q, g, and y) need to be turned into a public key in order to be useful. Obviously, each pair of bytes is a hex-encoded 8-bit value. I've tried converting the ASCII bytes into the binary bytes that they represent, concatenating them all together in the order provided here, and executed the following code: std::string binaryKey = ... initialized from ASCII data ... const char* data = binaryKey.c_str(); DSA* key = d2i_DSAPublicKey( 0, reinterpret_cast< const unsigned char** >( &data ), binaryKey.size() ); This returns the error "ASN1_get_object:header too long". I can only presume that I don't have the data in the correct format, but I can't tell from the documentation what the format should be. I would appreciate some pointers.