digital-signature

Verify BouncyCastle ECDsa signature with .NET libraries ECDsaCng

99封情书 提交于 2019-12-04 16:47:18
An existing system generated signatures using Bouncy Castle (.NET) and I need to verify these existing signatures using the Microsoft ECDsaCng class. Consider the following code that attempts to do this: public static void InterchangeTest() { //AsymmetricCipherKeyPair bKeyPair_0 = Crypto.GenerateEcdsaKey(); String sPassPhrase = "bob is your uncle"; byte[] bPassPhrase = new UTF8Encoding(false).GetBytes(sPassPhrase); int SaltBitSize = 128; int EcdsaBitLength = 521; byte[] bSalt = new byte[SaltBitSize / 8]; new SecureRandom().NextBytes(bSalt); if (EcdsaBitLength != 192 && EcdsaBitLength != 256 &&

How to sign signature data using bouncy castle?

可紊 提交于 2019-12-04 16:03:57
**This is my code to sign a String.</br>** package my.package; import java.io.FileInputStream; import java.security.Key; import java.security.KeyStore; import java.security.PrivateKey; import java.security.Security; import java.security.Signature; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; import org.bouncycastle.cert.jcajce.JcaCertStore; import org.bouncycastle.cms.CMSProcessableByteArray; import org.bouncycastle.cms.CMSSignedData; import org.bouncycastle.cms.CMSSignedDataGenerator; import org.bouncycastle.cms.CMSTypedData; import org

Digital signature made in C# does not verify in C++

本小妞迷上赌 提交于 2019-12-04 15:52:21
I have a C# application which digitally signs data using RSA. The code is as follows: RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(); rsa.ImportCspBlob(privateKeyBlob); SHA1 sha1 = new SHA1CryptoServiceProvider(); sha1.ComputeHash(myData); byte[] signature = rsa.SignHash(sha1.Hash, CryptoConfig.MapNameToOID("SHA1")); I cannot verify the signature in C++. The code is as follows: HCRYPTPROV cryptProvider; CryptAcquireContext(&cryptProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); // PROV_RSA_SIG does not work HCRYPTKEY publicKey; CryptImportKey(cryptProvider, publicKeyBlob,

Data signatures using Perl

☆樱花仙子☆ 提交于 2019-12-04 14:56:35
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 done so far I have added the .pem file to /etc/ssl I am using the below code to read from the .pem file

How to implement digital signature

风格不统一 提交于 2019-12-04 14:53:15
问题 We are building a web application(Java). Could anybody help brief me what we need to realize the following business scenario ? An user access our web site He inputs some data He generate a PDF file from the data he input and export it He digitally sign this PDF file He then upload this PDF file to our web site The system can parse the PDF file to know who signed this file and be sure it is of integrity and Non-repudiation and to some post-processes. My questions are: What products/libraries

How to RSA verify a signature in java that was generated in php

旧巷老猫 提交于 2019-12-04 14:41:56
问题 We are using phpseclib for Public key signing of data and android java is used for Public key verification. But it repeatedtly failed. PHP Code For generating keys and signing by private key include_once("phpseclib/autoload.php"); function getKeys($keysize=2048){ $rsa = new Crypt_RSA(); //$rsa->setPublicKeyFormat(CRYPT_RSA_PUBLIC_FORMAT_OPENSSH); //$rsa->setPublicKeyFormat(CRYPT_RSA_PRIVATE_FORMAT_PKCS1); $rsa->setPrivateKeyFormat(CRYPT_RSA_PRIVATE_FORMAT_PKCS8); $rsa->setPublicKeyFormat

iPhone signature capture

泄露秘密 提交于 2019-12-04 13:35:26
问题 Is it possible to transfer a signature from an iPhone into an .xls file via a cable (USB) connection? 回答1: So, this may not be exactly what you are looking for, but this is how I capture a signature drawn by a user (with their finger/stylus). Your UIImageView will have the drawn signature. I have not thought about how to transfer the signature image to the .xls but you could save the image to the device's photo library then export it like you would any other image, then drop it into the .xls

Adding a OpenPGP signature to an already signed document? [closed]

穿精又带淫゛_ 提交于 2019-12-04 13:17:21
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . We'd like to implement a workflow that requires multiple people to digitallly sign a document. If I have multiple secret keys in my own keychain, I can do something as simple as: gpg --sign -u userid1 -u userid2 filename But what do I do if I've got an already signed document and I want to add a signature? One

Digitally Sign a SAML2 Request in NodeJS

梦想与她 提交于 2019-12-04 12:56:46
I have the following SAML request that I want to digitally sign: <samlp:AuthnRequest Version="2.0" ID="_9FE393FB-1C9C-4EDD-86A5-1AE9F2192A60" IssueInstant="2014-10-22T11:22:56.676Z" Destination="https://idp.ssocircle.com:443/sso/SSOPOST/metaAlias/ssocircle" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion"> <saml:Issuer>http://app.localhost</saml:Issuer> <samlp:NameIDPolicy AllowCreate="true" /> </samlp:AuthnRequest> I use the following coffeescript code which relies on the nodejs xmlbuilder and xmlcrypto modules: request = @xmlbuilder.create

Infinite loop using AndroidKeyStore authentication

我怕爱的太早我们不能终老 提交于 2019-12-04 12:53:37
My application enters an infinite loop when I use the AndroidKeyStore requiring user authentication to use the keys .setUserAuthenticationRequired(true); .setUserAuthenticationValidityDurationSeconds(60); It is assumed that an operation that uses a user's private key requires that the device has been unlocked, otherwise a UserNotAuthenticatedException is generated. The app must present the device authentication screen, and the next usage of the key will work. But, in my case always is thrown UserNotAuthenticatedException forcing app to show the unlock screen . It only happens in some devices.