How to sign a public key with a private key and then reupload it to server again?

Asked by Pruthvirajsinh

Greetings sir.

I am making a PKS on basis of hockeypuck.

Aims are:
1.A public key should not be uploaded to PKS until it's email is verified.---Done
2.keys must be deleted on request from all servers.
--- Done. Made DB schema constraints with on delete cascade
--- Done.Current set recon algo modified to support deletion in sync.

3.Sign the public key of verified email and re upload back to the server so that others can verify as well.
Status : Stuck
   got publickey from armor,private key from armor and they are in their respective objects i.e. openpgp.Pubkey and packet.privateKey . I am not able to sign public key from private key using sig.

        //private key is encrypted hence call decrypt first
 priKey.Decrypt([]byte(pripwd))
 sig := new(packet.Signature)
 //Prepare sign with our configs/////IS A MUST
 sig.Hash = crypto.SHA512
 sig.PubKeyAlgo = priKey.PubKeyAlgo
 sig.CreationTime = time.Now()
 dur := new(uint32)
 *dur = uint32(365 * 24 * 60 * 60)
 sig.SigLifetimeSecs = dur //a year //dur is optional
 issuerUint := new(uint64)
 *issuerUint = priKey.KeyId
 sig.IssuerKeyId = issuerUint
 sig.SigType = packet.SigTypeGenericCert
I have tried both main publickey and publickey of subKey. e.g. errorsigning := sig.SignKey(reqPubKey, priKey, nil)
       errorsigning := sig.SignKey(subP.PublicKey, priKey, nil)
Now the sig has required signature but it doesnt seem to work as expected.
On hp at gazzang i am able to see sig on pub ID,but not on current rc1.
also when signatures are verified using gpg --check-sigs command they are not matched.

Very nice project and openpgp lib ,Your code is always there to clear any confusions but I am stuck here and been pulling my hair out for 2 days.Hoping to get a reply soon.
Thanks a lot

Pruthvirajsinh Chauhan
Sem-4,ME-CE
Gujarat Technological University
e-mail: <email address hidden>

Question information

Language:
English Edit question
Status:
Open
For:
hockeypuck Edit question
Assignee:
Casey Marshall Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Casey Marshall (cmars) said :
#2

I've been travelling and haven't been able to give Hockeypuck the love it deserves last couple of weeks. I'll try to find some time to get you an answer. Might be a regression in 1.0-rc1.

Revision history for this message
Pruthvirajsinh (pruthvirajsinh) said :
#3

I have reported issue regarding openpgp signing and armor.encode of go lang.Please checkout them.
https://code.google.com/p/go/issues/detail?id=7241

Can you help with this problem?

Provide an answer of your own, or ask Pruthvirajsinh for more information if necessary.

To post a message you must log in.