digital-signature

how to generate digital signature with x509 certificate?

不羁的心 提交于 2019-12-06 03:45:30
问题 How do we get and append x509data and x509certificate tag to the xml produced by the following code String providerName = System.getProperty("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI"); XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM", (Provider) Class.forName(providerName).newInstance()); Reference ref = fac.newReference("", fac.newDigestMethod(DigestMethod.SHA1, null), Collections.singletonList( fac.newTransform(Transform.ENVELOPED,(XMLStructure) null)), null

CNG replacement for CryptQueryObject

好久不见. 提交于 2019-12-06 03:44:13
问题 I'm interested in trying to read fields out of a digital signature. I have code that calls CryptQueryObject, then CryptMsgGetParam to get some fields and finally CertFindCertificateInStore to load the certificate. Any hints on how to do this using the Cryptography Next Generation APIs? Microsoft tells me CryptQueryObject is deprecated but doesn't point to its replacement. 来源: https://stackoverflow.com/questions/48198741/cng-replacement-for-cryptqueryobject

M2crypto signature “algorithm”

纵饮孤独 提交于 2019-12-06 02:50:57
问题 These two codes provide the same signature, which is expected: code1: from M2Crypto import RSA, EVP import base64, hashlib text = "some text" pkey = EVP.load_key("mykey.pem") #"mykey.pem" was generated as: openssl genrsa -des3 -out mykey.pem 2048 pkey.sign_init() pkey.sign_update(text) signature = pkey.sign_final() print base64.b64encode(signature) code2: pkey = RSA.load_key("mykey.pem") signature = pkey.sign(hashlib.sha1(text).digest()) print base64.b64encode(signature) However, if I want to

Digital Signature for SOAP message in WCF

隐身守侯 提交于 2019-12-06 01:51:32
问题 I have a WCF service in 4.0. I need to add digital signature to the SOAP response.I am not quite sure how it actually should be done. I believe the Response should look like what is shown in the link below. https://spaces.internet2.edu/display/ISWG/Signed+SOAP+Messages Is there any place where i can get details about this? Please advice. 回答1: A message contract can indicate whether the headers and/or body of the message should be digitally signed and encrypted. This is done by setting the

Digital Signature with wrong value

狂风中的少年 提交于 2019-12-06 00:30:37
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) { X509Certificate2 cert = certcol[0]; System.Security.Cryptography.RSACryptoServiceProvider privateKey = cert

Digitally sign in PHP using private key, verify in C#

强颜欢笑 提交于 2019-12-06 00:29:07
I am working on a feature that needs me to digitally sign a short string in PHP, and verify the string's signature in C#. I would really like to use openssl_sign in PHP, because of its simplicity, but all the information I can find on Google indicates that this will not work. There are some external libraries that claim to do this well, however as this is a hobby project I would rather not purchase such a library. So what are the alternatives here? Full interoperability between C# and PHP is required. Libraries besides OpenSSL can be used. I've done something very similar using Bouncy Castle

Verifying jwt tokens [rsa]

孤街醉人 提交于 2019-12-05 23:17:24
A collegue and myself have been trying to understand how jwt tokens verify tokens, but from our reading we seem to be confusing ourselves. Please can someone help confirm whether my thinking is correct Tokens are signed using the private key. The signature is a combination of the header and payload encrypted using the private key and added to the jwt as the last part, the signature. In order to verify the token the receiver can replicate this process using the public key. They encrypt the header and payload to see if it the same as the signature. Note this is not decryption. The receiver is

How do i add additional information to Certificate Service Request (CSR)?

不想你离开。 提交于 2019-12-05 21:16:03
I'm using OpenSSL to generate a Certificate Service Request (CSR). The standard fields are: Common Name: John Doe Organization: MyCompany Inc. Organization Unit: Sales Locality: SF State: CA Country: US Email: john.doe@mycompany.com However I want to add my own fields to the certificate such as: GroupId: 348348923 EmployeeLevel: Class 3 What is the proper way to do this before I request the Certificate Authority (CA) sign the CSR? All the fields you're describing are subject items in an X509 CSR. They're actually OIDs (usually displayed by their given short name). You can find a list of them

How do I read the digital signature information from a signed .Net assembly?

僤鯓⒐⒋嵵緔 提交于 2019-12-05 18:37:24
问题 I am writing an assembly information application to be used in our software build process and am trying to read the digital signature information from a signed .Net assembly. I want to do in my C# code what Windows Explorer can do by right-clicking a signed assembly and selecting the "Digital Signatures" tab and then clicking the Details button. e.g. Has anyone got an idea how to do this programmatically in C#? I am currently using the Mono Cecil library to get the rest of the information

Alternative for digital signing applet under Chrome

北慕城南 提交于 2019-12-05 16:56:51
问题 At the moment we have developed a system that can digitally sign documents using a java applet. However with the ban of applets under chrome we are looking for an alternative solution for digital signing. At the moment the signing works the following way: A HTTP GET is sent to a servlet to get the document that is going to be signed; The applet gets started, the digital signature driver gets extracted from the file system and the user enters the PIN; The applet gets the certification chain,