When publishing an application or a custom rom you need to sign the .apk or .zip files with a certificate using a private key. The Android system uses the certificate to identify the author of an application and establish trust relationship between applications. The classic way of doing this was to use keytool then sign it with jarsigner. But This Is Easy Way
It's very simple, it will take a signed or unsigned apk and re-sign.
It will also batch sign all apk's that are in the INPUT folder.
It also includes the tools needed to create your own signature to sign the apk's
Download Apk Signer-v0.2