Embedded Signatur for plain D source files
see also SignedSourceCode
can also be just for C/C++ and Java
1/5 The Source
Verify that your source file is functional.
| int main(char[][] arg){
printf("Hello!\n");
return 0;
} |
|
|
2/5 Open Comments
Add the commend closing */ to the start of the file and the commend opening /* to the end of the file.
| */
int main(char[][] arg){
printf("Hello!\n");
return 0;
}
/* |
|
|
3/5 Create Signature
gpg --out output --clearsign input
or
gpg --clearsign < input > output
|
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
*/
int main(char[][] arg){
printf("Hello!\n");
return 0;
}
/*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFBuNvV3w+/yD4P9tIRAppeAJ0fNyjlV3nKA25WdmznkjSgLBx/kQCeP1Xf
sXnFHYeolWo4VWme3Ao8L4Y=
=ClPq
-----END PGP SIGNATURE-----
|
|
|
4/5 Close Comments
Add the missing /* and */.
|
/*
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
*/
int main(char[][] arg){
printf("Hello!\n");
return 0;
}
/*
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
iD8DBQFBuNvV3w+/yD4P9tIRAppeAJ0fNyjlV3nKA25WdmznkjSgLBx/kQCeP1Xf
sXnFHYeolWo4VWme3Ao8L4Y=
=ClPq
-----END PGP SIGNATURE-----
*/
|
|
|
5/5 Verify the Signature
gpg input
or
gpg < input