Wrong PIN when initializing RSACryptoServiceProvider with smart card

I get a "wrong PIN" exception initializing RSACryptoServiceProvider this way in Visual Studio C++ 2012:
array<System::Byte>^ Sign(array<System::Byte>^ BinDataToSign, X509Certificate2^ Certificate, String^ ProviderName)
//Set Password
System::Security::SecureString^ secString = gcnew System::Security::SecureString();
secString->AppendChar(wchar_t("1"));
secString->AppendChar(wchar_t("1"));
secString->AppendChar(wchar_t("1"));
secString->AppendChar(wchar_t("1"));
System::Security::AccessControl::CryptoKeySecurity^ cryptoSecurityKey = gcnew System::Security::AccessControl::CryptoKeySecurity();
CspParameters^ cspa = gcnew CspParameters(1, ProviderName, "8ed9f3ef2dffe62d154f2d82546c337521096e", cryptoSecurityKey, secString);
RSACryptoServiceProvider^ csp = gcnew RSACryptoServiceProvider(cspa);
That is not the actual pin in the example, but I have checked and verified that I am using the correct PIN. Maybe it has something to do with character type convertion when appending to the secure string?

Maybe it has something to do with character type convertion when appending to the secure string?
Hi Andrius, Why not set a breakpointer in your function and step by step debugging your code? So you could see the value of secString and any others variables. If you get a unexpect value, so you will know where make the problem in your code. Anything you
want to know, please don't hesitate and post it here.
Check this:
https://msdn.microsoft.com/en-us/library/system.security.securestring.appendchar(v=vs.110).aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • I must have used a wrong id when loading my itune gift card,please let me know which account redeemed it.

    i must have used a wrong id when loading my itune gift card,please let me know which account redeemed it.
    <Edited by Host>

    Nobody here can; only the iTunes Store staff might be able to help with this.
    (74761)

  • HT3702 when i purchase with visa card it tell me please contact itunes support to complete this transaction

    when i purchase with visa card it tell me please contact itunes support to complete this transaction please help  me

    Many people are having this same problem. I myself was in touch with iTunes for over a week as well as with my bank (Capital One in this case). For Some reason iTunes has put your debit/credit cards into a "fraud mode". According to my bank representative people have been calling in for about 2 weeks about this, so you and I are not alone at all about this. For me I was able to buy anything as long as it was under $10.00, but anything above gave me the errors you are having. You need to contact your debit/credit card customer service numbers and first make sure that there is no "block" or "cap" on them for iTunes. Then ask them why it is being declined. They may ask you to verrify the city and or state which the iTunes store billing you is in, TELL THEM "CALIFORNIA". Then once you have done everything with the bank you need to contact iTunes Store which is only possible with email (or so Apple has told me), and have them reset the billing and and address information for your account. They will email you back saying that in 30 min...blah blah blah... Basically once they have responded log off from the iTunes store on every single apple device you have: iPhone, iPad, Apple TV, iTunes on your computers, all of them! Then log back in through your COMPUTER and enter all of your information again. This should sove your problem completely. It worked for me.... Good Luck!

  • Digital Signatures with Smart Cards

    Hi folks,
    It is my first time with digital signatures on R/3 system. I’m at customer that uses smart cards (hardware cryptography). We are doing the SAPCRYPTOLIB and front end installations. After finish these tasks, we need to implement the signatures into 3 workflow processes. I already read the SSF programmers guide, API specifications and SSF user guide. But I still have some doubts:
    The SSF profile is stored into smart card with private key information, but where are the public keys stored? (PAB – Private Address Book of my trusted circle).
    Do I need the CRLs? Note: this is only for workflow processes that run inside of customer landscape; this is not a B2B scenario.
    We don’t have clear yet how we sign the data; we are thinking sign a BOR object. Create an attribute and use it to pass the signer data. Note: for the customer, the objective is user authenticity guarantee.
    The BOR object instance ends when the flows finish, so wee need to store the signed data for auditable reasons. A database table can be a good approach or there is another standard way?
    P.S.: anyone have documentation about this subject, something like how-to with guidelines?
    Thanks in advance,
    Ricardo.
    Message was edited by:
            Ricardo  Quintino

    The SmartCard device is present at the frontend PC - and that's the place where the digital signature operation has to take place. Important is the "What You See Is What You Sign" principle: it has to be ensured that the data that is to be signed (using the private key stored on the SmartCard) is exactly the same as the one that is displayed to the user.
    Notice: there is a different scenario where the server is signing the data (after prompting the user for userID and password and validating that information).
    The signed data is then transported back to the server where it is stored (to ensure auditibility); usually you'll have to keep the (archived) data for years; the public key need to be archived as well.
    Notice: it is possible to attach the certificate (-> public key) which has been used to sign the data to the signed data.
    Regards, Wolfgang

  • Signing with Smart Card (PKCS#11)

    I'm trying to sign my .jar with ActivCard smart card and jarsigner.exe, but I got NullPointerException. I have succeeded to get list of certificates present on smart card. Is there better PKCS#11 provider then sun.security.pkcs11.SunPKCS11?

    I receive the following error message when trying to sing a jar file using a PKI card:
    jarsigner: Certificate chain not found for: Random.  Random must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.This is the command line:
    "C:\Program Files\Java\jdk1.5.0_04\bin\jarsigner" -keystore NONE -storetype PKCS11 -signedjar D:\Work_Java\Random\sRandom.jar -verbose D:\Work_Java\Random\Random.jar RandomWhat does this mean?

  • Controlling Access to OS with Smart Card

    Does any one know if there is a program built within OS X (Tiger) or either a third party program that will allow a machine running Tiger to be set up to only be accessed when using a "Smart Card" (similar to the system used on a lot of government machines)?
    Also, where would a person obtain the Smart Card to use with the program. Thanks!!!

    You might look into a hardware product called "SecuriKey":
    http://www.securikey.com/mac_security.html
    =
    There was a MacWorld review a few years ago of what might have been an earlier version:
    http://www.macworld.com/article/42927/2005/02/securikey.html

  • Help with Smart Card (CAC) reader installation

    Need help connecting my smart card reader to my Mac Book Pro. Either using Fire Fox, Explorer using Parallels with windows XP, or safari. I downloaded all the documentation from the Army AKO and still have problems with my Card reader.

    Hi there, I have written a really good "How-to" on firefox and CAC and also Safari. You might also want to try VMware since Parallels and DoD really don't mix at this time. If yu have any question please let me know.
    Jonathan
    http://www.applemacgeniusville.com

  • PKCS#11 with Smart card

    Hi
    I'm new to smart card technologies. I need some help regarding this. I have to write a application which will store the keys in a smart card. I'm suppose to use pkcs# 11. I don't know from where to start. Can anyone tell me the what to do. I'm using REINER SCT cyberJack e-com USB card reader. Is there any sample code for PKCS11 to write to smart card.

    I receive the following error message when trying to sing a jar file using a PKI card:
    jarsigner: Certificate chain not found for: Random.  Random must reference a valid KeyStore key entry containing a private key and corresponding public key certificate chain.This is the command line:
    "C:\Program Files\Java\jdk1.5.0_04\bin\jarsigner" -keystore NONE -storetype PKCS11 -signedjar D:\Work_Java\Random\sRandom.jar -verbose D:\Work_Java\Random\Random.jar RandomWhat does this mean?

  • Pls help me with smart card problem

    Hi,
    currently, i'm developing a system for my final year project. i've developed a webpage in PHP for clinic management. i also implement smart card in my system. the point of it is to make it easier for both parties - doctor and patient. each time patient comes to receive treatment, doc will check patient's smart card on previous drugs prescription. so then, doc will update it based on the treatment given on that day.
    the problem is, how i want to transmit the data from smart card to be displayed in the php page? maybe i should use applet but i don't know how.
    does anybody has applet source code on transmitting data from smart card to php page?
    i wud b really appreciate it...... thanks in advance.

    Have you checked the Schlumberger web site?
    What do you mean by "parsing from applet to php"? Parsing really isn't a data transfer method except maybe in a very tenuous sense.
    And do you really mean an applet (a small program run on the client and embedded in a web page) or are you using it as shorthand for any java program?
    If an applet, I suppose you could:
    1) use javascript to connect the applet to the web page, which would just happen to be created using PHP. So it would be all client-side operation.
    2) use HttpURLConnection (or, God help you, direct socket connections) to connect to a web server and interact with PHP to give/get data. In this case it would be client/server behavior, but the applet would have minimal interaction with the PHP page it's embedded in.
    3) Make it really fun (i.e.: complicated) by using javascript to connect to the page, and then use AJAX to connect to the server. I have no idea whether that's even possible using PHP.
    Maybe there are other options I haven't thought of.

  • Login with smart card (PC/SC)

    HI all,
    I am building a J2EE application and I need to logon using an smart card with PC/SC standard, I dont know how can I do it.
    I have been reading in http://www.pcscworkgroup.com but It dosen't has documentation for java developers.
    I dont know if I need some libraries for PC/SC standards to acces to the card or anything else...
    Anyone knows how can i start?
    thanks in advande.

    Search the forum. This has been answered a million times

  • Compiling rdesktop with Smart Card support?

    Hello,
    I've tried like the dikens to compile "rdesktop" (an open source solution to connect Windoze PCs using Microsoft RDP protocol). I can compile and run the source code, but I find it impossible to compile in smart card support. I've tried everything to get the "pcsc-lite" components to compile in - but I'm too much of a makefile noob I'm afraid.
    Anyone know how to do this?
    There's a related discussion at http://discussions.apple.com/thread.jspa?messageID=8652963.
    Any help appreciated
    ~Matt

    Hi,
    Thank you for posting in Windows Server Forum.
    In a Remote Desktop scenario, a user is using a remote server for running services, and the smart card is local to the computer that the user is using. In a smart card logon scenario, the smart card service on the remote server redirects to the smart card reader
    connected to the local computer where the user is trying to log on. You can refer following article for details.
    Smart Card and Remote Desktop Services
    http://technet.microsoft.com/en-us/library/ff404286(v=ws.10).aspx
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    TechNet Community Support

  • Logging into Windows Server 2012 from Remote Desktop requires "Connect with Smart Card"; how do I disable this?

    I am using pretty much the default setup. I cannot figure out how to disable this. I do not want to use smart cards.
    Any ideas?

    Does this mean you're trying to RDP from an XP box, therfore have the Remote Desktop feature on the server set to "less secure"? Sounds like thats what disables network authentication, prompting the Smart Card request.
    If you simply click to login as a different user, you can login without a smart card, to include the same user as was being prompted for the card.
    I expect if you choose the Remote Desktop feature requires network authentication on the server, the smart card requirement goes away, but you'll need to login from Win7 or newer clients. Not sure where Vista falls, probably okay too.

  • Help with smart card.

    I just finished my 2nd semester of taking Java. I'm a decent program using GUI. I want to learn how to program smart card and start my own business like a gaming center.
    this is my question. What kind of teminal i need to get?
    will any terminal read any type of smart card?
    How do I start learning how to program smart card?
    any idea or suggesting are more than welcome thanks in advance.

    any idea?

  • TS1292 must have used a wrong id when loading my itune gift card,please let me know which account redeemed it,serial number of the card is GCA0140429644956

    must have used awrong id to load my itunes gift card on my iphone 4s,any way i can find out which account redeemed it.     serial number GCA0140429644956

    As I said in your other thread, nobody here can help with that specific issue. Contact the iTunes Store staff.
    (74764)

  • WRT54G freezes when mac connects with airport card

    I'm using WRT54G, i have plugged to it 3 things; cable modem, a PC desktop and a mac desktop. that all works great. When I connect via my mac laptop the router freezes, sometimes. i've been tracking it and there is no consistency of how long until it freezes or what seems to make it freeze. but it always freezes at some point. and when it does all the computers internet goes down until I restart the router. Any ideas what is happening? I appreciate your help!

    Hi-
    Did you install it correctly?
    http://www.info.apple.com/usen/cip/pdf/g4fw800/g4fw800-airport-extreme.pdf

