(obj *gitobject.GitObject)
| 14 | } |
| 15 | |
| 16 | func parseGitSignature(obj *gitobject.GitObject) *gitSignature { |
| 17 | if obj.Signature == "" { |
| 18 | return &gitSignature{} |
| 19 | } |
| 20 | sig, err := gitsign.ParseSignature([]byte(obj.Signature)) |
| 21 | if err != nil { |
| 22 | return &gitSignature{} |
| 23 | } |
| 24 | out := &gitSignature{} |
| 25 | if s := sig.PGPSignature; s != nil { |
| 26 | out.PGPSignature = &PGPSignature{ |
| 27 | Version: s.Version, |
| 28 | } |
| 29 | if s.IssuerKeyId != nil { |
| 30 | ki := *s.IssuerKeyId |
| 31 | // convert uint64 to hex string |
| 32 | out.PGPSignature.KeyID = fmt.Sprintf("%016x", ki) |
| 33 | } |
| 34 | } |
| 35 | if s := sig.SSHSignature; s != nil { |
| 36 | out.SSHSignature = &SSHSignature{ |
| 37 | Version: int(s.Version), |
| 38 | PubKey: ssh.FingerprintSHA256(s.PublicKey), |
| 39 | } |
| 40 | } |
| 41 | return out |
| 42 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…