private-key

CngKey.Import on azure

陌路散爱 提交于 2021-02-18 21:07:18
问题 var rawData = Convert.FromBase64String(_signingKey); var cng = CngKey.Import(rawData, CngKeyBlobFormat.Pkcs8PrivateBlob); I use this code to extract key, from embedded base64 string. It works fine when I test it locally but when I publish on azure I get following exception: WindowsCryptographicException: The system cannot find the file specified (once again I'm not reading from any file) I need this to communicate with apple apns for push notifications, is there any workaround? And this

CngKey.Import on azure

强颜欢笑 提交于 2021-02-18 21:02:03
问题 var rawData = Convert.FromBase64String(_signingKey); var cng = CngKey.Import(rawData, CngKeyBlobFormat.Pkcs8PrivateBlob); I use this code to extract key, from embedded base64 string. It works fine when I test it locally but when I publish on azure I get following exception: WindowsCryptographicException: The system cannot find the file specified (once again I'm not reading from any file) I need this to communicate with apple apns for push notifications, is there any workaround? And this

How can I add a private key to a certificate in the windows trust store in c++?

不打扰是莪最后的温柔 提交于 2021-02-11 12:53:29
问题 I have a file with a certificate in it, and I have a file with a private key file in it. if I run this command certutil –MergePFX certfile.cer certfile.pfx I get a pfx file that if I run with explorer, it runs the windows certificate import wizard. If I run through the wizard, I end up with the cert with the key in the windows trust store. Exactly what I need. I'm trying to do this programatically. The problem seems to be in the CertAddCertificateContextToStore function. In the remarks it

certificate signing request: Does it contain public key or private key?

守給你的承諾、 提交于 2021-02-11 12:29:34
问题 I am trying to demystify how CSR is generated, and role of the public and private key. Server1: Generate a public and private key Now, I want CSR and for that, I will go to a CA for signing. For creating a CSR request, is it based on server's public key or private key? I referred to this SO question; in there, it says the server (which is requesting for CSR) itself signs CSR by its private key, before sending it to CA. I am bit confused, have the following questions: The end product (the

SSL on Apache HTTP Server

醉酒当歌 提交于 2021-02-05 11:30:41
问题 I have 2 crt files for Apache server: 1_root_bundle.crt 2_my_domain_name.com.crt And other bundle: 1_Intermediate.crt 2_my_domain_name.com.crt root.crt I have modified /etc/apache2/sites-available/default-ssl.conf And tried various combinations of above mentioned files but after Apache2 service restart SSL does not work, browser shows "Connection is not secure": SSLEngine on SSLCertificateFile /etc/apache2/ssl/1_Intermediate.crt SSLCertificateKeyFile /etc/apache2/ssl/2_my_domain_name.com.crt

SSL on Apache HTTP Server

半城伤御伤魂 提交于 2021-02-05 11:29:53
问题 I have 2 crt files for Apache server: 1_root_bundle.crt 2_my_domain_name.com.crt And other bundle: 1_Intermediate.crt 2_my_domain_name.com.crt root.crt I have modified /etc/apache2/sites-available/default-ssl.conf And tried various combinations of above mentioned files but after Apache2 service restart SSL does not work, browser shows "Connection is not secure": SSLEngine on SSLCertificateFile /etc/apache2/ssl/1_Intermediate.crt SSLCertificateKeyFile /etc/apache2/ssl/2_my_domain_name.com.crt

How to get private key as Byte[] of a password protected pfx fetched from azure key vault

旧时模样 提交于 2021-02-05 09:33:11
问题 I am fetching my certificate from Azure Key Vault using GetSecretAsync() method and then I am expecting to get the byte[] of the private key and the certificate eventually. I have my application in .netcore3.1 This is how my code looks like : var certWithPrivateKey = Client.GetSecretAsync(ConfigurationSettings.AppSettings["AKVEndpoint"], ConfigurationSettings.AppSettings["CertName"]).GetAwaiter().GetResult(); var privateKeyBytes = Convert.FromBase64String(certWithPrivateKey.Value);

InvalidKeyException: invalid key format when reading EC Private Key from PEM file in Java

左心房为你撑大大i 提交于 2021-01-28 16:46:22
问题 I'm trying to create a private key object from a given .pem file. The file has this structure: -----BEGIN EC PRIVATE KEY----- ............................... ............................... ............................... -----END EC PRIVATE KEY----- I am attempting to create the private key object with this code: public static String getKeyFromFile(String filename) throws IOException { File f = new File(filename); FileInputStream fis = new FileInputStream(f); DataInputStream dis = new

InvalidKeyException: invalid key format when reading EC Private Key from PEM file in Java

十年热恋 提交于 2021-01-28 16:45:28
问题 I'm trying to create a private key object from a given .pem file. The file has this structure: -----BEGIN EC PRIVATE KEY----- ............................... ............................... ............................... -----END EC PRIVATE KEY----- I am attempting to create the private key object with this code: public static String getKeyFromFile(String filename) throws IOException { File f = new File(filename); FileInputStream fis = new FileInputStream(f); DataInputStream dis = new

Storing IV when using AES asymmetric encryption and decryption

有些话、适合烂在心里 提交于 2021-01-28 00:50:59
问题 I'm looking at an C# AES asymmetric encryption and decryption example here and not sure if i should store the IV in a safe place (also encrypted??). Or i can just attach it to the encrypted text for using later when i with to decrypt. From a short reading about AES it seems it's not needed at all for decryption but i'm not sure i got it right and also the aes.CreateDecryptor(keyBytes, iv) need it as parameter. I use a single key for all encryptions. 回答1: It's fairly standard to transmit the