pem

How can I decode a SSL certificate using python?

心不动则不痛 提交于 2019-12-17 10:37:12
问题 How can I decode a pem-encoded (base64) certificate with Python? For example this here from github.com: -----BEGIN CERTIFICATE----- MIIHKjCCBhKgAwIBAgIQDnd2il0H8OV5WcoqnVCCtTANBgkqhkiG9w0BAQUFADBp MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSgwJgYDVQQDEx9EaWdpQ2VydCBIaWdoIEFzc3VyYW5j ZSBFViBDQS0xMB4XDTExMDUyNzAwMDAwMFoXDTEzMDcyOTEyMDAwMFowgcoxHTAb BgNVBA8MFFByaXZhdGUgT3JnYW5pemF0aW9uMRMwEQYLKwYBBAGCNzwCAQMTAlVT

How can I get SecKeyRef from DER/PEM file

谁都会走 提交于 2019-12-17 10:17:38
问题 I need to integrate my iPhone app with a system, and they require to encrypt data by a given public key, there are 3 files in 3 different format .xml .der and .pem, I have researched and found some articles about getting SecKeyRef from DER/PEM, but they are always return nil. Below is my code: NSString *pkFilePath = [[NSBundle mainBundle] pathForResource:@"PKFile" ofType:@"der"]; NSData *pkData = [NSData dataWithContentsOfFile:pkFilePath]; SecCertificateRef cert; cert =

Differences between “BEGIN RSA PRIVATE KEY” and “BEGIN PRIVATE KEY”

狂风中的少年 提交于 2019-12-17 02:42:08
问题 Hi I was writing a program that imports private keys from a .pem file and create a private key object to use it later.. the problem I have faced is that some pem files header begin with -----BEGIN PRIVATE KEY----- while others begin with -----BEGIN RSA PRIVATE KEY----- through my search I knew that the first ones are PKCS#8 formatted but I couldn't know what format does the other one belongs to. 回答1: See https://polarssl.org/kb/cryptography/asn1-key-structures-in-der-and-pem (search the page

java 配置文件 加密算法

风流意气都作罢 提交于 2019-12-14 09:34:49
PropUtils.getProperty("jdbc.username"); public class PropUtils { // 本地环境-研发六楼环境 private static final String devMode = "development"; // 正式环境 // private static final String devMode = "production"; // 测试环境 //private static final String devMode = "test"; private static final byte[] KEY = {9, -1, 0, 5, 39, 8, 6, 19}; private static Properties prop = new Properties(); static { try { Properties redis = new Properties(); Properties kafka = new Properties(); Properties jdbc = new Properties(); redis.load(PropUtils.class.getClassLoader().getResourceAsStream("profile/" + devMode + "/redis.properties"));

Secure exchanges using only socket-io and web client (socket io js)

耗尽温柔 提交于 2019-12-13 18:37:49
问题 I created a SSL certificate with openssl on a debian 8 VM. So i have a single PEM file which contain my key and my certificate. I would like to know if it's possible to use a SSL certificate without https, express etc, simply by using a architecture with socket IO (server side) and socket IO client (client side). Server side : var fs = require("fs") , options = { key : fs.readFileSync('./test/apache.pem'), cert : fs.readFileSync('./test/apache.pem') } var io = require('socket.io').listen

How to load RSA public key from String for signature verification in Java?

别说谁变了你拦得住时间么 提交于 2019-12-13 14:03:40
问题 I have the following public key, that is stored in the DB (PostgresSQL) as text. It's a String, in java: -----BEGIN RSA PUBLIC KEY----- MIICCgKCAgEA1ht0OqZpP7d/05373OE7pB7yCVGNGzkUEuCneyfOzps6iA03NbvI 1ZL0Jpp/N3AW73lGdhaoa3X3JE4GsI/bsToVLQwTKmIOC4yjTvBctmFEoyhhTfxW s1UHZKl4XZ/7THbRlKHhRaTKyfDAbikkMAxNT/qutLAPjnN1qOwjb1oRq52NP6FJ KWTTikz4UeOHroX+Xthn2fJSJDlQ4YMdBbgrZVx5JcHKNuPTKRf5gI8QQKMSA9Q9 QJRE5OGp7b6dG14ZmOUnUxb00Mp20LgcaGPcuWU+oFsbQaF6W4G4bdkSZRJJXhSg d4Q7mahpar94

Source of PEM files for web service access

故事扮演 提交于 2019-12-13 04:33:37
问题 I should have paid more attention to my classes that covered security. I'm quite confused about something. To start, here's the background of what I'm trying to accomplish. I have a web service that I need to access. The web service is set up as HTTPS. The traffic between client and server is encrypted (this doesn't have to do with authentication). I'm interacting with the web service via cURL and PHP. I've gotten an example to work locally over HTTP and I'm fairly confident I'm on the right

AWS IoT private.pem.key doesn't exist

左心房为你撑大大i 提交于 2019-12-13 03:33:31
问题 When I am trying to run the following node.js example from AWS IoT I get this error(following this tutorial): pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ node device-example.js -g private.pem.key doesn't exist (--help for usage) However I have the private.pem.key in ~/certs folder as requested by the tutorial. pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ vi device-example.js pi@raspberrypi:~/aws-iot-device-sdk-js/examples $ ls ~/certs/private.pem.key /home/pi/certs/private.pem.key

How to create a .pem file with aes key

会有一股神秘感。 提交于 2019-12-13 01:43:17
问题 i have to create an aes-256 key and store it in a .pem file. I am using RAND_bytes() to simply create a 256 bit random key. After this how can i save this to a pem file. I have looked at Reading and writing rsa keys to a pem file in C and openssl pem. But i am not working with RSA keys. I suspect my task is much simpler like create pem from base64 but not much help. PS: This key will be used to encrypt a self signed digital certificate. EDIT: looking around more i found that i could use bio

How to create private key from file in Objective C?

牧云@^-^@ 提交于 2019-12-12 11:20:29
问题 I have created a public key like this: NSString *pkFilePath = [[NSBundle mainBundle] pathForResource:@"public_key" ofType:@"der"]; NSData *myCertData = [NSData dataWithContentsOfFile:pkFilePath]; SecCertificateRef cert = SecCertificateCreateWithData (kCFAllocatorDefault, (CFDataRef)myCertData); CFArrayRef certs = CFArrayCreate(kCFAllocatorDefault, (const void **) &cert, 1, NULL); SecTrustRef trust; SecPolicyRef myPolicy = SecPolicyCreateBasicX509(); SecTrustCreateWithCertificates(certs,