pem

Openssl convert .PEM containing only RSA Private Key to .PKCS12

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 23:21:53
Currently I have a .PEM file containing only a private key. I need to convert this file into a .PKCS12 file. Currently I'm trying to use openssl to achieve this and I'm running into some problems. The .PEM file I'm using is of the form: -----BEGIN RSA PRIVATE KEY----- Some key -----END RSA PRIVATE KEY----- I use the following Openssl command to attempt to convert this .PEM file into a .PKCS12: openssl pkcs12 -export -inkey file.pem -out file.p12 The console then hangs with the message: Loading 'screen' into random state -done What am Im doing wrong? Any help would be appriciated. beaudet I ran

How do I convert an XML RSA key to a PEM file?

岁酱吖の 提交于 2019-11-28 21:41:01
I have two XML files, structured as follows: My Key <RSAKeyValue> <Modulus> ... </Modulus> <Exponent> ... </Exponent> <P> ... </P> <Q> ... </Q> <DP> ... </DP> <DQ> ... </DQ> <InverseQ> ... </InverseQ> <D> ... </D> </RSAKeyValue> A Public Key <RSAKeyValue> <Modulus> ... </Modulus> <Exponent> ... </Exponent> </RSAKeyValue> I am using the xmlseclibs library by Robert Richards which requires a .PEM representation of the key in order to encrypt and decrypt things. As an encryption novice, I'm not sure where to begin, and a cursory Google search did not reveal anything particularly obvious... Thanks

Message digest of pdf in digital signature

泄露秘密 提交于 2019-11-28 11:44:37
I want to manually verify the integrity of a signed pdf. I have been able to reach at:- got the value of '/Content' node from pdf(using PyPDF2 ). This is a der encoded PKCS#7 certificate. Now as per pdf specifications , the message digest of the pdf data is stored along with the certificate in /Content node. Tried a lot but I am not able to get the digest value which I would eventually compare with hashed pdf content(specified by /ByteRange ). PDF specification snapshot:- Don't understand the last part that says write signature object data into the dictionary . where does this write actually

convert certificate from pem into jks

99封情书 提交于 2019-11-28 10:03:37
I have to convert a certificate in pem format into an java key store. To use this one with tomcat at a windows server I've got those files: cert_request.csr -----BEGIN CERTIFICATE REQUEST----- ... -----END CERTIFICATE REQUEST----- cert_public_key.pem -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- cert_private_key.pem -----BEGIN ENCRYPTED PRIVATE KEY----- ... -----END ENCRYPTED PRIVATE KEY----- cert.txt contains an 16 digit key I tryed to combine the pem files (by combining the two files were chain together) and converted this with openssl into an .der file and import that with

SignedJwtAssertionCredentials on AppEngine doesn't recognize PEM key

笑着哭i 提交于 2019-11-28 06:04:32
SignedJwtAssertionCredentials on appengine (with pycrypto 2.6) doesn't support the PKCS12 format, therefore I'm trying to use PEM keys instead, as suggested everywhere.. this is my code: f = file(os.path.join(os.path.dirname(__file__), KEY_FILE), "r") key = f.read() f.close() credentials = SignedJwtAssertionCredentials(SERVICE_ACCOUNT_EMAIL, key, scope="https://www.googleapis.com/auth/drive" http = httplib2.Http() http = credentials.authorize(http) and the KEY_FILE is a PEM key, converted with the command: openssl pkcs12 -in privatekey.p12 -nodes -nocerts > privatekey.pem but I still get this

Read an encrypted private key with bouncycastle/spongycastle

我的未来我决定 提交于 2019-11-28 05:19:29
问题 I have a password protected, encrypted RSA private key, which was created with PyCrypto (2.6.1) and has according to their docs the following format: PrivateKeyInfo, PKCS#8 (DER SEQUENCE), PEM (RFC1423) , see [https://www.dlitz.net/software/pycrypto/api/current/Crypto.PublicKey.RSA._RSAobj-class.html#exportKey]. How can I decrypt this RSA key with Bouncycastle/Spongycastle? I've searched Google for quite a long time and only came up with results, that either won't work with version 1.50

Write x509 certificate into PEM formatted string in java?

给你一囗甜甜゛ 提交于 2019-11-28 03:48:23
Is there some high level way to write an X509Certificate into a PEM formatted string? Currently I'm doing x509cert.encode() to write it into a DER formatted string, then base 64 encoding it and appending the header and footer to create a PEM string, but it seems bad. Especially since I have to throw in line breaks too. ZZ Coder This is not bad. Java doesn't provide any functions to write PEM files. What you are doing is the correct way. Even KeyTool does the same thing, BASE64Encoder encoder = new BASE64Encoder(); out.println(X509Factory.BEGIN_CERT); encoder.encodeBuffer(cert.getEncoded(), out

How to use PEM file to create a SSL socket in Java?

感情迁移 提交于 2019-11-28 02:56:45
问题 See related question. I have a PEM file provided to me and was told that it will be needed in establishing a SSL socket that connects to a c++ server for some API calls. Does anyone know how I can read in the PEM file and connect? I was also given the parapharse password. 回答1: It sounds like the PEM file is a client cert for you to use to login to the server. If it is the client cert, and it sounds like it is, you will likely need a ca cert file also to use in validating the servers

scp (secure copy) to ec2 instance without password

元气小坏坏 提交于 2019-11-28 02:31:42
I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), and I can ssh into it using my amazon-created key file without password prompt, no problem. However, when I want to copy a file to the instance using scp I am asked to enter a password: scp somefile.txt -i mykey.pem root@my.ec2.id.amazonaws.com:/ Password: Any ideas why this is happening/how it can be prevented? Hoff I figured it out. I had the arguments in the wrong order. This works: scp -i mykey.pem somefile.txt root@my.ec2.id.amazonaws.com:/ scp -i /path/to/your/.pemkey -r /copy/from/path user@server:/copy/to/path I've used below

Export private/public keys from X509 certificate to PEM

情到浓时终转凉″ 提交于 2019-11-28 01:56:10
is there any convenient way to export private/public keys from .p12 certificate in PEM format using .NET Core ? Without manipulating with bytes at low level? I googled for hours and almost nothing is usable in .net core or it isn't documented anywhere.. Let's have an X509Certificate2 var cert = new X509Certificate2(someBytes, pass); var privateKey = cert.GetRSAPrivateKey(); var publicKey = cert.GetRSAPublicKey(); // assume everything is fine so far And now I need to export the keys as two separate PEM keys. I already tried PemWriter in BouncyCastle but the types are not compatibile with System