pkcs#12

How to use a service account with Google's python api and drive?

こ雲淡風輕ζ 提交于 2019-12-01 11:21:49
问题 I try to write python 2.7 script to upload a file into my personal google drive folder. After several problems I stuck know. This is my current error: NotImplementedError: PKCS12 format is not supported by the PyCrpto library. Try converting to a "PEM" (openssl pkcs12 -in xxxxx.p12 -nodes -nocerts > privatekey.pem) or using PyOpenSSL if native code is an option. I already tried to run this commands, as mentiod in this question and answer. openssl pkcs12 -in privatekey.p12 -nodes -nocerts >

How to get private key from PKCS#12 (.p12) file using C#

寵の児 提交于 2019-12-01 09:02:41
Im trying to sign some data using PKCS#12 certificate ,however i have problem with obtaining private key from PKCS#12 (.p12) file. public byte[] sign(string text) { string password = "1111"; X509Certificate2 cert = new X509Certificate2("c:\\certificate.p12",password); byte[] certData = cert.Export(X509ContentType.Pfx,password); X509Certificate2 newCert = new X509Certificate2(certData, password); RSACryptoServiceProvider crypt = (RSACryptoServiceProvider)newCert.PrivateKey; SHA1Managed sha1 = new SHA1Managed(); UnicodeEncoding encoding = new UnicodeEncoding(); byte[] data = encoding.GetBytes

How to get private key from PKCS#12 (.p12) file using C#

蹲街弑〆低调 提交于 2019-12-01 06:16:32
问题 Im trying to sign some data using PKCS#12 certificate ,however i have problem with obtaining private key from PKCS#12 (.p12) file. public byte[] sign(string text) { string password = "1111"; X509Certificate2 cert = new X509Certificate2("c:\\certificate.p12",password); byte[] certData = cert.Export(X509ContentType.Pfx,password); X509Certificate2 newCert = new X509Certificate2(certData, password); RSACryptoServiceProvider crypt = (RSACryptoServiceProvider)newCert.PrivateKey; SHA1Managed sha1 =

PFX/PKCS12 to SNK conversion for mono

萝らか妹 提交于 2019-11-30 20:26:35
This is follow up on Mono xbuild error CS1548 - key file has incorrect format Hi, I have an application that is written in C# using VS2008. At present we are porting this app to Mac using Mono. I have tried to extract the key from the pfx file. First I used `sn -pc key.pfx key.snk` this gave me an error of 'Failed to extract public key for key pair -- Keyset does not exist'. I then used `sn -p key.pfx key.snk` this created the snk file that I wanted. I then in mono selected the project Option > Assembly Signing When built the error 'key.snk is missing private key needed for signing'. I think I

programmatically import .cer certificate into keystore

耗尽温柔 提交于 2019-11-30 12:55:36
问题 How can I import a .p12 certificate from the classpath into the java keystore? First I used the InstallCert https://code.google.com/p/java-use-examples/source/browse/trunk/src/com/aw/ad/util/InstallCert.java and did some changes so the server certificate will be imported into the keystore in the java install directory. This works fine but now I want to load a certificate from my classpath. EDIT: I just use a .cer certificate, see next answer 回答1: The answer: InputStream certIn = ClassLoader

This certificate has an invalid issuer keychain

╄→гoц情女王★ 提交于 2019-11-30 09:52:25
I do have private key(my_ca.key) and public key(my_cert.crt) which is signed by DigiCert. Now I want to generate the SSL certificate (version 3) and sign it by my private key . Here is the way I tried to do that. But when I export into keychain (Mac OS X). I have been getting error like this " This certificate has an invalid issuer keychain ". No idea how to solve this. Here my_cert.crt is extended from DigiCert High Assurance CA-3 and that one extended from DigiCert High Assurance EV Root CA. Also added DigiCert High Assurance CA-3, DigiCert High Assurance EV Root CA into keychain. It shows

Error using httlib's HTTPSConnection with PKCS#12 certificate

一笑奈何 提交于 2019-11-30 09:21:05
问题 I'm trying to use httplib's HTTPSConnection for client validation, using a PKCS #12 certificate. I know the certificate is good, as I can connect to the server using it in MSIE and Firefox. Here's my connect function (the certificate includes the private key). I've pared it down to just the basics: def connect(self, cert_file, host, usrname, passwd): self.cert_file = cert_file self.host = host self.conn = httplib.HTTPSConnection(host=self.host, port=self.port, key_file=cert_file, cert_file

How to make a valid p12 file to be correctly imported by SecPKCS12Import

不打扰是莪最后的温柔 提交于 2019-11-30 08:51:38
I've solved my previos problem of converting XML RSA private key to PEM file, but I run into another problem that I get null data when importing P12 private key. Following is my steps: Convert PEM file to P12 file openssl> pkcs12 -export -in rsa.pem -inkey rsa.pem -out rsa.p12 -nocerts Read P12 file to iOS project NSString *path = [[NSBundle bundleForClass:[self class]] pathForResource:@"MyPrivateKey" ofType:@"p12"]; NSData *p12data = [NSData dataWithContentsOfFile:path]; if (![self getPrivateKeyRef]) RSAPrivateKey = getPrivateKeywithRawKey(p12data); Import P12 Private Key SecKeyRef

How to set up Java to use user specific certificates for Eclipse?

旧城冷巷雨未停 提交于 2019-11-30 07:12:23
I can't believe I'm the only person to run up against this problem. I've been googling for hours and have not had any luck. The Java security documentation doesn't seem to address PKCS12 certificates thoroughly. I am trying to setup Java for user specific PKCS12 certificates. Among other things, this will be used so that, in Eclipse, I can access a Trac server that is authenticated via certificates. I am using the Trac Mylyn integration plugin for eclipse. Here is the setup: user home directories are at /home multiuser mount at /central each user has a personal certificate at: ~/user.p12

What causes keytool error “Failed to decrypt safe contents entry”?

寵の児 提交于 2019-11-30 06:02:05
I am trying to convert a standard PKCS #12 (.p12) key store into a Java JKS key store with this command: keytool -importkeystore -srckeystore keystore.p12 -srcstoretype PKCS12 -deststoretype JKS -destkeystore keystore.jks It is failing with: keytool error: java.io.IOException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded Do you have any idea how to solve this problem? Sometimes this error is symptomatic of using an incorrect password for the p12 key. The pkcs12 keystore was corrupt indeed. axiopisty I've never attempted to do