https://github.com/labs64/swid-generator
Generate SoftWare IDentification (SWID) Tags according to ISO/IEC 19770-2:2015
https://github.com/labs64/swid-generator
Last synced: 10 months ago
JSON representation
Generate SoftWare IDentification (SWID) Tags according to ISO/IEC 19770-2:2015
- Host: GitHub
- URL: https://github.com/labs64/swid-generator
- Owner: Labs64
- License: apache-2.0
- Created: 2014-11-30T12:50:57.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2022-11-29T10:13:29.000Z (over 3 years ago)
- Last Synced: 2025-03-21T13:23:22.323Z (over 1 year ago)
- Language: Java
- Homepage: https://github.com/Labs64/swid-generator
- Size: 111 KB
- Stars: 17
- Watchers: 6
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# SoftWare IDentification (SWID) Tags Generator (Java Library)
[](https://travis-ci.org/Labs64/swid-generator)
[](https://maven-badges.herokuapp.com/maven-central/com.labs64.utils/swid-generator)
[](https://github.com/Labs64/swid-generator/blob/master/LICENSE)
Generate SoftWare IDentification (SWID) Tags according to [ISO/IEC 19770-2:2015](https://www.iso.org/standard/65666.html)
## What are SWID Tags?
SoftWare IDentification (SWID) Tags record unique information about an installed software application, including its name, edition, version, whether it’s part of a bundle and more. SWID tags support software inventory and asset management initiatives. The structure of SWID tags is specified in international standard [ISO/IEC 19770-2:2015](https://www.iso.org/standard/65666.html).
## Quick Start
The recommended way to get started using [`swid-generator`](https://maven-badges.herokuapp.com/maven-central/com.labs64.utils/swid-generator) in your project is by adding it as dependency in your build system:
Maven:
```xml
com.labs64.utils
swid-generator
x.y.z
```
Gradle:
```gradle
dependencies {
compile 'com.labs64.utils:swid-generator:x.y.z'
}
```
## Examples
To generate SoftWare IDentification (SWID) Tag ([gist](https://gist.github.com/henryean/df736f2e044c6222c3784edd02c1b91d)):
```java
// prepare SWID Tag processor
DefaultSwidProcessor processor = new DefaultSwidProcessor();
processor.setGenerator(new SequentialIdGenerator(0, 1, "e", null));
processor.setName("NetLicensing")
.setVersion("2.1.0")
.setVersionScheme(VersionScheme.UNKNOWN)
.setSupplemental(true)
.addEntity(new EntityBuilder().name("Labs64")
.role("softwareCreator")
.role("softwareLicensor")
.role("tagCreator")
.build())
.addLink(new LinkBuilder().rel("supplemental")
.href("swid:other-swid-tag")
.build())
.addMetaData(new SoftwareMetaBuilder().description("This is what it's about")
.entitlementDataRequired(true)
.revision("3")
.build())
.addEvidence(new EvidenceBuilder()
.deviceId("123-a")
.date(new Date())
.directoryOrFileOrProcess(new FileBuilder()
.name("File.xml")
.size(BigInteger.TEN)
.version("3")
.build())
.build())
.addPayload(new PayloadBuilder()
.directory(new DirectoryBuilder()
.root("/data")
.key(true)
.location("/folder")
.build())
.build());
// create builder and pass processor as build param
SwidBuilder builder = new SwidBuilder();
SoftwareIdentity swidTag = builder.build(processor);
// output resulting object
SwidWriter writer = new SwidWriter();
StringWriter out = new StringWriter();
writer.write(swidTag, out);
System.out.println(out);
```
...this generates the following SoftWare IDentification (SWID) Tag:
```xml
```
## Compatibility
This library requires J2SE 1.8 or newer. All dependencies handled by Maven.
## Links
- Spec: IT asset management — Part 2: Software Identification Tag: https://www.iso.org/standard/65666.html
- SoftWare IDentification (SWID) Tags Generator (Maven Plugin): https://github.com/Labs64/swid-maven-plugin
## Contributing
Fork the repository and make some changes. Once you're done with your changes send a pull request and check [CI validation status](https://travis-ci.org/Labs64/swid-generator).
Thanks!
### Contributors and Supporters
Thank you to all the [contributors](https://github.com/Labs64/swid-generator/graphs/contributors) on this project. Your help is much appreciated!
- [Labs64 NetLicensing](https://netlicensing.io) - Innovative *License Management* Solution
- [GuideChimp](https://github.com/Labs64/GuideChimp) - A simple, lightweight, clean and small library for creating guided product tours for your web app.
- [@henryean](https://github.com/henryean) - Upgrade library to the next specification version [ISO/IEC 19770-2:2015](https://www.iso.org/standard/65666.html)
## Bugs and Feedback
For bugs, questions and discussions please use the [GitHub Issues](https://github.com/Labs64/swid-generator/issues).
## License
This library is open-sourced software licensed under the [Apache License 2.0](LICENSE).