1 查看 jks
keytool -list -v -keystore /Users/lipengfei/Desktop/android/androidproject.jks
密钥库类型: jks
密钥库提供方: SUN
您的密钥库包含 1 个条目
别名: ddgj
创建日期: 2018-11-16
条目类型: PrivateKeyEntry
证书链长度: 1
证书[1]:
所有者: CN=cn, OU=cn, O=cn, L=cn, ST=cn, C=cn
发布者: CN=cn, OU=cn, O=cn, L=cn, ST=cn, C=cn
序列号: 7576600d
有效期为 Fri Nov 16 11:39:38 CST 2018 至 Tue Nov 10 11:39:38 CST 2043
证书指纹:
MD5: xx:xx:xx:xx:xx:xx:66:7B:C1:B2:50:xx:00:xx:00:9C
SHA1: xx:xx:xx:C3:02:xx:2A:E4:xx:20:0B:21:xx:37:9F:xx:26:DA:C1:18
SHA256: xx:xx:xx:xx:xx:xx:xx:xx:B4:FE:xx:78:CC:5C:xx:E1:5D:xx:21:B8:5B:7E:AE:7D:40:51:C8:91:4A:4B:3F:72
签名算法名称: SHA256withRSA
主体公共密钥算法: 2048 位 RSA 密钥
版本: 3
2 cre证书
keytool -list -rfc -keystore /Users/lipengfei/Desktop/android/androidproject.jks -storepass 123456
密钥库类型: jks
密钥库提供方: SUN
您的密钥库包含 1 个条目
别名: ddgj
创建日期: 2018-11-16
条目类型: PrivateKeyEntry
证书链长度: 1
证书[1]:
-----BEGIN CERTIFICATE-----
XXXXXXXXXXXXXXCCAiOgAwIBAgIEdXZgDTANBgkqhkiG9w0BAQsFADBOMQswCQYD
bjELMAkGA1UECBMCY24xCzAJBgNVBAcTAmNuMQswCQYDVQQKEwJjbjELMAkGA1UE
CxMCY24xCzAJBgNVBAMTAmNuMB4XDTE4MTExNjAzMzkzOFoXDTQzMTExMDAzMzkz
OFowTjELMAkGA1UEBhMCY24xCzAJBgNVBAgTAmNuMQswCQYDVQQHEwJjbjELMAkG
A1UEChMCY24xCzAJBgNVBAsTAmNuMQswCQYDVQQDEwJjbjCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAIclHpMCY50D+3fZ8xEW6HLUHxzj0JHY5NjH4KCI
rd0oU7GpgP/IaFb/rlh/3WU+S1ObdHZ56dvWQasy0fvzl2WlL0SdECa0mJKOabks
BL+70UL3tr/CxS/JQWMIB/UpKRXvgbuqXst8eXLENOkRLz/LUcdcuKyf0wljgofb
yqsrekO/DCk+tVBNfyTqvTOblwwtRL6zFJGyJ6xIJhKDiaTgNobeY7IlTpJlt5EC
IOGGhhIC1LCEOGoljZJnCy+9yyfmBNonhW/iFBd7f0LiZ1I3WhrkuF+Rgnny4Js1
VlPSzDrhjDkP3d4bYuvYr8CtbEZebRcEBSwCKF6SfOtHbIMCAwEAAaMhMB8wHQYD
VR0OBBYEFK5O6Jj7cPy0HVsoFWtMhpOpTV+AMA0GCSqGSIb3DQEBCwUAA4IBAQAQ
JSavzixRa5J/G+0saC2LO/+MinTdvA6iOGBmPc9GVKpsDCArpPv2RQ4yWbYnK5fj
PaQ61em26aKf5utYWabZkzpGHoopEaoBZ+EIpNKCB/k61PQLzW6Nyb0zDWJj6fQa
g3dMQkN55hgWFwh5Zg+2WCizVQdjf3T2GEX8xuxwrEH9C/ABcp3RO81pkOvuGHMw
8lAuGBBvIzvMSqcrAOcO2W+3TfsrxIoDabW8qSAfNzoXZmjvDggS+zNpHJw63KzB
7nCdpnGZ7wI0Gb++gAUyK5EqnZVFssG5PI+LTQgyZeVpOdfHVOQVz0OvtP7hqijJ
mDYbBmWmTR4BXXXXXXXX
-----END CERTIFICATE-----
*******************************************
*******************************************
3 生成 .p12 文件
keytool -importkeystore -srckeystore /Users/lipengfei/Desktop/android/androidproject.jks -destkeystore /Users/lipengfei/Desktop/android/fanyfull.p12 -deststoretype PKCS12 -srcalias ddgj -deststorepass 123456 -destkeypass 123456
4 生成私钥
openssl pkcs12 -nodes -in /Users/lipengfei/Desktop/android/fanyfull.p12 -out /Users/lipengfei/Desktop/android/private.pem
4 生成公钥
openssl pkey -in /Users/lipengfei/Desktop/android/private.pem -pubout -out /Users/lipengfei/Desktop/android/public.pem