x509certificate

Consume Web Service HTTPS (with certificate for authentication)

拥有回忆 提交于 2019-12-06 09:29:39
I am trying to consume a Web Service HTTPS (using a certificate authentication). I have added my Web Service in my Web Reference on my project and "myCertificate.cer" has imported to Console Root\Certificates\Personal. I have an error 401: The request failed with HTTP status 401: Unauthorized. Any idea? .... using System.Security.Cryptography.X509Certificates; ... string certPath = @"C:\myCertificate.cer"; // Load the certificate into an X509Certificate object. X509Certificate cert = X509Certificate.CreateFromCertFile(certPath); // Create an instance of the Web service proxy. zgetuser

How to P/Invoke CryptUIWizExport Function using .NET

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 09:24:12
Can anyone translate these two cryptui.dll functions/structures into C#.NET [dllimport] wrappers? I would like to P/Invoke the CryptUIWizExport function to display the Windows Certificate Export Wizard. In particular, I need to pass a .NET X509Certificate as a parameter into the CryptUIWizExport function. You help is much appreciated!!! CryptUIWizExport function BOOL WINAPI CryptUIWizExport( __in DWORD dwFlags, __in HWND hwndParent, __in LPCWSTR pwszWizardTitle, __in PCCRYPTUI_WIZ_EXPORT_INFO pExportInfo, __in void *pvoid ); typedef struct _CRYPTUI_WIZ_EXPORT_INFO { DWORD dwSize; LPCWSTR

Error: KeyUsage does not allow digital signatures - Java-applet + mutual SSL

我只是一个虾纸丫 提交于 2019-12-06 07:41:39
We have developed a webbased Java application running in Tomcat under IIS on Windows 2008. The website has 2-way (mutual) SSL enabled in IIS requiring the client to authenticate using a x.509 certificate (PKI) as part of SSL and this works fine with all our certificates using IE. The website also has a java-applet called ViewOne ImageViewer. This works fine with 2-way SSL with some of our certificates but with others we get the exception on the client (java 1.6) during SSL-handshake after the user has selected its authentication certificate: security: KeyUsage does not allow digital signatures

Create a RSAParamaters Object from public+private key

空扰寡人 提交于 2019-12-06 07:23:01
I need to create a RSAParameters object in .Net using a private and public key (.key and .cer file). Is it possible to do this in .Net without the use of third party software? If so, where should I be looking. I ultimately need to extract the Exponent, Modulus, D, P, Q, DP, DQ, InverseQ from this object in order to create a keyblob for a cryptoServer. Thanks! ".key" and ".cer" file extensions are in no way an unambiguous specification of how the keys are encoded. However, it is plausible that the ".cer" file is an X.509 certificate, which contains (among many other things) the public key;

How to use X509_verify()

江枫思渺然 提交于 2019-12-06 05:44:26
问题 How can we use X509_verify(). I have two certificates. The first certificate is the Root Certificate which signed the next certificate (which is my Certificate). So I want to check if my certificate is signed by the root certificate using x509_verify() in C++. My goal is to keep the code simple and Understandable so I can also put it online. 回答1: Signature of X509_verify is int X509_verify(X509 * x509, EVP_PKEY * pkey); Suppose of you have root certificate in root and your certificate in

x509certificate certpath validation

匆匆过客 提交于 2019-12-06 05:30:46
Our use-case requires validating certificate revocation via OCSP on a PKIX set-up. My starting point was the code at this related question: OCSP Revocation on client certificate I'm doing it manually at the application level since tomcat doesn't support it. However, I'm having some trouble building the certPath and I think I'm missing some fundamental understanding. First I try to create the certPath for the incoming client x509Certificate. KeyStore store is initialized correctly and contains only the root certificates that match the client x509Certificate. EDIT: I got the same result after

X509 SSL: No name matching <hostname> found

谁说我不能喝 提交于 2019-12-06 05:27:18
问题 I am trying to configure Kafka with SSL using openssl and keytool command. I configured the certificates to accept a specific CN and some alternative names; here is what I did: openssl req -x509 -nodes -newkey rsa:2048 -days 3650 -sha256 -keyout ca-key -out ca-cert -reqexts SAN -extensions SAN -subj '/CN=kafkabroker' -config <(cat /etc/ssl/openssl.cnf; printf "[SAN]\nsubjectAltName=DNS:kafkabroker,DNS:kafka-broker,DNS:localhost,DNS:host.docker.internal,IP:127.0.0.1,IP:1.1.1.1, IP:2.2.2.2")

Parsing X509 certificate

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-06 05:23:16
问题 I want to parse a X.509 certificate in php. The certificate is in DER-encoded X.509 format. I tried using openssl_x509_parse method in php, but its not working. The certificate data is a valid data received after firing a command in mdm for CertificateList. I am using the below code: $data = 'MIIDizCCAnMCCQDCpCAUbA2P4TANBgkqhkiG9w0BAQUFADBrMSIw IAYDVQQKDBkqLnNtYXJ0c291cmNpbmdnbG9iYWwubmV0MSEwHwYD VQQLDBhEb21haW4gQ29udHJvbCBWYWxpZGF0ZWQxIjAgBgNVBAMM

Why IE rejects a self-signed localhost certificate for 127.0.0.1 only, when Chrome accepts it?

不打扰是莪最后的温柔 提交于 2019-12-06 03:49:56
问题 Our Java 7 application needs to listen for HTTPS requests on localhost. It must accept connections on https://localhost:8112 and https://127.0.0.1:8112 . To do so we have programmatically built an auto-signed X509v3 certificate, and we have installed this certificate in the Windows-ROOT keystore, as follows: KeyStore.TrustedCertificateEntry trustedCert = ...; KeyStore ks = KeyStore.getInstance("Windows-ROOT"); ks.load(null, null); ks.setEntry("xxxx_localhost", trustedCert, null); This makes

how to generate digital signature with x509 certificate?

不羁的心 提交于 2019-12-06 03:45:30
问题 How do we get and append x509data and x509certificate tag to the xml produced by the following code String providerName = System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI"); XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM", (Provider) Class.forName(providerName).newInstance()); Reference ref = fac.newReference("", fac.newDigestMethod(DigestMethod.SHA1, null), Collections.singletonList( fac.newTransform(Transform.ENVELOPED,(XMLStructure) null)), null