pem

Convert SSL .pem to .p12 with or without OpenSSL

蓝咒 提交于 2019-12-02 18:11:16
I get external .pem files that need to be converted to .p12 files - I add a username and password in the process. (I need to do this to utilize a third party API.) Using openssl , the command is... openssl pkcs12 -export -in xxxx.pem -inkey xxxx.pem -out xxx.p12 -passout pas:newpassword -name "newname" I can run this from a terminal session and it works perfectly. However, I will need to do this often and have written a Java class that handles this and more (my application is mostly .jsp with Tomcat and Apache). When I try run the same command from Java using Runtime.exec , I get the dreaded

Convert .p12 file to .pem using Terminal app in Mac “No such file or directory” error?

大城市里の小女人 提交于 2019-12-02 17:18:38
I have export the "Apple Development IOS Push Service" certificate from Keychain Access and save the "apns-dev-cert.p12" in my desktop. I want to enable Apple Push Notification I have followed these blogs to convert apns-dev-cert.p12 to apns-dev-cert.pem from Terminal app, http://bhaveshkumbhani.blogspot.in/2011/12/convert-p12-to-pem-for-apns.html http://www.raywenderlich.com/3443/apple-push-notification-services-tutorial-part-12 Apple Document RemoteNotificationPG.pdf I have used these commands in Terminal, 1.V******-Ms-iMac-2:~ c*****$ openssl pkcs12 -in apns-dev-cert.p12 -out apns-dev-cert

Create a PEM from a PPK file [duplicate]

百般思念 提交于 2019-12-02 16:33:54
This question already has an answer here: How to convert SSH keypairs generated using PuTTYgen (Windows) into key-pairs used by ssh-agent and Keychain (Linux) 8 answers So there are plenty of tutorials on how to convert a PEM to a PPK using puttyGen. However my issue is that my windows machine had the only PEM copy and I converted it into a PPK and deleted it. Now I need to figure out how to convert a PPK into a PEM so that my mac can ssh into the server. I still have access to the server so I could also just make a new key if I had to, anyone know how to convert PPK to PEM? Emizen Tech

fwrite(): SSL operation failed with code 1. OpenSSL Error messages:\nerror:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry IN PHP

試著忘記壹切 提交于 2019-12-02 05:40:31
问题 I have got same questions in stackoverflow and tried all answers but no help. I am not getting what is the error. Here is my function that i am using: function sendRegistryNotification($message, $deviceToken, $deviceType, $batchcount) { $message=$message; $batchcount=$batchcount; $path=ABSPATH.'api'.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'Certificates2.pem'; $deviceType = strtolower($deviceType); switch ($deviceType) { case 'ios': $pemPath = $path; // replace with the path to PEM

How to decrypt using rsa from PEM file

空扰寡人 提交于 2019-12-02 04:17:28
问题 I am using the following c# code to encrypt and decrypt using rsa with PEM files: public string encrypt(string elementToEncrypt, string pathPrivateKey) { string pem = System.IO.File.ReadAllText(pathPrivateKey); byte[] Buffer = getBytesFromPEMFile(pem, "PUBLIC KEY"); System.Security.Cryptography.RSACryptoServiceProvider rsa = new System.Security.Cryptography.RSACryptoServiceProvider(); System.Security.Cryptography.RSAParameters rsaParam = rsa.ExportParameters(false); rsaParam.Modulus = Buffer;

How can I read a BouncyCastle private key PEM file using JCA? [duplicate]

倖福魔咒の 提交于 2019-12-02 03:21:03
问题 This question already has an answer here : convert openSSH rsa key to javax.crypto.Cipher compatible format (1 answer) Closed 3 years ago . In one of our applications private keys are stored using BouncyCastle's PEMWriter. At the moment I am investigating if we can get rid of the BouncyCastle dependency since Java 7 seems to have everything we need. The only issue is that I can not read the private keys stored in the database as PEM-encoded strings (the certificates/public keys are fine). If

fwrite(): SSL operation failed with code 1. OpenSSL Error messages:\\nerror:1409F07F:SSL routines:SSL3_WRITE_PENDING:bad write retry IN PHP

那年仲夏 提交于 2019-12-02 02:48:44
I have got same questions in stackoverflow and tried all answers but no help. I am not getting what is the error. Here is my function that i am using: function sendRegistryNotification($message, $deviceToken, $deviceType, $batchcount) { $message=$message; $batchcount=$batchcount; $path=ABSPATH.'api'.DIRECTORY_SEPARATOR.'includes'.DIRECTORY_SEPARATOR.'Certificates2.pem'; $deviceType = strtolower($deviceType); switch ($deviceType) { case 'ios': $pemPath = $path; // replace with the path to PEM file $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', $pemPath);

How to use CAPI's CryptImportKey with PEM encode public key from OpenSSL?

时光总嘲笑我的痴心妄想 提交于 2019-12-02 00:27:51
问题 How do I get the Microsoft's CryptoAPI CryptImportKey function to import a PEM encoded key? It actually works but CryptDecrypt returns an error. // 1. Generate a Public/Private RSA key pair like so: openssl genrsa -out private.pem 2048 openssl rsa -in private.pem -out public.pem -outform PEM -pubout // 2. Create a digital signaure using OpenSSL // Load Private key // -----BEGIN RSA PRIVATE KEY----- // BLAHBLAHBLAH // -----END RSA PRIVATE KEY----- // Concat user details std::string sUser =

How to verify PEM format certificate in Java

佐手、 提交于 2019-12-01 21:08:47
问题 I have PEM format file, How can verify the signature in Java, as I followed http://download.oracle.com/javase/tutorial/security/apisign/versig.html but found that Java doesnt support PEM 回答1: You can read a certificate in a PEM file using BouncyCastle's PEMReader . If the content is an X.509 certificate, you should get an instance of X509Certificate and verify it as you want from there. EDIT : Here is what the code should look like (not tried): // The key with which you want to verify the

How to verify PEM format certificate in Java

帅比萌擦擦* 提交于 2019-12-01 19:51:13
I have PEM format file, How can verify the signature in Java, as I followed http://download.oracle.com/javase/tutorial/security/apisign/versig.html but found that Java doesnt support PEM You can read a certificate in a PEM file using BouncyCastle 's PEMReader . If the content is an X.509 certificate, you should get an instance of X509Certificate and verify it as you want from there. EDIT : Here is what the code should look like (not tried): // The key with which you want to verify the cert. // This is probably a CA certificate's public key. PublicKey publicKey = ...; PEMReader reader = new