|
Post by burt0010 on Aug 16, 2007 14:34:36 GMT -5
The Rfc2898DeriveBytes class is set as PublicNotCreatable. How can I create a new instance to use?
Thanks!
--jason
|
|
|
Post by Kelly Ethridge on Aug 16, 2007 21:36:29 GMT -5
Hello,
Some classes are not directly creatable because they require constructor arguments, like their .Net counterparts. In order to create these classes you need to use the Cor.NewClassName method to create them. These are simply global functions with the same name as the class with the word New prepended, but require the argument necessary to create an instance of the class.
For the Rfc2898DerivedBytes class you would use:
Dim rfc As Rfc2898DeriveBytes Set rfc = Cor.NewRfc2898DeriveBytes("password", 64)
This will create a new instance using the supplied password and the size of the salt to be generated. The 'Cor.' is optional, but does provide with an intellisense list of constructor functions, such as the one you need. You should consult the documentation provided with VBCorLib or browse the online documentation if you have any troubles.
I hope this helps, Kelly
|
|
|
Post by burt0010 on Aug 16, 2007 22:37:07 GMT -5
Thanks! I saw the Initilize method, but I didn't know how to call it. I just found your library this week. It's amazing. Great job. I've got one more question but I'll post it in a separate thread.
--jason
|
|