x509certificate

X509Certificate2 makes IIS crash

坚强是说给别人听的谎言 提交于 2019-11-27 17:14:07
问题 When newing up an instance of X509Certificate2(string, string) my IIS process simply crashes. No .Net exception, no nothing, except of this in my event log Faulting application name: w3wp.exe, version: 8.0.9200.16384, time stamp: 0x50108835 Faulting module name: ntdll.dll, version: 6.2.9200.16420, time stamp: 0x505ab405 Exception code: 0xc0000374 Fault offset: 0x00000000000ea485 Faulting process id: 0x102c Faulting application start time: 0x01ce10301e250c4d Faulting application path: c:

What is the right way to send a client certificate with every request made by the resttemplate in spring?

佐手、 提交于 2019-11-27 16:40:09
问题 i want to consume a REST service with my spring application. To access that service i have a client certificate (self signed and in .jks format) for authorization. What is the proper way to authenticate against the rest service? This is my request: public List<Info> getInfo() throws RestClientException, URISyntaxException { HttpEntity<?> httpEntity = new HttpEntity<>(null, new HttpHeaders()); ResponseEntity<Info[]> resp = restOperations.exchange( new URI(BASE_URL + "/Info"), HttpMethod.GET,

Generate Subject Hash of X509Certificate in Java

一曲冷凌霜 提交于 2019-11-27 15:23:20
I'm currently trying to generate the subject hash by using the Java Security API and BouncyCastle. Here's what I do, when I use the Openssl Library: openssl x509 -in /Users/Sn0wfreezeDev/Downloads/Test.pem -hash This generates a short 8 digit hash 1817886a This is my Java code X509Certificate cert = CertManager.getCertificate(number, c); MessageDigest sha1 = MessageDigest.getInstance("SHA1"); System.out.println(" Subject " + cert.getSubjectDN()); System.out.println(" Issuer " + cert.getIssuerDN()); sha1.update(cert.getSubjectDN().getName().getBytes()); String hexString = bytesToHex(sha1.digest

How to get the X509Certificate from a client request

会有一股神秘感。 提交于 2019-11-27 14:41:44
I have a web-service which I secured using certificates. Now, I want to identify the client by looking at the certificate thumbprint. This means that I have a list of thumbprints on my service somewhere that are linked to some user. Actually, my first question (a little off-topic) is: is this a good approach or should I still introduce some username password construction? Second question is: how can I get the certificate that the client used to connect to the web-service so I can read the thumbprint at the service side. I did read a lot about it (like this post: How do I get the

What is the difference between X509Certificate2 and X509Certificate in .NET?

佐手、 提交于 2019-11-27 14:28:06
问题 What is the difference between the two? 回答1: The x509Certificate was introduced in .NET v1.0/1.1 and was (comparatively) limited in its functionality. It can be used to get information about an existing certificate (valid dates, issuer, etc.). It had simple methods/operations (i.e. reading a cert from disk). The x509Certificate2 is a subclass of x509Certificate with additional functionality. It represents an actual X509 certificate. It was new in the .NET Framework v2.0. This class gives you

Debugging failing HTTPS WebRequest

柔情痞子 提交于 2019-11-27 14:07:01
I'm writing a small program which will make a GET request to a server using HTTPS and the HttpWebRequest class. The server (obviously) has a server certificate. It also expects the client to provide a certificate. When making the request, however, I get a System.Net.WebException stating that it wasn't possible to establish a secure TLS/SSL connection. I quickly discovered that the server's certificate wasn't valid. Assuming this was what was causing the exception, I tried to accept the invalid certificate (updating the certificate is, unfortunately, not an option) using the code below:

PKCS12 Java Keystore from CA and User certificate in java

六月ゝ 毕业季﹏ 提交于 2019-11-27 14:05:08
I've recently been put in charge of mocking up an Apple product (iPhone Configuration Utility) in Java. One of the sections I've been a bit stuck on is a part about Exchange ActiveSync. In there, it allows you to select a certificate from your Keychain to use as credentials for your EAS account. After some research, I found that it's actually creating a PKCS12 keystore, inserting the private key of the certificate I selected, and encoding that into XML. So far not a big deal. If I create a .p12 file with Keychain Access it uploads without a problem. But I run into a problem when I try to bring

X509Certificate.CreateFromCertFile - the specified network password is not correct

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 13:37:30
问题 I have a .NET application that I want to use as a client to call an SSL SOAP web service. I have been supplied with a valid client certificate called foo.pfx . There is a password on the certificate itself. I've located the certificate at the following location: C:\certs\foo.pfx To call the web service, I need to attach the client certificate. Here's the code: public X509Certificate GetCertificateFromDisk(){ try{ string certPath = ConfigurationManager.AppSettings["MyCertPath"].ToString(); /

Signing SOAP messages using X.509 certificate from WCF service to Java webservice

て烟熏妆下的殇ゞ 提交于 2019-11-27 13:22:48
It's my first question over the web. Hope it will make sense. I have seen several blogs related to this issue over the Web, and I have tried few of the ideas presented in them with no success. Here's my situation: I have a web App calling a WCF web service which then call a Java web service. They are all on different servers. The call between the WCF web service to the java web service is not over https as the certificate will be enough to identify the caller (Message security therefore). Java web service (black box) The Java web service requires to received a signed message and works as per

How to make WCF Client conform to specific WS-Security - sign UsernameToken and SecurityTokenReference

可紊 提交于 2019-11-27 12:54:56
问题 I need to create a wcf client to call a service that I have no control over. I have been given a wsdl and a working soapui project. The service uses both a username/password and a x509 certificate. UPDATE I now understand what the problem is, but am still unsure what steps I need to take to be able to create the required message, so any help would be much appreciated. I need to sign both the UsernameToken and the SecurityTokenReference. The code I had to create the custom binding has been