Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
SWID Tag Generator (example 01)
// prepare SWID Tag processor
SwidProcessor processor = new DefaultSwidProcessor();
((DefaultSwidProcessor) processor).setEntitlementRequiredIndicator(true)
.setProductTitle("NetLicensing")
.setProductVersion("2.1.0", 2, 1, 0, 0)
.setSoftwareCreator("Labs64", "regid.2010-04.com.labs64")
.setSoftwareLicensor("Labs64", "regid.2010-04.com.labs64")
.setSoftwareId("NLIC", "regid.2010-04.com.labs64")
.setTagCreator("Labs64", "regid.2010-04.com.labs64");
// create builder and pass processor as build param
SwidBuilder builder = new SwidBuilder();
SoftwareIdentificationTagComplexType swidTag = builder.build(processor);
// output resulting object
SwidWriter writer = new SwidWriter();
StringWriter out = new StringWriter();
writer.write(swidTag, out);
System.out.println(out);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment