How to use the Password Generator Library in your application

  • Homepage
  • Software
  • Thoughts and Ideas
  • Photos and Art
  • Contact

To use the Password Generator Library in your application, you need to copy the following settings to your application configuration file.

<?xml version="1.0" encoding="utf-8" ?> 
<configuration>
 <configSections>
  <sectionGroup name="CAM.PasswordGeneratorLibrary">
   <section name="PasswordGenerators" 
    type="System.Configuration.NameValueSectionHandler, 
      System, Version=1.0.3300.0, Culture=neutral, 
      PublicKeyToken=b77a5c561934e089" />
   <section name="RandomNumberGenerators" 
    type="System.Configuration.NameValueSectionHandler, 
      System, Version=1.0.3300.0, Culture=neutral, 
      PublicKeyToken=b77a5c561934e089" />

   <section name="PasswordGeneratorDefaults" 
    type="System.Configuration.SingleTagSectionHandler, 
      System, Version=1.0.3300.0, Culture=neutral, 
      PublicKeyToken=b77a5c561934e089" />
  </sectionGroup>
 </configSections>

 <CAM.PasswordGeneratorLibrary>
  <PasswordGenerators>
   <add key="RandomPasswordGenerator" 
    value="CAM.PasswordGeneratorLibrary.RandomPasswordGenerator" />
   <add key="PronounceablePasswordGenerator" 
    value="CAM.PasswordGeneratorLibrary.PronounceablePasswordGenerator" />
  </PasswordGenerators>

  <RandomNumberGenerators>
   <add key="cryptographic" 
    value="CAM.PasswordGeneratorLibrary.CryptographicRandomNumberGenerator" />
   <add key="pseudo-random" 
    value="CAM.PasswordGeneratorLibrary.PseudoRandomNumberGenerator" />
  </RandomNumberGenerators>

  <PasswordGeneratorDefaults PasswordGenerator="RandomPasswordGenerator" 
    RandomNumberGenerator="cryptographic" />
 </CAM.PasswordGeneratorLibrary>

 <appSettings>
  <add key="CAM.RandomPasswordGenerator.Numbers" 
    value="0,1,2,3,4,5,6,7,8,9" />
  <add key="CAM.RandomPasswordGenerator.LowercaseCharacters" 
    value="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z" />
  <add key="CAM.RandomPasswordGenerator.UppercaseCharacters" 
    value="A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z" />
  <add key="CAM.RandomPasswordGenerator.OtherCharacters" 
    value=" ,!,&quot;,#,$,%,&amp;,',(,),*,+,,,-,.,/,:,;,&lt;,
      =,&gt;,?,@,[,\,],^,_,`,{,|,~" />

  <add key="CAM.PronounceablePasswordGenerator.LowercaseVowels" 
    value="a,e,i,o,u" />
  <add key="CAM.PronounceablePasswordGenerator.UppercaseVowels" 
    value="A,E,I,O,U" />
  <add key="CAM.PronounceablePasswordGenerator.SpecialVowels" 
    value="|,!,@,0" />
  <add key="CAM.PronounceablePasswordGenerator.LowercaseConsonants" 
    value="b,c,d,f,g,h,j,k,l,m,n,p,q,r,s,t,v,w,x,y,z" />
  <add key="CAM.PronounceablePasswordGenerator.UppercaseConsonants" 
    value="B,C,D,F,G,H,J,K,L,M,N,P,Q,R,S,T,V,W,X,Y,Z" />
  <add key="CAM.PronounceablePasswordGenerator.SpecialConsonants" 
    value="$" />
 </appSettings>
 
</configuration>

You only need to copy the settings, that you need. For example if you don't want to generate pronouncable passwords, you don't need to register the "PronounceablePasswordGenerator" and don't need to copy it's settings "CAM.PronounceablePasswordGenerator.*".

After that, you need to reference the "CAM.PasswordGeneratorLibrary.dll" in your project.

Now you can use the Password Generator Library. In the other examples you find more information on how to generate passwords.

© Christoph A. Müller - Contact/Imprint - Privacy