Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. c++ signing data using CAPICOM

c++ signing data using CAPICOM

Scheduled Pinned Locked Moved C / C++ / MFC
c++cryptographyquestion
9 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    UserNameless
    wrote on last edited by
    #1

    i want to sign some piece of data using a certificate's private key. anyone know how and what do i call from capicom functions to encrypt using private key? thanks in advance

    C 1 Reply Last reply
    0
    • U UserNameless

      i want to sign some piece of data using a certificate's private key. anyone know how and what do i call from capicom functions to encrypt using private key? thanks in advance

      C Offline
      C Offline
      chirag_chauhan
      wrote on last edited by
      #2

      To access Private Key from certificate use CryptImportKey() function and you can look into the MSDN sample code for encrypting the data http://msdn.microsoft.com/en-us/library/aa382006(VS.85).aspx[^]

      U 1 Reply Last reply
      0
      • C chirag_chauhan

        To access Private Key from certificate use CryptImportKey() function and you can look into the MSDN sample code for encrypting the data http://msdn.microsoft.com/en-us/library/aa382006(VS.85).aspx[^]

        U Offline
        U Offline
        UserNameless
        wrote on last edited by
        #3

        nice thanks. i'll look into this cryptimportkey() function, although the example doesn't run for me (using visual studio 2005)....

        C 1 Reply Last reply
        0
        • U UserNameless

          nice thanks. i'll look into this cryptimportkey() function, although the example doesn't run for me (using visual studio 2005)....

          C Offline
          C Offline
          chirag_chauhan
          wrote on last edited by
          #4

          Yes correct, it's working for VS2008.

          U 1 Reply Last reply
          0
          • C chirag_chauhan

            Yes correct, it's working for VS2008.

            U Offline
            U Offline
            UserNameless
            wrote on last edited by
            #5

            ugh i hate to keep bothering you but i can't figure out this cryptimportkey function. would you know how to use it? :sigh: basically i want to be able to click on a certificate on my gui, and use its private key to sign some data

            C 1 Reply Last reply
            0
            • U UserNameless

              ugh i hate to keep bothering you but i can't figure out this cryptimportkey function. would you know how to use it? :sigh: basically i want to be able to click on a certificate on my gui, and use its private key to sign some data

              C Offline
              C Offline
              chirag_chauhan
              wrote on last edited by
              #6

              Can you please let me know how much can you able to achieve? Can u able to launch Certificate selection Dialog?? And r u trying with VS2005/2008?

              U 1 Reply Last reply
              0
              • C chirag_chauhan

                Can you please let me know how much can you able to achieve? Can u able to launch Certificate selection Dialog?? And r u trying with VS2005/2008?

                U Offline
                U Offline
                UserNameless
                wrote on last edited by
                #7

                yes i am able to launch a gui (made using mfc) which displays in columns the "Issued By", "Issued To" and email address of all the certificates in MYSTORE. When I click on any of the rows, I am able to display the corresponding certificate by using the Display() command. Shall I email you my code so far? I am using VS2005. thanks

                C 1 Reply Last reply
                0
                • U UserNameless

                  yes i am able to launch a gui (made using mfc) which displays in columns the "Issued By", "Issued To" and email address of all the certificates in MYSTORE. When I click on any of the rows, I am able to display the corresponding certificate by using the Display() command. Shall I email you my code so far? I am using VS2005. thanks

                  C Offline
                  C Offline
                  chirag_chauhan
                  wrote on last edited by
                  #8

                  sorry, I was away from the forum for sometime. Does your problem get solved?? If not, may be you can copy-paste relevant code snippet here.

                  U 1 Reply Last reply
                  0
                  • C chirag_chauhan

                    sorry, I was away from the forum for sometime. Does your problem get solved?? If not, may be you can copy-paste relevant code snippet here.

                    U Offline
                    U Offline
                    UserNameless
                    wrote on last edited by
                    #9

                    yeah i got the data to sign now, but im stuck with verifying the data, i googled it and couldn't find a satisfactory solution for it. seems to have something to do with capicom being made for java and all so the way its handling or data is different than c++ (ascii vs unicode) so im stuck there now lol. thanks for the concern though

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups