I tried to reuse code from DL_PublicKey_GFP_OldFormat() in order to transform from 
version 4.1 public key format to a new format. This is sample code:

ByteQueue bq, bq1;

// assume MyPublicKey is array of old-style public key bytes
bq.Put(MyPublicKey, sizeof(MyPublicKey));

NR<SHA1>::PublicKey key;
BERSequenceDecoder seq(bq);
Integer v1(seq);
Integer v2(seq);
Integer v3(seq);
Integer v4(seq);

key.AccessGroupParameters().Initialize(v1, v2, v3);
key.SetPublicElement(v4);
seq.MessageEnd();
key.Save( bq1 ); // presumably key will be now in the correct new format

// create verifer given key
MyNewVerifier=new NR<SHA1>::Verifier(bq1);

However, verification did not succeed. I don't know if I am missing something 
elementary or tricky. Also, while the key format is documented as changed I assumed 
that the binary format of the signature has remained the same.

Thanks for any suggestions,
Tony






Reply via email to