Use String.format instead of Long.toHexString to create hex string of key id in getSecretKey method

`Long.toHexString` does not output leading zeros, which causes the comparison to fail if the key id is something like `0ACA2060`. This caused package signing to fail if one was unlucky enough to have a signing key with such a key id. The patches in this pull request add a test, test data and fix for this case.