C# How to get Certificate from thumbprint

Hi everyone,
Following the below step, i want to get Certificate from thumbprint
1, Create Certificate by command 
makecert -sky exchange -r -n "CN=Azure-P2S-Root-Cert"
-pe -a sha1 -len 2048 -ss My "C:\tools\AzureCertificateName.cer"
2, Open certmgr.msc
3, Copy thumbprint of Certificate
4, using code
 private static X509Certificate2 GetStoreCertificate(string thumbprint)
            List<StoreLocation> locations = new List<StoreLocation> 
                StoreLocation.CurrentUser, 
                StoreLocation.LocalMachine 
            foreach (var location in locations)
                X509Store store = new X509Store("My", location);
                try
                    store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);
                    X509Certificate2Collection certificates = store.Certificates.Find(
                        X509FindType.FindByThumbprint, thumbprint, false);
                    if (certificates.Count == 1)
                        return certificates[0];
                finally
                    store.Close();
            throw new ArgumentException(string.Format(
                "A Certificate with thumbprint '{0}' could not be located.",
                thumbprint));
=> Error: "A Certificate with thumbprint '{0}' could not be located.",
Any ideas? I am really stuck here.
Thanks a lot in advance,
Quyen Pham

I want to code following the step
1,Create Virtual Network Gateway
https://msdn.microsoft.com/en-us/library/azure/jj154119.aspx?f=255&MSPPError=-2147217396
2, Revoke a Point-to-Site VPN Client Certificate
https://msdn.microsoft.com/en-us/library/azure/dn547018.aspx
first, i download file Microsoft_DL_SITE-4-10-2015-credentials.publishsettings
and then get string ManagementCertificate = "MIIKDAIBAzCCCcwGCSqGSIb3DQEHAaCCCb0Eggm5MIIJtTCCBe4GCSqGSIb3DQEHAaCCBd8EggXbMIIF1zCCBdMGCyqGSIb3DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAhZCJomXpq4MgICB9AEggTIM/68oC+j8ikOLVp2R5bAya5As1/vwStOjrmh3uQ56AOsbc8y5n1jGhGk4HIT4nd7cPwCPPuaYnC0UCKMOgdZouAUPXPYmgzSNXiqTaSAX4sXYbQYE75pwnCjis1YTcatVuJtIffsBTxllioonSblakob6sMuKWTD49MJS62AzbmM7Y7ioGmpF4uVykUF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rFwehQeADcfeSgmpZEuL8L3qhBw/jURT3O7NkEfA4QL923H3bXKzzXbzrs6jFdFrmDUAHZScezCKlPtHqQ2Nvb7kJyn4yxMtnFboRlbunu9yf8xejbR/cR8T3XlbSneNSTXbSJFjurmoQGn/ZLE7rgq3ZcF2o0CMMrNwRzYKFrfj68pg30nAqZIwuvDnhZslhYD2eUExqyj7nsL7VOvFj9Z05Dyj8pgbyhTSSEvPI8GFmPGirU7yvnorK+xjHL4xE0oyf9oPatSxb1A+SSAN/T8wviEJ6MsYIigJr3mjbw9H225gfGX9Sw7YDXU4P6sj52+TLgoW8x1KV2VxuzFCN0K5wf4ylP9LT1SXaxWptpfJqIJ/ef3YbdHeJ8IO4c591egyf1bIGw9nG5ar6WqOtTbC6VmWQH4HgZgYDzF8fyFWhzneTu6zzJqvJNao/Usq7ynrLOPKgBzWgZZOqp/2P/I9hD0Gdm/9117A0rqB+xsmjOOCCyJz+rvleO8j8a6yyyFaBCTZa28YdRSM5SsbGnWgYLpV2M0fg2AIM9UszX28QnRuULw81aw5ZTAJdBacSacqwGmI+H+DF32jTu5mLtvGVSdvCnoYs+M46r40oUExS0YYEbteu0SYBXNkzn6v1Jf0BhT7yL3yNrSN6OsYkQOvfyvApFqkHZfTN/nvsw5ZXepgxmaUQv4YdXRS7MG8Iz8u6TNs07NxgSvBTUhV3u9prntI09RXZYrd4w2mVWgmAS7IPCU9rq8Sls6XPVODEAibSGVjM4lPrYsfuDMKuArIbNEWCvdwE5K93uKxHitEFMR2RVocuvA5oQ7fkV8p8TSaKwXwiVFJBFWfrMwNzAfMAcGBSsOAwIaBBT38BXHkJJ4lpM17OGhf7V1bCVk4wQUCFr1yJQiWrWnAFvqBvc8ni13foM=";
X509Certificate2 cert = new X509Certificate2(Convert.FromBase64String(ManagementCertificate));
using this cert, i can create ok virtual gateway, but i can not upload certificate
Anything is wrong in here?
Thanks and best Regards,
Quyen Pham

