x509certificate

Could not validate certificate signature?

末鹿安然 提交于 2019-12-03 23:30:41
问题 I use the SSL Socket and Trustmanager from this side Self signed SSL but i keep getting following error: 09-28 19:52:41.942: WARN/System.err(10101): javax.net.ssl.SSLHandshakeException: org.bouncycastle.jce.exception.ExtCertPathValidatorException: Could not validate certificate signature. What is wrong? I already checked different posts on stackoverflow but i can`t seem to get it to work. My code: SchemeRegistry schemeRegistry = new SchemeRegistry(); // http scheme schemeRegistry.register(new

Import .p12-file into AndroidKeyStore

限于喜欢 提交于 2019-12-03 22:48:42
The user has saved a .p12-file (e.g. his S/MIME certificate) on SD-Card. I want to load this certificate (or the extracted private and public key) into the AndroidKeyStore. File file = new File(pathToP12File); Certificate c = null; // TODO: convert file into something I can load into the keystore KeyStore ks = KeyStore.getInstance("AndroidKeyStore"); ks.load(null); ks.setCertificateEntry("myCertAlias", c); What's the best way to convert the file into something which can be set as a certificate entry in the keystore? It's possible to interpret the p12-file as a keystore, extract the certificate

iPhone Public-Key Encryption SecKeyEncrypt returns error 9809 (errSSLCrypto)

☆樱花仙子☆ 提交于 2019-12-03 21:16:45
I am trying to use the iPhone's PKI libraries to encrypt a short string (12345678), but I keep getting the error -9809 (i.e. errSSLCrypto) whenever I try to use SecKeyEncrypt. The SecureTransport.h header file describes this error simply as "underlying cryptographic error", which wasn't very meaningful. My code is as follows: - (NSData *)encryptDataWithPublicKey:(NSString *)plainText { OSStatus result = -1; NSData *plainTextData = [plainText dataUsingEncoding:NSASCIIStringEncoding]; size_t plainTextLength = [plainTextData length]; SecTrustRef trustRef; SecTrustResultType trustResult;

How do I validate an android.net.http.SslCertificate with an X509TrustManager?

依然范特西╮ 提交于 2019-12-03 19:50:58
问题 Android's WebViewClient calls onReceivedSslError when it encounters an untrusted cert. However, the SslError object I receive in that call doesn't have any way public way to get to the underlying X509Certificate to validate it against an existing TrustStoreManager . Looking at the source, I can access the X509Certificate 's encoded bytes thusly: public void onReceivedSslError(WebView view, SslErrorHandler handler, SslError error) { Bundle bundle = SslCertificate.saveState(error.getCertificate

Getting local machine and all user certificates with PowerShell

核能气质少年 提交于 2019-12-03 18:00:32
问题 I can get all certificates in local machine and current user stores by doing Get-ChildItem Cert: -Recurse | ? { $_ -is [System.Security.Cryptography.X509Certificates.X509Certificate2] } How do I do the same thing for all users on the local machine? (I need to find a certain certificate and all I know is a serial number and that it is definitely installed in some store) 回答1: User certificates are stored in the user's registry hive, so you'd need to either log in as the particular user or load

WindowsCryptographicException: Keyset does not exist

若如初见. 提交于 2019-12-03 17:19:58
I want to create or obtain a certificate, create a pfx-file, load it and have IdentityServer use it. However, IdentityServer is not able to use my pfx. How to successfully create a pfx and have IdentityServer use it? I have an IdentityServer4 web solution running on localhost with ASP.Net Core. I am preparing the solution for production running on Azure, and is adding a certificate to the IdentityServer pipeline instead of the developer signing certificate. Typically this means to swap code like services.AddIdentityServer() .AddDeveloperSigningCredential() with services.AddIdentityServer()

Spring Boot - require api key AND x509, but not for all endpoints

青春壹個敷衍的年華 提交于 2019-12-03 17:18:48
Java 11, Spring Boot 2.1.3, Spring 5.1.5 I have a Spring Boot project in which certain endpoints are guarded by an API key. This works just fine at the moment with this code: @Component("securityConfig") @ConfigurationProperties("project.security") @EnableWebSecurity @Order(1) public class SecurityJavaConfig extends WebSecurityConfigurerAdapter { private static final Logger LOG = LoggerFactory.getLogger(SecurityJavaConfig.class); private static final String API_KEY_HEADER = "x-api-key"; private String apiKey; @Override protected void configure(HttpSecurity httpSecurity) throws Exception {

How to get the signature algorithm out of a certificate?

吃可爱长大的小学妹 提交于 2019-12-03 16:04:27
I want to use the PHP function openssl_verify() to verify the signatures of different X.509 certificates. I have all it needs (certificate, $data, $signature, $pub_key_id) except of the signature algorithm but which is stored in the certificate. My simple question is: How can I extract signature algorithm from certificates? HomeCoder Look at this question , you can do it similar, try this: private function GetCertSignatureAlgorithm($certSignatureBinary, $pubKeyResourceId) { if(false === openssl_public_decrypt($certSignatureBinary, $sigString, $pubKeyResourceId)) { return false; } if (empty(

Convert certificate .pem to .der/.cer [closed]

为君一笑 提交于 2019-12-03 15:00:16
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm trying convert .pem to .cer using OpenSSL... openssl x509 -inform PEM -in root.pem -outform DER -out root.cer But, I don't know how to install the certificate on IIS 7.0 over Win Server 2008. I read some tutorials about it and tried to install the cert in IIS 7.0 Server Certificates -> complete certificate request -> The following error appears Cannot find the certificate request associated with

Can't read CurrentUser certificates from X509Store

删除回忆录丶 提交于 2019-12-03 13:59:49
I'm developing ASP.NET 4.0 web application, and I want to read the current user certificates from X509Store. Reading the LocalMachine certificates works fine, but if I set the StoreLocation to CurrentUser, it gives me an empty collection. The following code works fine : X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine); // StoreLocation.CurrentUser store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly); I've checked my personal store (via certmgr.mmc) and I'm sure that I have the certificates. What am I missing ? ( store.Certificates is empty ) It appears that you