EldoS | Feel safer!

Software components for data protection, secure storage and transfer

TElX509Certificate as IIS SSL certificate

Also by EldoS: Callback File System
Create virtual file systems and disks, expose and manage remote data as if they were files on the local disk.
#3589
Posted: 08/17/2007 07:14:18
by Josh Edler (Basic support level)
Joined: 08/10/2007
Posts: 6

That worked! :D

Thanks for the tip about the Issuer and Subject, too!

Thanks to everyone for their help. To clarify for anyone else who may run into the same issue, the following code generates a self-signed certificate and adds it to the certificate store in a manner that IIS recognizes:

Code
                TName issuer = new TName();
                issuer.CommonName = "MyFullyQualifiedHostname";

                TName subject = new TName();
                subject.CommonName = "MyFullyQualifiedHostname";

                TElX509Certificate x509 = new TElX509Certificate();

                x509.SetIssuer(issuer);
                x509.SetSubject(subject);­

                x509.ValidFrom = DateTime.UtcNow.AddDays(-­1d);
                x509.ValidTo = new DateTime(2039, 12, 31, 23, 59, 59, DateTimeKind.Utc);

                x509.CAAvailable = false;

                int algorithm = SBUtils.__Global.SB_CERT_­ALGORITHM_MD5_RSA_ENCRYPT­ION;
                int dwords = 1024 / 32;
                
                x509.Generate(algorithm, dwords);

                TElWinCertStorage storage = new TElWinCertStorage();
                storage.AccessType = TSBStorageAccessType.atLo­calMachine;
                storage.Provider = TSBStorageProviderType.pt­RSASchannel;
                storage.SystemStores.Add(­"My");
                storage.Add(x509, "MY", true, false, false);

Reply

Statistics

Topic viewed 6474 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!