help //java.security.NoSuchAlgorithmException: 1.2.840.113549.1.5.13 SecretKeyFactory not available
李周华
joey.lee at nubia.com
Tue Aug 23 08:16:19 UTC 2022
Hi , guys
I have use the follow openssl commands to create a key pair for android app signing.
Follow this link https://source.android.com/docs/core/ota/sign_builds#manually-generating-keys
# generate RSA key
openssl genrsa -3 -out temp.pem 2048
Generating RSA private key, 2048 bit long modulus
....+++
.....................+++
e is 3 (0x3)
# create a certificate with the public part of the key
openssl req -new -x509 -key temp.pem -out releasekey.x509.pem -days 10000 -subj '/C=US/ST=California/L=San Narciso/O=Yoyodyne, Inc./OU=Yoyodyne Mobility/CN=Yoyodyne/emailAddress=yoyodyne at example.com'
# create a PKCS#8-formatted version of the private key
openssl pkcs8 -in temp.pem -topk8 -outform DER -out releasekey.pk8 -nocrypt
# securely delete the temp.pem file
shred --remove temp.pem
The key file was successfully generated, but when I compile the entire project signature app, the following error is reported:
java.security.NoSuchAlgorithmException: 1.2.840.113549.1.5.13 SecretKeyFactory not available
at java.base/javax.crypto.SecretKeyFactory.<init>(SecretKeyFactory.java:122)
at java.base/javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:168)
at com.android.signapk.SignApk.decryptPrivateKey(SignApk.java:250)
at com.android.signapk.SignApk.readPrivateKey(SignApk.java:272)
at com.android.signapk.SignApk.main(SignApk.java:1210)
My ubuntu version is 20.04.4 LTS
openjdk version is 11.0.15 2022-04-19
openssl version is 1.1.1r-dev built on Mon Aug 22 11:19:51 2022 UTC
Any help is welcome.
******************************************************
努比亚技术有限公司 基础框架团队 李周华
联系电话:18706866323
地址:西安市高新唐延南路10号中兴产业园A座101
Email:0016003031 at nubia.com
******************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20220823/888f2c91/attachment.htm>
More information about the openssl-users
mailing list