x509

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

烂漫一生 提交于 2019-12-03 09:11:00
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(InstanceLoggerFactory loggerFactory) { try { this.logger = loggerFactory.getLogger(CustomTrustManager.class)

Import PFX file into Existing JKS file (NOT converting from .pfx to .jks)

爷,独闯天下 提交于 2019-12-03 08:51:58
问题 I have Java web service and have implemented X.509 using jks files created by Java Keytool. keytool -genkey -keyalg RSA -sigalg SHA1withRSA -validity 730 -alias myservicekey -keypass skpass -storepass sspass -keystore serviceKeystore.jks -dname "cn=localhost" keytool -genkey -keyalg RSA -sigalg SHA1withRSA -validity 730 -alias myclientkey -keypass ckpass -storepass cspass -keystore clientKeystore.jks -dname "cn=clientuser" To establish trust between client and server I import the server certs

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

社会主义新天地 提交于 2019-12-03 08:33:15
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(50000000,100000000)) ca_subj = ca_cert.get_subject() ca_subj.commonName = "My CA" ca_cert.add_extensions(

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

筅森魡賤 提交于 2019-12-03 08:18:59
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 configuration did not help. Other settings from the configuration file are considered so I'm sure the file

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

给你一囗甜甜゛ 提交于 2019-12-03 07:36:32
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 you calculate the SHA1 hash/fingerprint of an X509 cert stored within a PEM file using C/C++/Objective-C?

Where to get Certificate for digitally signing PDFs?

橙三吉。 提交于 2019-12-03 06:50:21
问题 I'm working on a Java application that uses iText to digitally sign PDFs that will be made available online. I have been able to sign the documents with a test cert I obtained from GlobalSign and it works great. The test cert is part of GlobalSign's "DocumentSign for Adobe PDF". The reason I had to use this cert is so that my cert chains back to the Adobe Root CA, which to my knowledge (and I could be wrong) is the only CA that is trusted by Adobe Reader out of the box. I tried regular SSL

How to verify a X509 certificate in C

£可爱£侵袭症+ 提交于 2019-12-03 05:19:28
问题 I have a certificate in X509 format. this a input parameters in a function. What I would like to do is to verify the validity of the certificate. How can it be done? X509_verify_cert(); I found this function, but this does not accept a X509* certificate, it accepts X509_store and I only have a X509. Thanks best regards. 回答1: See the documentation here. You need to create a certificate store using X509_STORE_CTX_new. Then add certificate chain using X509_STORE_CTX_set_chain. Add trusted root

OpenSSL Version V3 with Subject Alternative Name

柔情痞子 提交于 2019-12-03 04:59:03
问题 I'm using the OpenSSL command line tool to generate a self signed certificate. It seems to be working correctly except for two issues. I can't get it to create a .cer with a Subject Alternative Name (critical) and I haven't been able to figure out how to create a cert that is Version 3 (not sure if this is critical yet but would prefer learning how to set the version). Has anyone done this successfully? The default config (.cfg) file has seemingly clear documentation (seen below): " This

OpenSSL as a CA without touching the certs/crl/index/etc environment

帅比萌擦擦* 提交于 2019-12-03 04:46:15
问题 I think I have the right OpenSSL command to sign a certificate but I've gotten stuck and the tutorials I've found use a different argument format (I'm using OpenSSL 0.9.8o 01 Jun 2010). openssl ca -cert cert.pem -keyfile key.pem (Private key is not encryped and CSR is on stdin.) It gives this error Using configuration from /usr/lib/ssl/openssl.cnf ./demoCA/index.txt: No such file or directory unable to open './demoCA/index.txt' Looking at that configuration file: [ ca ] default_ca = CA

The new subject hash openssl algorithm differs

拈花ヽ惹草 提交于 2019-12-03 03:47:22
I am running into an issue when managing openssl certificates from Java Framework. openssl x509 -subject_hash ... output differs to the one that Java framework returns when calling X509_NAME_hash() , see below. The reason for this is that openssl changed the way it calculates the SHA1. Now, instead of basing the hash in the ASN.1 DER representation of the subject, as it does for MD5, it first calculates the CANONICAL representation and then based on that, it calculates the ASN.1 DER, and then uses that as the input for the SHA1 algorithm. NativeCrypto.java : // --- X509_NAME ------------------