> On 12 Jan 2015, at 20:37, 2551 <2551p...@gmail.com> wrote:
> 
>> On 12 Jan 2015, at 18:44, Roland King <r...@rols.org> wrote:
>> 
>> Part of the problem, at least for me, is I haven’t figured out yet what you 
>> actually have that you’re trying to verify. Is it a string, a file
>> 
> 
> 
> Thanks, Roland. 
> 
> It's a string that looks like this:
> 
> DAWFE-F1AU6-6ZBFX-4FWHE-JQN8V-SSSUQ-JY3DL-WQY4B-A9KHP-SZA5V-765MN-63Z8W-GF9H5-C6XCW-N9L7A-K
> 
> and they are generated by code that starts  and ends with
> 
> -----BEGIN DSA PRIVATE KEY----
> 
> 
> -----END DSA PRIVATE KEY-----
> 
> 
> Does that help at all?


I’m sure it all helps. I don’t know the answer here but I am trying to ask 
questions which might point to a solution. 

The code which generates it, the key you most sensibly removed the bulk of :), 
I’m assuming that’s not really code which generates it, it’s your private key 
which you uploaded in that format to the Fastspring website so they can use it 
to sign things. 

Now to the key - it looks like a registration key. Iterating quickly through 
the list of ‘supported types’ I find that it looks remarkably like a CocoaFob 
key

http://cocoadev.com/CocoaFob <http://cocoadev.com/CocoaFob>

The example on there is 

GAWQE-FCUGU-7Z5JE-WEVRA-PSGEQ-Y25KX-9ZJQQ-GJTQC-CUAJL-ATBR9-WV887-8KAJM-QK7DT-EZHXJ-CR99C-A

So my guess would be that you have somewhere on the Fastspring site asked them 
to generate a CocoaFob key. There must be an option there somewhere to say what 
kind of key you want or it wouldn’t know. Perhaps that isn’t a CocoaFob key, 
but I didn’t instantly see another one which has 15 4 character sequences and a 
single character, but I didn’t look too hard.  

What that string of stuff most likely is is .. some information you have 
supplied, like a user name or serial number or whatever fields you told 
FastSpring you want in your license to be, and it’s produced a piece of binary 
information with those fields in it, in a defined format, and then it’s signed 
it with the private key you gave it to produce another binary sequence. Then 
that sequence has been encoded into probably Base32, possibly modified base32

So the normal way to verify that key would be to download CocoaFob and use 
whatever ObJC function it has to verify keys. Or you go find documentation on 
CocoaFob’s file format, which I’m sure is available, and you work out how to 
turn that string back into binary data, and you use your public key to ‘verify’ 
it by doing the reverse of what was done to generate it. That requires first of 
all understanding the format. 

You mentioned earlier that CocoaFob seemed to be a little unloved. Surely if 
FastSpring is still supporting it for current key generation then perhaps it’s 
not that unloved, at least the probably very small piece of it which verifies 
keys and gives you the information encoded in them which it appears is all you 
really want. Perhaps there is tons more in the framework which doesn’t matter, 
but I’d expect the key verification and information extraction piece should be 
no more than a couple of hundred lines of code which don’t change ever. 

So next step is to work out what you’ve actually asked Fastspring to give you. 
Is it CocoaFob or something else? Then decide if you want to use another 
format, try to resurrect the library for the format you have, or find out what 
the format string is, in binary, how it was encoded and thus how you can verify 
it. When you get to the point of being able to say ‘my license key returned by 
Fastspring represents the following binary information (NSData*..) and it was 
signed using a private key for which this .. is the public key, how can I 
verify that data, it may then be possible to provide a few lines of code to do 
that thing. 

It’s going to be better to use the library! 





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to