digital-certificate

Providing Key Usage to X509Certificate generated with Java BouncyCastle

筅森魡賤 提交于 2019-12-11 22:20:19
问题 Here is my piece of code to for generating X509Certificate with BouncyCastle API private static X509Certificate createCertificate(String dn, String issuer, PublicKey publicKey, PrivateKey privateKey) throws Exception { X509V3CertificateGenerator certGenerator = new X509V3CertificateGenerator(); certGenerator.setSerialNumber(BigInteger.valueOf(Math.abs(new Random() .nextLong()))); certGenerator.setIssuerDN(new X509Name(dn)); certGenerator.setSubjectDN(new X509Name(dn)); certGenerator

What to use to check for a specific EXE file signature?

老子叫甜甜 提交于 2019-12-11 12:32:14
问题 I found this MSDN article that explains how to retrieve information for Authenticode signed executables. It retrieves data in the following format: Signer Certificate: Serial Number: 00 90 1a 1a 1b 1c 1c 26 3d 4f 56 61 70 8f 94 7f e0 Issuer Name: COMODO Code Signing CA 2 Subject Name: Signer's Name My goal here is to verify that the EXE file is signed with the specific signing certificate that belongs to the company. For that I can obviously check Subject Name , but I'm curious about the

Certificate Label when fetching from Windows Cert Store for .Net MQ Client

落花浮王杯 提交于 2019-12-11 10:05:20
问题 I have set the KeyStore to *User to get the certificate from the windows certificate store.The Mq Client application is trying to find the certificate using the label name as shown in the log from the client Trace. I tried setting the CertificateLabel from the client.ini and code but it is not overriding the value. How should i change that? Even if i can override how can i change the label of the certificate which i directly imported into my certificate store? Please Help 000001B6 12:23:39

How to save digital signature of received mail

拟墨画扇 提交于 2019-12-11 03:07:31
问题 I am trying to save the digital signature of the currently opened mail item. Now I realize that Outlook prevents access to encrypt/sign a new email programmatically. Here I am focused on messages which have been received. So far, I am just able to use the MessageClass property to detect a signed email. Function GetCurrentItem() As Object Dim objApp As Outlook.Application Set objApp = CreateObject("Outlook.Application") On Error Resume Next Select Case TypeName(objApp.ActiveWindow) Case

PrivateKey threw an exception of type System.Security.Cryptography.CryptographicException

孤人 提交于 2019-12-11 01:41:55
问题 I'm trying to use self-signed certificate using the following code: X509Certificate2 cert = ToCertificate("CN=localhost"); public static X509Certificate2 ToCertificate(this string subjectName, StoreName name = StoreName.My, StoreLocation location = StoreLocation.LocalMachine ) { X509Store store = new X509Store(name, location); store.Open(OpenFlags.ReadOnly); try { var cert = store.Certificates.OfType<X509Certificate2>().FirstOrDefault(c => c.Subject.Equals(subjectName, StringComparison

Open x509 Certificate store from Java APIs

╄→尐↘猪︶ㄣ 提交于 2019-12-10 21:15:08
问题 I am trying to show the list of certificates from the Client Certificate store in JSP. In .Net there is an option to show the list of certificates with the following code... X509Store xStore = new X509Store(...); xStore.Open(...); // This will open the list of certicates in open dialog box. Is there any similar functionality to get this information in Java? 回答1: You can open a JKS store using the default JDK classes, to open a pkcs12 file or the likes you need a library like bouncycastle. For

Digitally Sign and Verify Pdf Document using itextSharp 5.3.3

我的未来我决定 提交于 2019-12-10 19:27:09
问题 I am trying to digitally sign and Verify pdf documents on server(c#) using iTextSharp 5.3.3. I have generated .Pfx file using DigiSign(Online tool) and then using windows to generate the certificate(.cer) file /// <summary> /// Signs a PDF document using iTextSharp library /// </summary> /// <param name="sourceDocument">The path of the source pdf document which is to be signed</param> /// <param name="destinationPath">The path at which the signed pdf document should be generated</param> ///

how to read the keyusage of a X509 V3 certificate?

匆匆过客 提交于 2019-12-10 17:12:46
问题 I want to read the Key usage field in a certificate .is there an API is available in openssl ? 回答1: You can try using the following command in openssl. openssl x509 -in <certificate to check> -purpose -noout -text This would print out the list of certificate purpose and the certificate itself. 回答2: The previous solutions you need to find inside the result file/output the string "Key Usage". I got the following solution which brings exactly the String inside the Key Usage X509 certificate.

m_safeCertContext is an invalid handle

送分小仙女□ 提交于 2019-12-10 12:33:24
问题 I've been wrestling with a problem, maybe you guys can point me in the right direction. I'm trying to digitally sign a pdf, on the webserver, over an https connection. At page load i'm doing as so: HttpClientCertificate cs = Request.ClientCertificate; X509Certificate card = new X509Certificate(cs.Certificate); Org.BouncyCastle.X509.X509CertificateParser cp = new Org.BouncyCastle.X509.X509CertificateParser(); Org.BouncyCastle.X509.X509Certificate[] chain = new Org.BouncyCastle.X509

Data signatures using Perl

百般思念 提交于 2019-12-09 19:19:42
问题 I have been this project which involves sending of signed data. I have been provided with a .pem file and a server certificate which I am supposed to import to another server from which I should sign the data using these files and then send over the signed data to another server for verification adn processing. My Questions are: How do I import these two files into my server? How do I use perl to use the files to sign the data? To note, I am to import into a linux (Suse). This is what I have