x509

How can I compare public keys in .NET?

情到浓时终转凉″ 提交于 2019-12-04 20:37:07
I've got an X509Certificate2 containing a public key. I've got an RSACryptoServiceProvider (which came from calling SignedXml.CheckSignatureReturningKey ), also containing a public key. I want to find out if one came from the other. How can I compare the two? You can compare the PublicKey property of signing certificates in the SignedXml.KeyIfo with signing key output from SignedXml.CheckSignatureReturningKey . This C# extension method does the job for me: public static bool CheckSignatureReturningCertificate(this SignedXml signedXml, out X509Certificate2 signingCertificate) {

Client program to validate server certificate returned by SSL_get_peer_certificate?

我只是一个虾纸丫 提交于 2019-12-04 19:48:32
I have a SSL/TLS client program using OpenSSL in C++ programming language. I am looking for methods to validate server certificate ( X509 ) returned by SSL_get_peer_certificate function call. Also, I have my own CA certificate loaded using SSL_CTX_load_verify_locations function. The CA certified the server certificate. I am able to make SSL session to my server. Now, i want to validate server certificate received during SSL handshake using my own CA. I couldn't find a way to do it in C or C++. #include <iostream> #include <string.h> #include <unistd.h> #include <sys/socket.h> #include <resolv

How to make X.509 certificate?

无人久伴 提交于 2019-12-04 16:47:50
I am trying to make a X.509 certificate. I am using makecert.exe to make this. I use this command to make my X.509 certificate makecert.exe -sr LocalMachine -ss My -a sha1 -n CN=MyServerCert -sky exchange –pe But i don`t know there X.509 certificate is storeing. I need to use this X.509 certificate in my c# code. The code is : host.Credentials.ServiceCertificate.Certificate = new X509Certificate2("MyServerCert.p12", "password"); But i don`t know what is password and it throw this exception "The system cannot find the file specified." I always use the SelfCert tool from PluralSight. You can

How to calculate X.509 certificate's SHA-1 fingerprint?

和自甴很熟 提交于 2019-12-04 16:21:25
问题 I'm trying to implement an X.509 certificate generator from scratch (I know about the existing ones, but I need yet another one). What I cannot understand is how to calculate the SHA-1 (or any other) fingerprint of the certificate. The RFC5280 says that the input to the signature function is the DER-encoded tbsCertificate field. Unfortunately, the hash that I calculate differs from the one produced by OpenSSL. Here's a step-by-step example. generate a certificate using OpenSSL's x509 tool (in

How do I create and sign certificates with Python's pyOpenSSL?

六眼飞鱼酱① 提交于 2019-12-04 13:45:55
问题 I would like to use python to create a CA certificate, and client certificates that I sign with it. I will be using these with OpenVPN. After several days of research, and trial and error, this is what I've come up with: #!/usr/bin/env python import os import sys import random from OpenSSL import crypto ########### # CA Cert # ########### ca_key = crypto.PKey() ca_key.generate_key(crypto.TYPE_RSA, 2048) ca_cert = crypto.X509() ca_cert.set_version(2) ca_cert.set_serial_number(random.randint

X500Principal Distinguished Name order

你离开我真会死。 提交于 2019-12-04 13:06:56
问题 I'm using the Bouncycastle lib to generate certificates from PKCS10 requests using the X509v3CertificateBuilder class. It returns build a X509CertificateHolder object which contains the generated certificate. If I call getIssuer on the holder, it returns the issuer distinguished name in the correct order (the same returned if I call getSubjectX500Principal() on the issuer certificate), if I parse the encoded version from the holder using the java CertificateFactory, the getIssuerX500Principal

“an introduction to openssl programming.” article. expired certificates

本小妞迷上赌 提交于 2019-12-04 12:39:48
I am newbie in openSSL library and PKI . I have simple question for openSSL experts. Does anybody know how to create certificates for code samples in this article "An Introduction to OpenSSL programming (Part I/II)" by Eric Rescorla www.rtfm.com/openssl-examples/part1.pdf www.rtfm.com/openssl-examples/part2.pdf I have downloaded source code from http://www.rtfm.com/openssl-examples The problem is that certificates are expired and I don't know how to create new root certificate. How to create root certificate? How to create certificates for client and server app? Wich ciphering algorithm should

Automate export x509 certificate w/chain from Server 2008 R2 to a p7b file WITHOUT external tools?

▼魔方 西西 提交于 2019-12-04 12:17:29
I manage the Domain Controllers centrally, but the site admins manage their own digital senders locally. I can easily export an X509 certificate (private key not needed) with the whole chain from a Windows Server 2008 R2 Domain Controller to a p7b file through the wizard: ~~~~~~~~~~~~~~~~~ ...5. The Certificate Export Wizard opens. Click Next. In the Export File Format dialog box, do the following: a. Select Cryptographic Message Syntax Standard – PKCS #7 Certificates (.P7B). b. Check Include all certificates in the certification path if possible. c. Click Next. In the File to Export dialog

Azure IoT Hub Certificate

99封情书 提交于 2019-12-04 11:23:56
I'm trying to publish some data on the Azure IoT hub using Mqtt. I've succesfully published some data, using a SAS token. But my customer wants a x509 self generated & self signed certificate. Azure is supporting this, but doesn't give much information about it. ( https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security#supported-x509-certificates ) A self-generated and self-signed X-509 certificate. A device manufacturer or in-house deployer can generate these certificates and store the corresponding private key (and certificate) on the device. You can use tools such as

How to use X509_verify()

 ̄綄美尐妖づ 提交于 2019-12-04 10:03:47
How can we use X509_verify(). I have two certificates. The first certificate is the Root Certificate which signed the next certificate (which is my Certificate). So I want to check if my certificate is signed by the root certificate using x509_verify() in C++. My goal is to keep the code simple and Understandable so I can also put it online. Signature of X509_verify is int X509_verify(X509 * x509, EVP_PKEY * pkey); Suppose of you have root certificate in root and your certificate in mycert; X509 * root; X509 * mycert; //Get root certificate into root //Get mycert into mycert. //Get the public