x509certificate

Signing certificate request with certificate authority

一笑奈何 提交于 2019-12-05 05:05:28
I want to use TLS mutual authentication to authenticate a client on a API made in go. I've created a certificate authority, and let's say Bob has a key pair he wants to use with the client. Bob created a certificate request and want me to validate his certificate in order to be authorized and authenticated on the API. I've used this to create my Certificate Authority : openssl genrsa -aes256 -out ca.key 4096 openssl req -new -x509 -sha256 -days 730 -key ca.key -out ca.crt Bob used this to create his certificate and certificate request : openssl genrsa -out bob.key 4096 openssl req -new -key

Prevent file creation when X509Certificate2 is created?

雨燕双飞 提交于 2019-12-05 04:18:50
We create a X509Certificate2 object in our ASP.NET app to make periodic outgoing connections. Every time one of these certificates is created a new file is created in: C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys That folder now has 4 million files that never get cleaned up. I've tried removing the Persist flag new X509Certificate2(certBytes, p12Pwd, X509KeyStorageFlags.MachineKeySet); //no X509KeyStorageFlags.PersistKeySet but that doesn't help -- still get the 2Kb file on every call. I got my hopes up when I saw this answer , but this is a 2008 R2 server, and the temp files are not 0

WindowsCryptographicException: Keyset does not exist

只愿长相守 提交于 2019-12-05 02:53:05
问题 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

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

笑着哭i 提交于 2019-12-05 02:52:54
问题 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

Java: Accessing Webservice with HTTPS and Clientcertificate

血红的双手。 提交于 2019-12-05 02:08:42
问题 I'm trying to consume a webservice via https. Authentication works with a client side CA. After importing the wsdl I've created a keystore: "C:\Program Files\Java\jdk1.7.0_40\bin\keytool.exe" -keystore mykeystore.jks -storepass changeit -importcert -alias webservice -trustcacerts -file cert.crt Then I start the VM with following arguments: -Djavax.net.ssl.trustStore=D:\webservice\mykeystore.jks At first in main method i do the following System.setProperty("javax.net.ssl.trustStore",

How to get the signature algorithm out of a certificate?

心已入冬 提交于 2019-12-05 00:05:58
问题 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? 回答1: Look at this question, you can do it similar, try this: private function GetCertSignatureAlgorithm($certSignatureBinary, $pubKeyResourceId) { if(false === openssl

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

给你一囗甜甜゛ 提交于 2019-12-04 23:10:40
问题 Closed. This question is off-topic. It is not currently accepting answers. 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

Java ftps connection, TrustManager explaination (using filezilla server)

↘锁芯ラ 提交于 2019-12-04 20:55:44
I have written a program (obviously COPIED from the net, and modified it little according to my needs!) for file download/upload using apache ftp api and by creating a local server using Filezilla server. Everything is working FINE . The problem is I didn't get the part where we have to create a trust manager. Code: FTPSClient ftpsClient= null; SSLContext sslContext = SSLContext.getInstance(protocol); TrustManager tm = new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { System.out.println("getAcceptedIssuers------"); return null; } @Override public void checkClientTrusted

Sign data using smart card's private key with ASP.NET, Windows Authentication, and Impersonation

风格不统一 提交于 2019-12-04 19:19:32
I want to know if it is possible to sign data using a smart card's private key without resorting to a java applet or activex control. I am tantalizingly close! Our environment is: AD Domain PKI infrastructure/smart cards (PIV) I knocked up a simple ASP.NET (.net 4.0) web forms app with: Windows Authentication on, Anonymous off Identity Impersonate on With the smart card in the reader I can easily enumerate the certificates on the logged-in user's smart card (StoreLocation.CurrentUser). However, when I try to access the private key (via a CSP), I get an "Access Denied" error. On my local

Preventing Duplication of the x509 Certificate Used on a WCF Client?

半世苍凉 提交于 2019-12-04 19:09:39
I have a WPF and WCF app that requires to install the certificate (.pfx) on the client side to enable WPF calling the WCF service. Now how can I prevent the client to export the certificate from his certificate store (so that he won't be able to grab the .pfx file and install it on another client computer)? Generate Certs for WCF Generate a Certificate Authority Cert makecert -r -pe -n "CN=MyCA" -ss my -sr localMachine MyRootPublicCert.cer -r Create a self signed -pe Mark generated private key as exportable -ss Subjects certificate store names that stores the output certificate -sr Subjects