x509certificate

Generating self-signed certificate without external libraries

北战南征 提交于 2019-11-29 08:44:39
I'm curious to know if there's a simplish way to create a self-signed certificate comparable to the below New-SelfSignedCertificate command (other providers are OK too, for instance). I want to use only the .NET libraries without P/Invoke or external libraries such as Bouncy Castle or without calling PowerShell from the application. New-SelfSignedCertificate -DnsName $certificateName -CertStoreLocation $certificateStore -KeyExportPolicy Exportable -Provider "Microsoft Enhanced RSA and AES Cryptographic Provider" -NotAfter $certificateNotAfter I suppose the simplest alternative would be to call

org.apache.http.client.ClientProtocolException

回眸只為那壹抹淺笑 提交于 2019-11-29 08:11:46
问题 I've made an Android application that uses a X509 certificate (that is in the folder res/raw/mykeystore.bks) to sign to remote server that respond on the 9006 port. the server ask me for a login (username, password). when i make an HTTPGet i've the following exeption: org.apache.http.client.ClientProtocolException Here is my implementation: The main Activity: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button b=

How can I convert a pem private key to a format for windows that can be used in .NET

痞子三分冷 提交于 2019-11-29 07:55:43
I have a been given a private key that turned out to be in pkcs8 format, which I managed to turn into a pem file using the following command: openssl pkcs8 -inform der -nocrypt -in private.key -out pkey.pem I now need to convert this to pkcs12 so I can use it in .NET to create an X509 certificate (also I'd like to import it to windows cert manager). I tried this command: openssl pkcs12 -export -name myalias -in mycert.crt -inkey pkey.pem -out keystore.p12 however, I don't have the public key, I've tried using the pkey.pem file as the -in arg, but it tells me No certificate matches private key

CRL and OCSP behavior of iOS / Security.Framework?

一世执手 提交于 2019-11-29 07:48:40
问题 I'm trying to figure out what iOS' policy is when verifying certificates using Security.Framework regarding revocation of certificates. I cannot find information about this in the docs for iOS. In the context of an iPad project I'm working on at the moment, there is reason to demand checking revocation status for some certs. Anyone ideas on how to force CRL / OCSP checking during cert verification using Security.Framework? Or do I need to "fall back" to OpenSSL to accomplish this? It seems

Error Importing SSL certificate : Not an X.509 Certificate

前提是你 提交于 2019-11-29 06:06:16
问题 I am trying to Update the SSL certificate in accordance with this post . I am noob in certificates, so i followed this guide. But, when i enter keytool -keystore mycacerts -storepass changeit -importcert -file "C:\Users\Noks\Desktop\cacerts.pem" -v I get the error: keytool error: java.lang.Exception: Input not an X.509 certificate java.lang.Exception: Input not an X.509 certificate at sun.security.tools.KeyTool.addTrustedCert(KeyTool.java:1913) at sun.security.tools.KeyTool.doCommands(KeyTool

Issue in checking server certificate in checkServerTrusted

蓝咒 提交于 2019-11-29 05:21:48
I am referring Validate X.509 certificate against CA in Java this post. My implementation of checkServerTrusted look like: @Override public void checkServerTrusted(X509Certificate[] certs, String authType) throws CertificateException{ InputStream inStream; try { inStream = new FileInputStream("E:\\Desktop\\cert\\domain.crt"); CertificateFactory cf = CertificateFactory.getInstance("X.509"); X509Certificate Mycert = (X509Certificate)cf.generateCertificate(inStream); inStream.close(); if (certs == null || certs.length == 0 || authType == null || authType.length() == 0) { throw new

Apache HttpClient 4.3 and x509 client certificate to authenticate

浪尽此生 提交于 2019-11-29 05:06:07
now I looking for solution regarding task how to rewrite deprecated solution for client side x509 certificate authentication via HttpComponentsMessageSender (not relevant). For example, deprecated solution is: SSLSocketFactory lSchemeSocketFactory = new SSLSocketFactory(this.keyStore, this.keyStorePassword); Scheme sch = new Scheme("https", 443, lSchemeSocketFactory); DefaultHttpClient httpClient = (DefaultHttpClient)getHttpClient(); httpClient.getConnectionManager().getSchemeRegistry().register(sch); As new solution with CloseableHttpClient I am using: SSLContextBuilder sslContextBuilder =

What is needed to convert ASN.1 data to a Public Key? e.g. how do I determine the OID?

不想你离开。 提交于 2019-11-29 04:54:58
This code relates to DKIM signature verification used in anti-spam efforts. I have a byte[] from s1024._domainkey.yahoo.com that is ASN.1 encoded, but I don't know if that alone contains enough information to materialize a public key. Based on this class , it appears I can convert an ASN.1 key into a X509Certificate Public key, but I need to supply an OID and some ASN.1-encoded parameters. In this example I have metadata that the ASN1 key is: An RSA encoded key (ASN.1 DER-encoded [ITU-X660-1997] RSAPublicKey per RFC3447) Used with either sha1 sha256 hash algorithms Uses an OID relating to the

How to validate X509 certificate?

丶灬走出姿态 提交于 2019-11-29 04:14:04
I have to write a tool which validates if a X509 certificate is valid or not (input = cert path / subject and password). How can I do that? I don't know much about certs... Take a look at X509Certificate2.Verify() In general, RFC 3280 includes almost complete instructions regarding how to perform validation, however those instructions are very non-trivial. Additionally you would need to read RFC 2560 (OCSP) and implement OCSP client. For most tasks you will find our TElX509CertificateValidator component perfectly suitable. It checks certificate paths, CRL and OCSP revocation (and checks

Is this android SSL pinning implementation correct and why is this error showing up in the logcat?

你离开我真会死。 提交于 2019-11-29 03:19:09
问题 I am getting this error in my logcat. I have implemented ssl pinning in my android application. I think I have done something wrong which is causing this error. 05-19 17:39:54.998: E/NativeCrypto(30908): ssl=0x5eefaf80 cert_verify_callback x509_store_ctx=0x5dbea940 arg=0x0 05-19 17:39:54.998: E/NativeCrypto(30908): ssl=0x5eefaf80 cert_verify_callback calling verifyCertificateChain authMethod=ECDHE_RSA Following is my ssl pinning android code. Which works but throws the above mentioned error.