x509

SignerID cast to X509CertSelector in BouncyCastle library

南笙酒味 提交于 2019-12-10 11:47:48
问题 I'm trying to verify if an specific message is signed with a valid signature from an entity certificate recognized by my own trust anchor. I'm doing this: public static boolean isValid(CMSSignedData signedData, X509Certificate rootCert) throws Exception { CertStore certsAndCRLs = signedData.getCertificatesAndCRLs("Collection", "BC"); SignerInformationStore signers = signedData.getSignerInfos(); Iterator it = signers.getSigners().iterator(); if (it.hasNext()){ SignerInformation signer =

OpenSSL not enough data

时光毁灭记忆、已成空白 提交于 2019-12-10 11:18:45
问题 I've generated a self signed certificate using Adobe X, and exported a pfx file (for my private key) along with a .cer file (for the certificate). I then try to collect the certificate, along with the key, but for some reason, OpenSSL is giving the error OpenSSL::X509::CertificateError: not enough data Here is my code require 'openssl' CERTFILE = "test.cer" RSAKEYFILE = "test.pfx" # Open certificate files cert = OpenSSL::X509::Certificate.new(File.read CERTFILE) key = OpenSSL::PKey::RSA.new

How to sign xml with X509 cert, add digest value and signature to xml template

好久不见. 提交于 2019-12-10 10:44:50
问题 I am quite new to C# and especially new to Signing with X509. I have an xml template in which I have to add the certificate used (done) and sign the timestamp (TS-1), the binary security token and the body (id-1). Furthermore, I need to write (e.g. replace placeholders) with the digest value of these 3 elements and add the signature value. However, I do not really understand the concept, e.g. how to do this. I read a couple of websites, e.g. signing a xml document with x509 certificate but I

Digital Signature with wrong value

混江龙づ霸主 提交于 2019-12-10 10:09:46
问题 I am trying to create a digital signature for a block of Text. While I seem to be able to create a signature it is different from the digital test signature as required by our test cases. The code I am using is below. X509Store store = new X509Store(StoreName.My, StoreLocation.CurrentUser); store.Open(OpenFlags.OpenExistingOnly); X509Certificate2Collection certcol = store.Certificates.Find(X509FindType.FindByIssuerName, "eBusiness Development CA", false); if (certcol.Count > 0) {

How do I send signed emails from ActionMailer in Rails 3?

主宰稳场 提交于 2019-12-10 01:14:27
问题 Using Rails 3 I want to use an X.509 certificate to sign parts of emails. There is a currently existing answer for Rails 2 at How do I send signed emails from ActionMailer? but it doesn't work on Rails 3. Is it possible to sign emails via ActionMailer in Rails 3? If that is not possible, is it possible to sign emails via sendmail after creating by ActionMailer? 回答1: perhaps it's not the best answer, however here's what I'd do: try to install that plugin (even if it's for rails 2.0.x) tests

Message Signing using X509 certificate

大兔子大兔子 提交于 2019-12-10 00:10:53
问题 I am signing message using digital certificate in a asp.net web service using below code. Signing is working fine expect signedMessage.ComputeSignature line is taking up to 30 to 40 seconds because of this i am face timeout exception. The same code when i am running under windows forms application is producing result in fraction of second. Any clue or help. public static string Encrypt(string fullMessage, string certificateName, bool deAttch) { X509Certificate2 signer = GetCertificate

Reading a certificate signing request with C#

£可爱£侵袭症+ 提交于 2019-12-09 17:06:50
问题 I want to read the contents of a CSR in C#. However, I haven't found any way to do it in C#. What I've found was the namespace System.Security.Cryptography.X509Certificates , but it only handles existing certificates, not certificate requests. Can anyone give me an hint about it? Thanks in advance. 回答1: There is a way, the CertEnroll library which comes with Windows (although I can't say how far back it's been there) allows you to load certificate requests and have them parsed. First you need

Does X509TrustManagerImpl.checkServerTrusted() handle OCSP by itself if the appropriate properties are set?

我是研究僧i 提交于 2019-12-09 07:16:17
问题 public class CustomTrustManager implements X509TrustManager { private X509TrustManager trustManager; // If a connection was previously attempted and failed the certificate check, that certificate chain will be saved here. private Certificate[] rejectedCertificates = null; private Certificate[] encounteredCertificates = null; private KeyStore keyStore = null; private Logger logger; /** * Constructor * * @param loggerFactory * see {@link InstanceLoggerFactory} */ public CustomTrustManager

Howto create a certificate using openssl including a CRL distribution point?

偶尔善良 提交于 2019-12-09 06:25:25
问题 I'm having problems using openssl to create a x509 certificate containing a crl distribution point for testing. I've checked the documentation and found the configuration setting crlDistributionPoints for this purpose. Unfortunately openssl always generates x509 version 1 certificates without instead of version 3 certificates with the crl distribution point. I'm sure something is wrong with my command or the configuration but reading the documentation carefully and playing around with the

How to calculate X.509 certificate's SHA-1 fingerprint in C/C++/Objective-C?

我们两清 提交于 2019-12-09 06:05:39
问题 Background: I am writing a client utility which is capable of connecting to a remote server using SSL/TLS. The client uses OpenSSL to perform the SSL/TLS transactions and I would like to allow users to specify authorized CA Certs (in the case of self signed certs or private CA setups) used to sign the server's certificate. I plan on using the cert's fingerprint, common name, and validity dates to allow the user to quickly view the certs the client uses to validate servers. Question: How do