Maybe you are looking for

  • How to repair a .pst file?

    Hello, My colleague's Outlook pst file is corrupted and the file size is more than 17 GB. Scanpst.exe and PST Recovery Software could not recover the file. Is there any other way to repair it? Best Regards, Ammar Wasif

  • During conf-plant field in goods movement screen - to be didplay

    During Confirmation of a process order, in the goods movement screen, user can change the plant for a component...As a default it is copying the order header plant. Since it is a changeable field i.e. value can be changed , user is changing the filed

  • Computer Stolen - Now what?

    My iMac was stolen only a couple of months after I bought it. I had created my website though iWeb and hosted it with GoDaddy. Now I have replaced my iMac, but I don't know how to import (?) my existing website into iWeb so that I can continue updati

  • Macbook Air vs. Macbook Pro (retina)

    Hi, Back in 2010 I bought a Macbook Pro (mid-2010) 15" with an i7 Processor and 8GB of ram. I was thinking of buying a new macbook air 13" with an i7 processor and 8GB of ram, including a 256Gigabyte SSD. The reason why I want to switch is quite simp

  • What happened to my old font on my new iMAC?

    Recently got a new iMAC to replace a 6 year old iMAC.  I installed the same Adobe CS2 software on both computers. However, some fonts - Papyrus - for example, that I frequently used on the old iMAC, are missing when I try to view or use them on the n