digital-signature

verify digital signature

元气小坏坏 提交于 2019-12-12 06:31:27
问题 I want to verify my signature. I use this code var encoder = new UTF8Encoding(); byte[] bytesToVerify = encoder.GetBytes(LoginChallenge); RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); RSAKeyInfo.Modulus = publickey1; rsa.ImportParameters(RSAKeyInfo); bool suc = rsa.VerifyData(bytesToVerify, CryptoConfig.MapNameToOID("SHA1"), signedBytes); I have public key in byte array format. It is in my db. like this enter image description here always suc=false. I'm sure bytetoverify has

Does OpenSSL -sign for ECDSA apply ASN1 encoding to the hash before signing?

戏子无情 提交于 2019-12-12 05:38:56
问题 This SO question ECDSA sign using OpenSSL without ASN1 encoding the hash states the OpenSSL perfoms ASN1 encoding to the hash before signing it. In other words it states that OpenSSL performs the following steps when for an Elliptic curve key -sign is called: a. Calculate H = Hash(M) b. Encode H into ASN1 standard- H’ c. Sign H’ And thus to avoid applyting step b it's neccessary to first calculate the digest, and then sign the digest using raw signing - pkeyutl for elliptic curver keys

missed stream in pdf (pdfbox)?

偶尔善良 提交于 2019-12-12 04:58:38
问题 I've create pdf with pdfbox (using PDResources, PDXObjectForm, PDAppearanceDictionary and so on). I have Visible signature on pdf. when I see the pdf, I have missed some stream. 4 0 obj <</Type /XObject//Resources <</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]/XObject <</n0 9 0 R/n1 10 0 R>>>>/BBox [0 0 100 100]/FormType 1/Length 11 0 R>> stream endstream endobj 8 0 obj <</Type /XObject/Subtype /Form/Resources <</XObject <</FRM0 4 0 R >>/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]>>/BBox [0

Sign PDF file on last page

ぐ巨炮叔叔 提交于 2019-12-12 04:49:45
问题 I am using C# and iTextSharp 3.1 to sign PDF files. The signing is working, but I want to sign on the last page of the file. The code I use is such : reader = new PdfReader(inputPDF); int numberOfPages = reader.NumberOfPages; PdfStamper st = PdfStamper.CreateSignature(reader, new FileStream(outputPDF, FileMode.Create, FileAccess.Write), '\0', null, true); PdfSignatureAppearance sap = st.SignatureAppearance; if (logoSign != null) { // Scale img to fit logoSign.ScaleToFit(100, 50); // Set

Need help verifying a signature with the Python Cryptography library

南笙酒味 提交于 2019-12-12 04:25:46
问题 I'm trying to verify a signature using the Python Cryptography library as stated here https://cryptography.io/en/latest/hazmat/primitives/asymmetric/rsa/ This is in the context of a client-server TCP chat app, and the client has calculated the signature, and sent it to the client to verify that it is indeed the correct server. The signature is passed to a function to verify. def VerifySignature(signature): with open("server_publickey.pem", "rb") as key_file: public_key = serialization.load

How to Sign a PDF File using Field Locators using Java including its necessary jar (i.e. java packages)?

馋奶兔 提交于 2019-12-12 04:14:45
问题 I am having a C# code for signing a PDF file using Field Locator in the given link http://developer.arx.com/examples/sapi-local-csharp-signing-a-pdf-file-using-field-locators/ I need Java compatible code and its necessary java packages to achieve the same. Also you can have a look into my previous question How to change the coordinates of Signature in CoSign Signature SOAP API and place it over some given text (i.e. Sign Here)? querying the same. 回答1: A code example in Java that demonstrates

Package signing , and digital certificate

假装没事ソ 提交于 2019-12-12 04:04:50
问题 I Created a windows forms application using c# the output of the App is .exe , in the references of this project , I had added a reference of many dlls that this project needs all of them are Created by me.But these referenced dlls , some of them are using third parities Dll. I packed the .exe and all referenced dll in an installer project using wix Toolset. Note that the .exe and the installer has no strong names and not signed with key. I upload this .msi result file into an intranet server

iText signing PDF using external signature with smart card

自作多情 提交于 2019-12-12 03:55:56
问题 I've been toying with iTextSharp 5.5.7 for a while and can't find the right way to make a valid digital signature for PDF from Smart Card - Adobe Reader always says its signed by and unknown and can't decode signatures' DER data. I've looked at MakeSignature.cs code for reference and what is does: Stream data = signatureAppearance.GetRangeStream(); // gets the first hash byte[] hash = DigestAlgorithms.Digest(data, hashAlgorithm); // gets the second hash or is it not a hash at all ? byte[] sh

Storing private keys using DSACryptoServiceProvider

泄露秘密 提交于 2019-12-12 02:57:17
问题 I'm trying to use the DSACryptoServiceProvider class with C# to create two DLLs: one will have the ability to verify and create digital signatures, the other will just be able to verify. Basically, I'm trying to create a private/public key pair and save they keys accordingly (to a file). I'm running into problems when using ExportParameters(). When I attempt to export the key containing the private information (using serialize), the private information is automatically nulled out. Is there a

how to sign an end entity certeficate by a ca cert using a given private key

99封情书 提交于 2019-12-11 23:18:00
问题 I have coded in java (using bouncy castle library)my CA certificate. and now I want to sign an end entity certificate with a given private key. here is my code : X500Principal dnNameIssuer = new X500Principal("CN=\"" + hashedValue + " CA\", OU=PKI, O=\"" + hashedValue + ", Inc\", L=Darmstadt, ST=Hessen, C=DE"); X500Principal dnNameSubject = dnName; serialNumber = new BigInteger("123127956789") ; keyus = new KeyUsage(KeyUsage.digitalSignature); ContentSigner signer = new