天道酬勤,学无止境

keystore

Enable Java to permit expired certificate

问题 是否有任何命令行标志使 Java 允许过期证书? 现在,由于证书已过期,我收到以下异常。 Caused by: java.security.cert.CertificateExpiredException: NotAfter: {PAST DATETIME} at sun.security.x509.CertificateValidity.valid(CertificateValidity.java:274) at sun.security.x509.X509CertImpl.checkValidity(X509CertImpl.java:629) at sun.security.x509.X509CertImpl.checkValidity(X509CertImpl.java:602) at org.apache.ws.security.validate.SignatureTrustValidator.validateCertificates(SignatureTrustValidator.java:103) 我尝试了以下命令行标志,它不会忽略证书过期检查 -Dcom.sun.net.ssl.checkRevocation=false 我们的应用程序在路径/myapplication下的 tomcat 中运行。 所以我创建了另一个应用程序

2022-05-14 13:32:45    分类:技术分享    java   ssl   ssl-certificate   keystore

OkHttp trusting certificate

问题 在我的 android 应用程序中,我需要使用 OkHttp 库向我的服务器执行一些请求。 我有一个 ssl 证书,它由四个部分组成: AddTrustExternalCARoot.crt COMODORSAAddTrustCA.crt COMODORSADomainValidationSecureServerCA.crt www_mydomain_com.crt 我已经在 portecle 1.9 中导入了所有部件,然后我设置了我的密钥库密码并导出了 .bks 证书。 然后我在我的应用项目的 res/raw 文件夹中插入了这个 mycert.bks。 现在我正在尝试使用以下代码通过 https 连接到我的服务器: OkHttpClient client = new OkHttpClient(); try{ client.setSslSocketFactory(getPinnedCertSslSocketFactory(context)); RequestBody formBody = new FormEncodingBuilder() .add("params", "xxx") .build(); Request request = new Request.Builder() .url("https:\\mydomain.com") .post(formBody)

2022-05-12 05:55:04    分类:技术分享    android   ssl   https   keystore   okhttp

Can not get facebook sdk hash key.

问题 我想获取 Facebook Android SDK 的发布密钥哈希。 我关注了 facebook 入门教程,它说将此代码粘贴到您的终端; keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64 当我使用我的密钥别名将此代码粘贴到终端时,它会显示: Illegal option: sancaktaroglu 我的密钥别名是emre sancaktaroglu ,它在我的名字和姓氏之间包含空格,因此我无法获得正确的密钥哈希。 我怎么解决这个问题 ? 谢谢 ! 回答1 从 keytool 文档中: 如果选项值包含空格(空格),则必须引用它们。 所以只是引用它: -alias "emre sancaktaroglu" 回答2 $ keytool -exportcert -alias androiddebugkey -keystore "C:\Documents and Settings\Administrator.android\debug.keystore" | "C:\OpenSSL\bin\openssl" sha1 -binary |"C:\OpenSSL\bin\openssl"

2022-05-10 22:58:04    分类:技术分享    android   facebook   alias   release   keystore

Android, Multiple Apps, Multiple Customers, One Keystore [duplicate]

问题 这个问题在这里已经有了答案: 我可以使用同一个密钥库文件来签署两个不同的应用程序吗? (7 个回答) 5年前关闭。 我有 15 个 android 应用程序要构建和托管(以及将来更新)。 每个应用程序都有一个唯一的包名称。 5 个应用程序将托管在一个 google play 帐户上。 其他 10 个将在 10 个个人客户帐户上。 我不想要应用程序之间的链接,并且希望将来能够单独更新它们。 问题:我可以为所有人使用 1 个密钥库吗? 还是每个应用程序都需要一个唯一的密钥库? 这会影响未来的更新过程吗? 还是我只需要保持包名相同以确保成功更新? 回答1

2022-05-03 14:50:08    分类:技术分享    android   keystore

Enable Java to permit expired certificate

Is there any command line flag(s) to enable Java to permit expired certificates? Right now I'm getting the following exception as the Certificate is expired. Caused by: java.security.cert.CertificateExpiredException: NotAfter: {PAST DATETIME} at sun.security.x509.CertificateValidity.valid(CertificateValidity.java:274) at sun.security.x509.X509CertImpl.checkValidity(X509CertImpl.java:629) at sun.security.x509.X509CertImpl.checkValidity(X509CertImpl.java:602) at org.apache.ws.security.validate.SignatureTrustValidator.validateCertificates(SignatureTrustValidator.java:103) I've tried the following

2022-05-02 19:02:58    分类:问答    java   ssl   ssl-certificate   keystore

From certificate Alias to PEM File with private key included using Java

问题 我有这段代码可以使用别名生成 CER 文件: public class TestFromAliasToCER { public static final int KEY_SIZE = 1024; public static final String BEGIN_CERT = "-----BEGIN CERTIFICATE-----"; public static final String END_CERT = "-----END CERTIFICATE-----"; public final static String LINE_SEPARATOR = System.getProperty("line.separator"); public static void main(String[] args) throws FileNotFoundException, IOException, NoSuchAlgorithmException, NoSuchProviderException, KeyStoreException, CertificateException { KeyStore keyStore = KeyStore.getInstance ("Windows-MY"); keyStore.load (null, null); Enumeration<String>

2022-05-02 13:11:28    分类:技术分享    java   ssl   x509certificate   keystore   pem

How do you install the keystore in flutter?

I tried to install Keystore in flutter so, inside the terminal, I wrote: (keytool -genkey -v -keystore c:\Users\USER_NAME\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key) However, it said: 'key tool' is not recognized as an internal or external command, operable program, or batch file. And it doesn't work. How can I fix it? Is there something I should add in the Environment variables? (I'm using Windows 10).

2022-05-01 19:48:10    分类:问答    android-studio   flutter   keystore

java.security.NoSuchAlgorithmException: (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)

I tried many solutions from the web. But no solution seem to be fit to me. We recently upgraded tomcat server 8.0.x to 8.5.x. With 8.0.x Everything worked fine. But after upgrade, We are facing this error when we are trying to connect to a server from java's Spring restTemplate with https. I did not see any errors while connecting through http. ":java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext); nested exception is java.net.SocketException: java.security

2022-05-01 18:48:51    分类:问答    java   tomcat   https   keystore   resttemplate

Error building AAB - Flutter (Android) - Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available

I am trying to build an AAB for my flutter app. I generated the keystore using the following below command: keytool -genkey -v -keystore ~/pc-keystore.jks -keyalg RSA -keysize 2048 -validity 10000 -alias pckey I have a key.properties file, and I have referenced it using the provided code in the flutter docs. How can I solve this Java related issue? My program throws the following exception * What went wrong: Execution failed for task ':app:signReleaseBundle'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Failed to read key pckey from store

2022-04-30 23:28:03    分类:问答    java   android   flutter   keystore

Can not get facebook sdk hash key.

I want to get my release key hash for Facebook Android SDK. I followed facebook getting started tutorial and it says paste this code to your terminal; keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64 When I paste this code to terminal with my key alias it says : Illegal option: sancaktaroglu My key alias is emre sancaktaroglu, It contains space between my name and surname so I can not get my correct key hash. How can I solve this problem ? Thanks !

2022-04-29 11:23:02    分类:问答    android   facebook   alias   release   keystore