Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
699 views
in Technique[技术] by (71.8m points)

configuration - Sign git commit with x509 certificate in corporate environment

I have learned from the documentation that it is possible to sign git tags and commits.

git config --global user.signingkey 0A46826A

Docs: https://git-scm.com/book/en/v2/Git-Tools-Signing-Your-Work

This works for GPG. Has somebody done something like this with X509 user certificates?

It looks like GPG is not compatible or interchangeable with x509 pki certificates. Since this is in a corporate environment GPG is not a option.

It would be great if somebody could share thoughts or experiences how this could be done with x509 certs? What would be required and what it takes to implement something like this?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

GitHub provides some helpful instructions on specifying signing keys including how to sign using X.509 certificates using smimesign on Windows and Mac.

For Git versions 2.19 and newer

$ git config --global gpg.x509.program smimesign
$ git config --global gpg.format x509

For Git versions 2.18 and older

$ git config --global gpg.program smimesign

On Linux you can use gpgme instead. Add your certificate with gpgme --import cert.p12. You may also need to import the root and any intermediate certificates before gpgme will let you sign anything.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...