x509certificate

org.apache.http.client.ClientProtocolException

落花浮王杯 提交于 2019-11-30 07:02:18
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= (Button) findViewById(R.id.button1); b.setOnClickListener(new OnClickListener() { @Override public

Java X509 Certificate parsing and validating

南楼画角 提交于 2019-11-30 06:23:34
问题 I'm trying to process X509 certificates in several steps and running into a couple of problems. I'm new to JCE so I not completely up to date on everything yet. We want to be able to parse several different X509 certificates based on different encodings (PEM, DER and PCKS7). I've exported the same certificate from https://belgium.be in PEM and PCKS7 format using FireFox (certificate including chain). I've left couple lines out that are not needed for the questions public List<X509Certificate>

MDM Server certificate to be used for SSL handshake with iPhone device

帅比萌擦擦* 提交于 2019-11-30 05:32:00
I am trying to perform SSL Handshake between the iPhone device and my MDM Server. I have used iPhone configuration Utility (iPCU) and configured SCEP and MDM. SCEP works fine, the device receives the issued certificate from the CA. In the MDM Payload, I have used the subject of the APNS certificate in the topic and entered the server IP with port 1234. As an identity, I have used the identity of the SCEP Certificate. The iPhone generates the key and enrolls successfully, but then when it tries to install the profile by contacting the MDM server, I receive this error in the IPCU console: The

How to check if X509Certificate is CA certificate?

♀尐吖头ヾ 提交于 2019-11-30 04:58:23
I have a X509Certificate instance in Java and I need to identify if it is a CA certificate or user certificate. Can anyone provide any help? Thanks in advance! Jurica Krizanic According to research I have performed, it can be checked by checking basic constraints! Check the API for returning results of getBasicConstraints() method. So if the method returns result != -1 , a certificate can be considered as a CA certificate . I have checked this with several CA certificates (root and intermediate), and it works as described. I have also checked this method with several user certificates, and the

How to RestSharp add client certificate in Https request? (C#)

微笑、不失礼 提交于 2019-11-30 04:12:45
How to RestSharp add client certificate in Https request ? My code it doesn't work . public static IRestResponse<User> AsyncHttpRequestLogIn(string path, string method, object obj) { var client = new RestClient(Constants.BASE_URL + path); // https:.... var request = method.Equals("POST") ? new RestRequest(Method.POST) : new RestRequest(Method.GET); request.RequestFormat = RestSharp.DataFormat.Json; // The path to the certificate. string certificate = "cer/cert.cer"; client.ClientCertificates.Add(new X509Certificate(certificate)); request.AddBody( obj ); IRestResponse<User> response = client

How to create and install X.509 self signed certificates in Windows 10 without user interaction?

ⅰ亾dé卋堺 提交于 2019-11-30 03:48:28
问题 The problem Create and install temporary certificates to sign code in my development environment. This has to be done with an unattended script (without user interaction). The legacy script Right now, I have this script that creates the certificates using the deprecated tool makecert: makecert -r -pe -n "CN=My CA" -ss CA -sr CurrentUser -a sha256 -cy authority -sky signature -sv MyCA.pvk MyCA.cer certutil -user -addstore Root MyCA.cer certutil -addstore Root MyCA.cer makecert -pe -n "CN=My

How to check if a X509 certificate has “Extended Validation” switched on?

混江龙づ霸主 提交于 2019-11-30 03:38:41
I'm struggling to find a reliable way to check from my C# (.Net 4.0) application if an X509Certificate (or X509Certificate2) has the "Extended Validation" (EV) flag set. Does anyone know the best method? Dennis Alexander You could check if the X509Certificate contains one of these OId s. Additionally you can check Chromium's Source for a list of implemented OIds. You can find the Source here . If you'd like to stick to Firefox, you can grab the implementation here . I now updated my source and tested it. I've written a small method to validate a X509Certificate2 against the OId-List from

C# SSL server mode must use a certificate with the corresponding private key

社会主义新天地 提交于 2019-11-30 03:34:57
问题 I'm going to learn how to handle HTTPS traffic in C# as server-side and as for the first steps I've got some troubles. Here is some code ( http://pastebin.com/C4ZYrS8Q ): class Program { static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (sslPolicyErrors == SslPolicyErrors.None) return true; Console.WriteLine("Certificate error: {0}", sslPolicyErrors); return false; } static void Main() { var tcpListener =

winhttpcertcfg giving access to IIS user in Windows 7

情到浓时终转凉″ 提交于 2019-11-29 23:16:14
I need to give access to the IIS user to a pfx certificate. The website is running under the App Pool under some user AppPoolUser. IIS automatically has the user name "IIS APPPOOL\AppPoolUser" and this is what we need to give access when we use aspnet_regiis -ga . However, when i use winhttpcertcfg to give access to the user "IIS APPPOOL\AppPoolUser", it says "No account information was found". The command I use is winhttpcertcfg -i <filename> -c <certificateLocation> - g -a <account name> Didn't find any samples for this over the web. Any ideas? dstj I know it's an old question, but I just

winhttpcertcfg giving access to IIS user in Windows 7

梦想与她 提交于 2019-11-29 23:14:20
I need to give access to the IIS user to a pfx certificate. The website is running under the App Pool under some user AppPoolUser. IIS automatically has the user name "IIS APPPOOL\AppPoolUser" and this is what we need to give access when we use aspnet_regiis -ga . However, when i use winhttpcertcfg to give access to the user "IIS APPPOOL\AppPoolUser", it says "No account information was found". The command I use is winhttpcertcfg -i <filename> -c <certificateLocation> - g -a <account name> Didn't find any samples for this over the web. Any ideas? dstj I know it's an old question, but I just