News  [SoftwareSite

Latest News
Older News
RSS Feed
 
Complete Projects
Useful Classes
Top Downloads
Message Board
AllAPI.net
 
Send Comments
Software License
Mentalis.org Buttons
Donate
 
Forums -> Security Library Forum
 
Embedding a certificate in code as a string  
by Angel Todorov [atodorov at acm dot org]
posted on 2003/11/09

Hello.

Since the dll i am using , where i also import the cert, is placed in "public" environment, i don't want to store the certificate on the file system. Is it possible to create a certificate from string which is provided directly in the code? Or, also, is it possible to create a cert from a string in the code, and then load that cert? I provide only the string , which means it is not binary, as the MS.NET wants the certificates to be. (in DER output form). Thanks

by Pieter Philippaerts [Pieter at mentalis dot org]
posted on 2003/11/09

Yes, you can hard code a certificate as a string in your source code. Simply use a Base64ed DER encoded certificate and pass it to the Certificate.CreateFromBase64String method.

Another option is to use a resource file to embed your certificate in your dll. I don't know exactly how this works because I hardly work with resource files, but I'm sure there are some good tutorials online.

 

Copyright © 2002-2007, The Mentalis.org Team. All rights reserved.
This site is located at http://www.mentalis.org/
Send comments to the webmaster.