Question

I have created a Self-Signed Certificate in Mac OS using Keychain Access to be used as a certificate for my AIR Application. After exporting a release build for my app in Flash Builder 4.6, I have verified my apk using jarsigner by executing the following command:

jarsigner -verify -verbose -certs myapp.apk

then, the following message was returned:

jar verified.

Warning: 
This jar contains entries whose signer certificate is not yet valid. 

is it ok to publish this app on Google Play? if possible, how to validate my self-signed certificate?

Was it helpful?

Solution

root cause for my problem: since Google Play requires a certificate to be expired after October 22, 2033, i have changed my system date to an advance date.

Valid value for the validity period of Keychain Access certificate assistant is 20 years so if I'll create a new certificate, it will expire on June 26, 2033 which fails to achieve the requirement.

A validity period for an X509 certificate is the number of days the certificate
is valid from the time it is issued. Certificates issued by Certificate Assistant
have a maximum validity period of 20 years.

upon using this certificate for the code signing of my air application, Google Play prompts an error upon uploading the apk

Upload failed

You uploaded an APK signed with a certificate that is not yet valid. 
You need to sign your APK with a certificate that is currently valid. 

Learn more about signing.

So i created a new certificate using keytool by executing the following commands:

$ keytool -keystore cert.jks -genkeypair -alias cert -keyalg RSA -keysize 2048 \
  -validity 18250 -dname 'CN=cert,OU=org,O=org,L=location,ST=state,C=PH'

$ keytool -keystore cert.jks -exportcert -alias cert \
  | openssl x509 -inform der -text

$ keytool -importkeystore -srckeystore cert.jks -destkeystore cert.p12 \
  -srcstoretype jks -deststoretype pkcs12
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top