pki

“Bad key” exception for certificates with exportable private key

╄→尐↘猪︶ㄣ 提交于 2019-12-21 07:15:09
问题 I am trying to encrypt and then decrypt files using asymmetric encryption. I've created a test certificate using makecert and installed it into my personal localmachine store. In future I'll have to install this certificate on several servers, that's why I've created it with "-pe" flag, that is, with exportable private key. The certificates has been successfully created and installed, I see the "You have a private key that corresponds to this certificate" note in mmc. Now I am trying to

RSA and prime-generator algorithms

女生的网名这么多〃 提交于 2019-12-20 09:44:06
问题 OK, my understanding of the mathematical workings of RSA may not be as deep as it should, so feel free to slap me over the head if this is stupid: To generate a private key, we need two random big primes. There is no algorithm that can do that precisely and efficiently, but there are algorithms that can generate big numbers that have a 99.99999...(a bazillion 9s)...999% probability of being prime. My question is: what happens if, by a phenomenal stroke of bad luck, when you were generating

C# .NET - Pinning Certificates Authorities - I am doing it correctly?

旧街凉风 提交于 2019-12-19 10:03:21
问题 My software connects to Dropbox using an HTTPS connection in order to retrieve some sensitive data. I would like to pin the Certificates Authorities in order to prevent a man-in-the-middle attack. So far I have the following code: static bool VerifyServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { try { var currentCaPublicKey = chain.ChainElements.Cast<X509ChainElement>().Last().Certificate.GetPublicKeyString(); var caPublicKeys

git verify trusted tags

两盒软妹~` 提交于 2019-12-19 09:06:01
问题 I would like to include git tag -v command into the deployment process to catch unsigned tags or tags signed by a non-trusted GPG key. The command returns with an exit code of 0 if the tag has a valid signature, but does not care wether the signed key is trusted or not. I don't want to resort to grepping the resulting GPG message manually 回答1: I haven't tried it yet, and the documentation doesn't mention exit codes, but you could try git-verify-tag plumbing command Update Having no easy way

Where is the JRE lib/security directory on Mac OS X?

╄→гoц情女王★ 提交于 2019-12-18 21:11:06
问题 I need to generate a cert and can't find this directory. Thanks! 回答1: I believe the equivalent directory to jre/lib/security under OS X is: /Library/Java/Home/lib/security 回答2: On Mavericks (OS X 10.10) with Oracle Java 8, it appears to be: /Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home/jre/lib/security 回答3: The following works for 10.11.6 /Library/Java/Home/jre/lib/security It's actually just a link to the /Library/Java/JavaVirtualMachines/.../Contents/Home/jre/lib/security

Accessing signing/encryption in a browser's Keystore using JavaScript - sample code? (WebCryptoAPI)

烈酒焚心 提交于 2019-12-18 00:17:12
问题 I have a web server that allows access only using X509 authentication. Works like a charm. Now I want to extend the use of the X509 certificates (which are stored in the user's browser keystore) to Sign data before it is sent to the server (using JavaScript and HTTPPost) Decrypt data read from the server (where it gets encrypted using the user's public key stored there) I found this example doing RSA Signature which is pretty close.... only it does take the key from a HTML textarea. I want to

PKCS#1 and PKCS#8 format for RSA private key [closed]

女生的网名这么多〃 提交于 2019-12-17 07:23:28
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 12 months ago . Can some one help me understand how an RSA key literally is stored in these formats? I would like to know the difference between the PKCS formats vs Encodings(DER, PEM). From what I understand PEM is more human readable. Is PEM/DER for keys/certs similar to UTF-8/16 for

Mutual SSL - getting the key/truststores in the proper formats

混江龙づ霸主 提交于 2019-12-13 07:02:04
问题 I generated a CSR using OpenSSL: openssl req -out MyCompanyCsr.csr -new -newkey rsa:2048 -nodes -keyout MyCompanyPrivateKey.key So starting out, we have: - MyCompanyPrivateKey.key - MyCompanyCsr.csr Then I sent it to our integration partner, who responded with 3 files: - PartnerIntermediateCa.crt - PartnerRootCa.crt - MyCompanyCsr.crt Now I need to connect to their web service using mutual SSL. To do this, I know I need to set the truststore and keystore in my SSLSocketFactory for JAXB. I'm

Checking the signature of a CSR (X.509 certificate signing request)

淺唱寂寞╮ 提交于 2019-12-13 06:36:14
问题 Can someone please help me with the following question I want to check the signature on a CSR (X509 certificate signing request) is valid I believe I know how to do this (as follows) but not certain if my understanding is correct and would be very grateful if someone could check/correct/confirm my method. I am using PowerShell (but understand the basic concepts of C’# too) I have a text file on my hard drive which is basically a base64 encoded CSR called csr.txt So in PowerShell I do the

What format is java's cacerts format expected to be?

微笑、不失礼 提交于 2019-12-12 10:47:38
问题 I'm slightly confused about cacerts formats. An application I use recently had to upgrade it's cacerts file. The original cacerts file was pk12 format (I assume, it's binary), while the new format is clearly pem. I can use either cacert, but when I suggested someone having trouble with authentication upgrade to the new cacert he gets complaints because it is not a pk12 format. What file format should cacert's be? can it be either format? Does something configure/define which format it should