Previously I used jarsigner tool for APK signatures. But jarsigner provides v.1 sign only.
So, I'm trying to move signing process to apksigner because I need v.2 signature as well.
And it works well when I use .jks for it.
Please, check example below.
apksigner sign \ --ks some.jks \ --ks-pass pass:somepass \ --v1-signing-enabled true \ --v2-signing-enabled true \ --v3-signing-enabled true \ --v4-signing-enabled false \ --out DESTINATION_APP \ PATH_TO_APK
Also I need option to sign APK with key and cert parameters.
I've tried to use my .key and .crt file from .jks storage but it returns me an error.
According to the documentation key file must be in PKCS#8 format and cert in X.509.
Could you please tell me how can I export .key and .crt in correct formats?