|
On further investigation, I copied the methods from
AnotherCompanySerialNumber and managed to get it to work, however the
unlock key was about a mile long so I tried to change the coding from
Elgamal back to PC1 by changing the serialNumberProtectorClass. Of
course this required different #instanceEncodingKey/#instanceDecodingKey.
In D5 the encoding was generated from
(PC1Cipher withStrength: 56) key
but this failed as PC1SerialNumberProtector>>encrypt: requires an
integer instead of a byte array. So I changed the instance encoding into
LargeInteger fromBytes: (PC1Cipher withStrength: 56) key.
This did generate a key, but then the decoding failed:
testValidLicence
| key no |
key := MyCompanySerialNumber new.
no := key productId.
self assert: (MyCompanySerialNumber fromString: (key displayString))
productId = no.
So I guess I'm still misusing something but I'm really stuck now.
Can anybody shed some light on this?
Thanks,
Ted
|