Encoding QR Code 2d Barcode In VB.NET
Using Barcode creation for .NET framework Control to generate, create QR image in VS .NET applications.www.OnBarcode.com
Scan Quick Response Code In Visual Basic .NET
Using Barcode scanner for .NET framework Control to read, scan read, scan image in .NET framework applications.www.OnBarcode.com
easy-to-use class unless you are building and distributing design-time controls. For the rest of us, it s make-it-up-as-you-go time. Fortunately, .NET has great support tools, so adding licensing support isn t too difficult.
Printing Code 39 Extended In Visual Basic .NET
Using Barcode drawer for VS .NET Control to generate, create Code 3/9 image in .NET applications.www.OnBarcode.com
Make Linear 1D Barcode In Visual Basic .NET
Using Barcode generation for VS .NET Control to generate, create 1D image in Visual Studio .NET applications.www.OnBarcode.com
PDF417 Generation In Visual Basic .NET
Using Barcode maker for VS .NET Control to generate, create PDF-417 2d barcode image in .NET applications.www.OnBarcode.com
Encoding Code 128B In VB.NET
Using Barcode printer for Visual Studio .NET Control to generate, create USS Code 128 image in Visual Studio .NET applications.www.OnBarcode.com
In this chapter s project code, we ll follow two of the four licensing steps discussed in the section The Library Licensing System, earlier in this chapter: generating the license file and using the license file. The design we created previously is good enough for our needs, although we still need to record it in the project s technical documentation. We won t formally install the license file until we create the setup program in 25.
Barcode Drawer In Visual Basic .NET
Using Barcode maker for .NET Control to generate, create Barcode image in VS .NET applications.www.OnBarcode.com
Code 93 Extended Maker In VB.NET
Using Barcode printer for .NET framework Control to generate, create Uniform Symbology Specification Code 93 image in Visual Studio .NET applications.www.OnBarcode.com
Update Technical Documentation
Draw Denso QR Bar Code In None
Using Barcode generator for Software Control to generate, create QR Code JIS X 0510 image in Software applications.www.OnBarcode.com
Printing QR Code In Objective-C
Using Barcode creation for iPhone Control to generate, create QR Code 2d barcode image in iPhone applications.www.OnBarcode.com
Since we ll be adding a new external file that will be processed by the Library Project, we need to document its structure in the project s Technical Resource Kit. Let s add the following new section to that document.
Barcode Generator In .NET
Using Barcode maker for Reporting Service Control to generate, create Barcode image in Reporting Service applications.www.OnBarcode.com
UPC - 13 Creator In None
Using Barcode generation for Word Control to generate, create EAN-13 Supplement 5 image in Microsoft Word applications.www.OnBarcode.com
Data Matrix ECC200 Drawer In None
Using Barcode maker for Online Control to generate, create Data Matrix image in Online applications.www.OnBarcode.com
Creating PDF 417 In Java
Using Barcode generator for Java Control to generate, create PDF-417 2d barcode image in Java applications.www.OnBarcode.com
The Library Project reads a customer-specific license file generated by the Library License Generation support application. That program generates a digitally signed XML license file that includes licensee information. Here is a sample of the license file content:
Decoding GTIN - 13 In .NET Framework
Using Barcode recognizer for .NET framework Control to read, scan read, scan image in Visual Studio .NET applications.www.OnBarcode.com
Print PDF-417 2d Barcode In None
Using Barcode generator for Online Control to generate, create PDF 417 image in Online applications.www.OnBarcode.com
< xml version="1.0" > <License> <Product>Library Project</Product> <LicenseDate>1/1/2000</LicenseDate> <ExpireDate>12/31/2999</ExpireDate> <CoveredVersion>1.*</CoveredVersion> <Licensee>John Q. Public</Licensee> <SerialNumber>LIB-123456789</SerialNumber> <Signature> Digital signature appears here (not shown) </Signature> </License>
Printing PDF 417 In Java
Using Barcode generation for BIRT Control to generate, create PDF 417 image in Eclipse BIRT applications.www.OnBarcode.com
GTIN - 12 Creation In Visual Studio .NET
Using Barcode generator for Reporting Service Control to generate, create UPC-A Supplement 2 image in Reporting Service applications.www.OnBarcode.com
The <LicenseDate> and <ExpireDate> tags indicate the first and last valid dates of the license. <Licensee> indicates the name of the license owner. <SerialNumber> includes the vendor-defined serial number associated with this license. The <CoveredVersion> tag contains data similar to the assembly version number included in .NET applications. It has up to four dot-delimited parts:
Code 128 Code Set A Creation In Objective-C
Using Barcode generator for iPhone Control to generate, create Code 128B image in iPhone applications.www.OnBarcode.com
Generating Code 128 In None
Using Barcode drawer for Office Word Control to generate, create Code-128 image in Word applications.www.OnBarcode.com
Each component can include a number from 0 to 9999, or the * character, which indicates all valid values for that position.
22: Licensing Your Application
The <Signature> section contains the generated digital signature. Its format is dependant on the XML Cryptography tools in .NET that generate this section. To ensure a proper digital signature, always use the Library License Generation support application to build license files. That support application generates a public and private key pair for use in digital signing. The public portion of this key (as an XML file) must be added as a resource named LicensePublicKey to the Library application. The private portion must be kept private. For consistency, the same key pair should be used throughout the lifetime of the Library Project s availability. We will also store the location of the license file as an application setting in the main program. We need to record that setting with the other application settings already added to the User Settings section of the Resource Kit.
The path to the Library License file on this workstation. If not supplied, the program will look for a file named LibraryLicense.lic in the same folder as the application.
Library License Helper Application
Generating license files and digital signatures by hand using Notepad would be...well, let s not even think about it. Instead, we ll depend on a custom application to create the files and signatures for us. I ve already developed that custom tool for you. You ll find it in the installation directory for this book s code, in the LibraryLicensing subdirectory. This support application includes two main forms. The first (KeyLocationForm.vb, shown in Figure 22-6) locates or creates the public-private key files used in the digital signature process.
Most of the form s code helps to locate and verify the folder that will contain the two key files (one private, one public). Some of the code in the ActGenerate_Click event handler creates the actual files.
Dim twoPartKey As RSA Dim publicFile As String Dim privateFile As String ...some code skipped here, then... ' ----- Generate the keys. twoPartKey = New RSACryptoServiceProvider twoPartKey = RSA.Create( ) ' ----- Save the public key. My.Computer.FileSystem.WriteAllText(publicFile, _ twoPartKey.ToXmlString(False), False) ' ----- Save the private key. My.Computer.FileSystem.WriteAllText(privateFile, _ twoPartKey.ToXmlString(True), False)
That s really simple! The System.Security.Cryptography.RSA class and the related RSACryptoServiceProvider class do all the work. All you have to do is call the RSA.Create method, and then generate the relevant XML keys using the ToXmlString method, passing an argument of False for the public key and True for the private key. If you want to look at some sample keys, open the LicenseFiles subdirectory in this book s source installation directory. You ll find two files, one for the public key and one for the private key. I d print one of them here, but it all just looks like random characters. The other support form is MainForm.vb, which generates the actual end-user license file, and appears in Figure 22-7.