Similar Messages

  • How to get certificate from sun one directory server

    I have installed sun one directory server 5.2. Now in order to connect to the server through ldap protocol i need certificate on the client side.
    How to get the certificate from the sun one directory server...??
    ( Earlier i tried the same procedure with active directory .and i got the certificate successfully ...as well as ldap authentication..but don't know what to do with the sun one..???)
    Any tips on this issue will be helpful
    thank you

    You didn't make mention of setting up ssl on the server side, so search these boards for openssl. Some nice person uploaded an nice example of how do use openssl to do this.
    To get the ssl certs for the solaris-client ssl authentication ( tls:simple ) to work you will need to use netscape to connect to the ssl port to get the right format. There are comments in that same doc on how to do that.

  • How to extract certificates from IE for digital signature

    hi
    how to extract certificates from the cert store provided by Internet Explorer 6.0 and use it to read & verify the digital signatures present in the pc.this is needed in my web based application n i have no idea!!!
    pls help me out
    i have studied a lot about all JCA n JCE but the extraction part still baffles me!!!
    my application will be java based so i can make an applet/ servlet/ jsp
    drop your ideas as soon as u get time as i am stuck in the initial phase itself
    priya_16

    hi
    i've the same problem. i've found this solution, but you need download a JCE Provider that allow you to read the explorer certificate store.
    You can try this one: https://download.assembla.se/jceprovider/
    and the code:
    import se.assembla.*;
    public class Listcerts {  
         public static void list() throws Exception{
              java.security.Security.insertProviderAt(new se.assembla.jce.provider.ms.MSProvider(), 2);
              KeyStore ks = KeyStore.getInstance("MSKS","assembla");
              ks.load(null,null);
              X509Certificate cert=null;
              String alias=null;
              int count=0;
              for (java.util.Enumeration e=ks.aliases();e.hasMoreElements();){
                        alias=(String)e.nextElement();
                        cert=(X509Certificate)ks.getCertificate(alias);
                        System.out.println("\n Certificado alias"+alias+":");
                        System.out.println(cert);
                   count++;
              System.out.println ("NUM CERTS="+count);
    now, i need the same solution for Firefox browser XP
    good luck
    Message was edited by:
    meteko

  • How to get photos from mac to iPhone 6? when i try it just comes up iCloud instead of my photos

    how to get photos from mac to iPhone 6? when i try it just comes up iCloud instead of my photos

    Make sure Settings > iCloud > Photos > iCloud Photo Library (Beta) = "Off"
    Then sync your iPhone using iTunes and make sure your sync settings for photos are set correctly in iTunes.

  • I got a new computer and don't know how to get music from ipod touch to itunes library

    I recently got a new computer and don't know how to get music from my ipod touch to show on my itunes library. 

    You need to transfer the iTunes folder from the old computer to the new one.
    iTunes: How to move your music to a new computer (Mac or Windows):
      http://support.apple.com/kb/HT4527

  • I have a new MacAir and don't know how to get info from my USB stick and my SD photo card.  Can anyone help me please?

    I have a new MacBook Air and don't know how to get info from my USB stick and get info from my SD card.  Can anyone help, please?

    Plug the stick and/or card into the appropriate slots on the side of your Air. Do you see icons for the devices appear on the desktop? Click into them to see what files are there.
    Matt

  • How to get data from a USB-UIRT device using Labview?

    How to get data from a USB-UIRT device using Labview?
    I'm trying to get data from a USB-UIRT device, is it posible with Labview?
    I really appreciate your help, 
    thanks

    You may want to contact the developer of the device for the API and DLL.
    http://65.36.202.170/phpBB2/viewforum.php?f=3

  • How to get file from server while click on link

    Hi,
    i created on link and i gave one server path to select file from server but while clickinng on link it no displaying any thing.
    following is the Destination url that i gave for the item.
    /u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/
    please tell me how to get file from server while click on link.

    Ok I got your requirement now.
    If you are getting file names from view attribute then you should not be adding destination URI property for the link.
    Instead you can use OADataBoundValueViewObject API.
    Try below code in your controller processRequest method:
    I am assuming that you are using classic table.
    Also in below example it considers OAMessageStyleText and you can replace it with link item if you want.
    OATableBean tableBean =
    (OATableBean)webBean.findChildRecursive("<table item id>");
    OAMessageStyledTextBean m= (OAMessageStyledTextBean)tableBean.findChildRecursive("<message styled text in table item id>");
    OADataBoundValueViewObject tip1 = new OADataBoundValueViewObject(m, "/u08/app/appvis/xxex/inst/xxex_apps/xxrbe/logs/appl/conc/log/"+"<vo attr name which stores file name for each row>");
    m.setAttributeValue(oracle.cabo.ui.UIConstants.DESTINATION_ATTR, tip1);
    Regards,
    Sandeep M.

  • How to get value from list item

    Hi all,
    How to get value from list item?
    I have a problem with the List Item object
    in the Oracle forms.
    How can I retrieve the selected item from
    a list ?
    I didn't find any function like 'list.GET_
    SELECTED_ITEM()'...
    thanks
    Bala

    Hello,
    You get the value as for any other Forms item:
    :value := :block.list_tem ;Francois

  • How to get FILENAME from FILE PATH

    does anyone know how to get filename from a file path for example
    FILE PATH: C:\Project\uploadbean\web\uploads\Button.txt
    returns
    FILENAME: Button.txt

    @BalusC
    ust for a reference cause i'm new in JSP This has nothing to do with JSP, but with basic knowledge of an essential API. I have given you the link to the File API. Are you saying that you refused to read the API documentation, which clearly explains you how to use the File and shows which methods are all available to you undereach the straightforward getName() method, and expecting that the others may chew the answers for you? Loser.

  • How to get data from PDF form?

    PDF forms can send data in url like GET or POST method. Is it possible to get data from url, like in PHP http://sever/file.php?item1=value1&item2=value2&item3=value3
    In APEX url have specific construction and I don't know how to get value of items (1...3)
    Please let me help to find simple method of geting data from URL.
    Best Regards,
    Mark

    The APEX URL syntax is detailed here
    http://download.oracle.com/docs/cd/E14373_01/appdev.32/e11838/concept.htm#BCEDJBEH
    How to get it from PDF is another matter...
    I'm working on an app that downloads PDFs with a Large amount of data as a blob, takes that blob and changes it to XML, then goes through the xml to validate each section of data and then add it into the schema that my apex app is referencing....
    I didn't write the original code but I do know that it isn't a quick thing to implement and includes using some uploading some java jar files to your schema and writing some custom java code.
    Someone else may be able to help with grabbing PDF data into the URL for the amounts of data you want to pass to apex.
    Gus..
    REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!
    Edited by: Gussay on Sep 21, 2009 5:52 PM

  • How to get Position from EmployeeInfo in DIAPI

    I am using DIAPI(JCO) for SAP B1. According to one or my reuirement i am in need of Position from the EmployeesInfo. But there  seems no option or method for getting position from that. Can anyone guide me how to get that from EmployeesInfo ? Any help is appreciated..

    Looking at the DI API properties vs. DB fields mapping documentation in the SAP Business One developer area (https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/c5f5dbcc-0a01-0010-5d82-f25f2bee715e)
    it seems that this field is not exposed (yet).
    I.e. you could only run a SQL statement to get this information.
    Sorry,
    Frank

  • How to get songs from computer to iphone

    how to get songs from computer (I tunes) to iphone?

    Have you read the User Guide? http://support.apple.com/manuals/#iphone
    Syncing iPad, iPhone, or iPod touch with iTunes
    Syncing music to iPod or iPhone

  • How to get videos from touch, in full resolution?

    How to get videos from touch, in full resolution?
    I tried email, but that compresses them.

    Import them as you would from any digital camera.
    http://manuals.info.apple.com/enUS/iPod_touch_iOS4.1_UserGuide.pdf

  • How to get resultset from oracle procedure use ejb3

    how to get resultset from oracle procedure use ejb3
    i know oracle procedure should like this
    Create or replace PROCEDURE resultset_test(
    aaa IN NUMBER,
    bbb OUT sys_refcursor) ....
    but what s the ejb3 scripts looks like? please give me an example or link~
    ths

    - there are no EJB3 scripts, only compiled application code
    - the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
    Now you should know what to Google to get your "example script": "java jdbc oracle procedure"

Maybe you are looking for

  • Read only user in weblogic throwing error messages in logs

    Hi, We have a requirement to create a read only user with monitor access. our requirement is to monitor em console using moniotr user, i.e. this user will login to em console, monitor order flow from instances tab by entering order no. and dates, and

  • My email app has been deleted how do i get it back

    My email app that came on the phone has been deleted and I can't get it back. And I can't find it in the play store. Can anyone tell me how to retrieve it? No it is not email for Gmail or hotmail I had to set up the incomeing and outgoing servers if

  • Scripting with FCP and compressor

    Hi folks, I run a video transfer business, therefore, my projects are fairly streamlined in terms of the processes. After beginning a FCP export to a .mov file so i can compress into a m2v and aiff with bitvice, can i write a script to automatically

  • Apple G4 PowerBook Aluminium m880 startup intermittent.

    Hi all, I have an old PowerBook with no battery installed. It has been fine up until last week when it would not respond to the power button. Last night it powered up, but shut down after 15 mins. When I say shut down, it was like pulling the power c

  • Is it possibe to have non numeric measures in cube??

    Hi is it possible to have non numeric measures in a cube?? As i get an error during deployment of mapping of this cube if i have non numeric measures in a cube ....