Get ready for beta!

Halo Wars 2 Blitz: Game modes, beginner's tips, and more

One Windows

Microsoft is building a new Windows 10 Shell for PC, Mobile and Xbox

On the Inside

Everything you need to know about the Xbox Insider Program

Beautiful compromises

Surface Studio review: you'll want one, even if you don't need one

3-in-1

Is this the Surface Phone? Microsoft awarded patents for foldable devices

Windows Central Offers

MCSE Certification bundle is just $39

Even more improvements

All the changes found in Windows 10 build 15007!

Games as a Service

What does the cancellation of Scalebound mean for future Xbox exclusives?

Windows Central Offers

Save $90 on these FRESHeBUDS Pro Magnetic Bluetooth Earbuds

Returning for 2017

We're back with an new episode of #AskDanWindows

Lifetime Subscription

VPNSecure is currently 91% off

Our favorite things

The Best of CES 2017 Awards

Infinity Edge in your hand

The XPS 13 2-in-1 is the Dell convertible we've always wanted

Project Valerie

Razer just made a laptop with three — THREE! — 17-inch 4K displays. 😱

Great design from Palo Alto

HP's CES 2017 releases are truly gorgeous PCs

Intel and Google's big day

CES 2017 Day Two: New laptops, new phones, and old ideas made new

Take five is better than ever

The updated Lenovo ThinkPad X1 packs Kaby Lake chips and zero bloatware

Everything we know about the next Xbox: Project Scorpio

UWPowered

'Game Mode' for Windows 10 will power Xbox One and Scorpio games too

Buyer's guide

Best accessories for Microsoft Surface Book

< >
Welcome to the Windows Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 1 of 1
  1.    #1  
    I'm porting a small piece of Java that will fetch HTML from a secured web
    page. The Java code was purposely written to accept any client
    certificate - even out of date certificates. This was accomplished by
    implementing an X509TrustManager that accepted any certificate.

    I'm trying to understand how to do the equivalent in Windows Phone with C# (Visual Studio).

    Does anyone know how to do this? Help would be very much appreciated.
    Thanks in advance.

    I have an example code, but X509Store and X509Certificate2Collection doesn't exist in Windows Phone...

    using System;
    using System.Security.Cryptography;
    using System.Security.Cryptography.X509Certificates;

    public class CertSelect
    {
    public static void Main()
    {
    try
    {
    X509Store store = new X509Store("MY", StoreLocation.CurrentUser);
    store.Open(OpenFlags.ReadOnly | OpenFlags.OpenExistingOnly);

    X509Certificate2Collection collection = (X509Certificate2Collection)store.Certificates;
    for (int i = 0; i < collection.Count; i++)
    {
    foreach (X509Extension extension in collection[i].Extensions)
    {
    Console.WriteLine(extension.Oid.FriendlyName + "(" + extension.Oid.Value + ")");


    if (extension.Oid.FriendlyName == "Key Usage")
    {
    X509KeyUsageExtension ext = (X509KeyUsageExtension)extension;
    Console.WriteLine(ext.KeyUsages);
    }

    if (extension.Oid.FriendlyName == "Basic Constraints")
    {
    X509BasicConstraintsExtension ext = (X509BasicConstraintsExtension)extension;
    Console.WriteLine(ext.CertificateAuthority);
    Console.WriteLine(ext.HasPathLengthConstraint);
    Console.WriteLine(ext.PathLengthConstraint);
    }

    if (extension.Oid.FriendlyName == "Subject Key Identifier")
    {
    X509SubjectKeyIdentifierExtension ext = (X509SubjectKeyIdentifierExtension)extension;
    Console.WriteLine(ext.SubjectKeyIdentifier);
    }

    if (extension.Oid.FriendlyName == "Enhanced Key Usage")
    {
    X509EnhancedKeyUsageExtension ext = (X509EnhancedKeyUsageExtension)extension;
    OidCollection oids = ext.EnhancedKeyUsages;
    foreach (Oid oid in oids)
    {
    Console.WriteLine(oid.FriendlyName + "(" + oid.Value + ")");
    }
    }
    }
    }
    store.Close();
    }
    catch (CryptographicException)
    {
    Console.WriteLine("Information could not be written out for this certificate.");
    }
    }
    }

Similar Threads

  1. IMAP "certificate not valid" error message
    By gideongrimes in forum Windows Phone 7
    Replies: 8
    Last Post: 09-03-2013, 07:44 AM
  2. Connect to wireless network using certificate
    By mapexvenus in forum Windows Phone 7
    Replies: 1
    Last Post: 11-07-2011, 11:26 AM
  3. WiFi - install wireless certificates HELP
    By ultraprism in forum Windows Phone 7
    Replies: 2
    Last Post: 11-01-2011, 12:57 PM
  4. WP7 and certificates
    By Endosmok in forum Windows Phone 7
    Replies: 1
    Last Post: 09-01-2011, 11:45 AM

Posting Permissions