diff --git a/settings.gradle b/settings.gradle index a8c2b213..30f5655b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -6,4 +6,5 @@ include 'TPM_Utils', 'HIRS_Structs', 'HIRS_AttestationCA', 'HIRS_AttestationCAPortal', - 'tpm_module' + 'tpm_module', + 'tools' diff --git a/tools/tcg_rim_tool/build.gradle b/tools/tcg_rim_tool/build.gradle new file mode 100644 index 00000000..b83bedbf --- /dev/null +++ b/tools/tcg_rim_tool/build.gradle @@ -0,0 +1,24 @@ +apply plugin: 'java' +version = '1.0' + +repositories { + mavenCentral() +} + +dependencies { + testCompile 'org.testng:testng:6.8.8' +} + +jar { + manifest { + attributes("Main-Class": "hirs.swid.Main") + } +} + +uploadArchives { + repositories { + flatDir { + dirs "${buildDir}" + } + } +} diff --git a/tools/tcg_rim_tool/gradle/wrapper/gradle-4.5.1-all.zip b/tools/tcg_rim_tool/gradle/wrapper/gradle-4.5.1-all.zip new file mode 100644 index 00000000..1f4e97f9 Binary files /dev/null and b/tools/tcg_rim_tool/gradle/wrapper/gradle-4.5.1-all.zip differ diff --git a/tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.jar b/tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 00000000..94114481 Binary files /dev/null and b/tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.jar differ diff --git a/tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.properties b/tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 00000000..52843533 --- /dev/null +++ b/tools/tcg_rim_tool/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Thu Sep 13 15:33:27 EDT 2018 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists +distributionUrl=gradle-4.5.1-all.zip diff --git a/tools/tcg_rim_tool/gradlew b/tools/tcg_rim_tool/gradlew new file mode 100755 index 00000000..9d82f789 --- /dev/null +++ b/tools/tcg_rim_tool/gradlew @@ -0,0 +1,160 @@ +#!/usr/bin/env bash + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS="" + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn ( ) { + echo "$*" +} + +die ( ) { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; +esac + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin, switch paths to Windows format before running java +if $cygwin ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=$((i+1)) + done + case $i in + (0) set -- ;; + (1) set -- "$args0" ;; + (2) set -- "$args0" "$args1" ;; + (3) set -- "$args0" "$args1" "$args2" ;; + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules +function splitJvmOpts() { + JVM_OPTS=("$@") +} +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" + +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/tools/tcg_rim_tool/gradlew.bat b/tools/tcg_rim_tool/gradlew.bat new file mode 100644 index 00000000..aec99730 --- /dev/null +++ b/tools/tcg_rim_tool/gradlew.bat @@ -0,0 +1,90 @@ +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS= + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto init + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto init + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:init +@rem Get command-line arguments, handling Windowz variants + +if not "%OS%" == "Windows_NT" goto win9xME_args +if "%@eval[2+2]" == "4" goto 4NT_args + +:win9xME_args +@rem Slurp the command line arguments. +set CMD_LINE_ARGS= +set _SKIP=2 + +:win9xME_args_slurp +if "x%~1" == "x" goto execute + +set CMD_LINE_ARGS=%* +goto execute + +:4NT_args +@rem Get arguments from the 4NT Shell from JP Software +set CMD_LINE_ARGS=%$ + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/tools/tcg_rim_tool/libs/sax2r2.jar b/tools/tcg_rim_tool/libs/sax2r2.jar new file mode 100644 index 00000000..bbaf3290 Binary files /dev/null and b/tools/tcg_rim_tool/libs/sax2r2.jar differ diff --git a/tools/tcg_rim_tool/package.sh b/tools/tcg_rim_tool/package.sh new file mode 100755 index 00000000..bca6e5f8 --- /dev/null +++ b/tools/tcg_rim_tool/package.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +# Enter package directory +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +pushd $SCRIPT_DIR + +name="tcg_rim_tool" + +tar -cf $name.tar build.gradle gradle* src/ docs/ +gzip $name.tar +if [ -d rpmbuild ]; then + rm -rf rpmbuild +fi +mkdir -p rpmbuild/BUILD rpmbuild/BUILDROOT rpmbuild/SOURCES rpmbuild/RPMS rpmbuild/SPECS rpmbuild/SRPMS +rpmbuild -bb $name.spec --define "_sourcedir $PWD" --define "_topdir $PWD/rpmbuild" + +popd diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java new file mode 100644 index 00000000..6c2e0d50 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/Main.java @@ -0,0 +1,44 @@ +package hirs.swid; + +import hirs.swid.utils.Commander; +import java.io.IOException; + +/* + * Command-line application for generating and validating SWID tags. + * Input arg: path to *.swidtag file + * + * If an argument is given it will be validated against the schema at http://standards.iso.org/iso/19770/-2/2015/schema.xsd + * If an argument is not given a SWID tag file will be generated. + */ +public class Main { + + public static void main(String[] args) { + Commander commander = new Commander(args); + + if (commander.hasArguments()) { + // we have arguments to work with + if (commander.create()) { + // parsing the arguments detected a create parameter (-c) + (new SwidTagGateway()).generateSwidTag(commander.getCreateInFile(), + commander.getCreateOutFile(), commander.getHashAlg()); + } else if (commander.validate()) { + // parsing the arguments detected a validation parameter (-v) + try { + (new SwidTagGateway()).validateSwidTag(commander.getValidateFile()); + } catch (IOException e) { + System.out.println("Unable to validate file: " + e.getMessage()); + } + } else if (commander.parse()) { + try { + (new SwidTagGateway()).parsePayload(commander.getParseFile()); + } catch (IOException e) { + System.out.println("Unable to parse file: " + e.getMessage()); + } + } + } else { + // development stage in which no valid arguments were given + // therefore generate a mock tag file + (new SwidTagGateway()).generateSwidTag(); + } + } +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagConstants.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagConstants.java new file mode 100644 index 00000000..35a61ecc --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagConstants.java @@ -0,0 +1,65 @@ +package hirs.swid; + +import javax.xml.XMLConstants; + +/** + * This class contains the String constants that are referenced by the gateway + * class. It is expected that member properties of this class will expand as + * more functionality is added to SwidTagGateway. + * + */ +public class SwidTagConstants { + + public static final String SCHEMA_STATEMENT = "ISO/IEC 19770-2:2015 Schema (XSD 1.0) " + + "- September 2015, see http://standards.iso.org/iso/19770/-2/2015/schema.xsd"; + public static final String SCHEMA_PACKAGE = "hirs.swid.xjc"; + public static final String SCHEMA_LANGUAGE = XMLConstants.W3C_XML_SCHEMA_NS_URI; + public static final String SCHEMA_URL = "swid_schema.xsd"; + + public static final String HIRS_SWIDTAG_HEADERS = "hirsSwidTagHeader.properties"; + public static final String EXAMPLE_PROPERTIES = "swidExample.properties"; + + public static final String SOFTWARE_IDENTITY_NAME = "softwareIdentity.name"; + public static final String SOFTWARE_IDENTITY_TAGID = "softwareIdentity.tagId"; + public static final String SOFTWARE_IDENTITY_VERSION = "softwareIdentity.version"; + public static final String SOFTWARE_IDENTITY_CORPUS = "softwareIdentity.corpus"; + public static final String SOFTWARE_IDENTITY_PATCH = "softwareIdentity.patch"; + public static final String SOFTWARE_IDENTITY_SUPPLEMENTAL = "softwareIdentity.supplemental"; + + public static final String ENTITY_NAME = "entity.name"; + public static final String ENTITY_REGID = "entity.regid"; + public static final String ENTITY_ROLE = "entity.role"; + public static final String ENTITY_THUMBPRINT = "entity.thumbprint"; + + public static final String LINK_HREF = "link.href"; + public static final String LINK_REL = "link.rel"; + + public static final String META_PCURILOCAL = "softwareMeta.pcUriLocal"; + public static final String META_BINDINGSPEC = "softwareMeta.bindingSpec"; + public static final String META_BINDINGSPECVERSION = "softwareMeta.bindingSpecVersion"; + public static final String META_PLATFORMMANUFACTURERID = "softwareMeta.platformManufacturerId"; + public static final String META_PLATFORMMANUFACTURERSTR = "softwareMeta.platformManufacturerStr"; + public static final String META_PLATFORMMODEL = "softwareMeta.platformModel"; + public static final String META_COMPONENTCLASS = "softwareMeta.componentClass"; + public static final String META_COMPONENTMANUFACTURER = "softwareMeta.componentManufacturer"; + public static final String META_COMPONENTMANUFACTURERID = "softwareMeta.componentManufacturerId"; + public static final String META_RIMLINKHASH = "softwareMeta.rimLinkHash"; + + public static final String PAYLOAD_ENVVARPREFIX = "n8060.envvarprefix"; + public static final String PAYLOAD_ENVVARSUFFIX = "n8060.envvarsuffix"; + public static final String PAYLOAD_PATHSEPARATOR = "n8060.pathseparator"; + + public static final String DIRECTORY_KEY = "directory.key"; + public static final String DIRECTORY_LOCATION = "directory.location"; + public static final String DIRECTORY_NAME = "directory.name"; + public static final String DIRECTORY_ROOT = "directory.root"; + public static final String FILE_KEY = "file.key"; + public static final String FILE_LOCATION = "file.location"; + public static final String FILE_NAME = "file.name"; + public static final String FILE_ROOT = "file.root"; + public static final String FILE_SIZE = "file.size"; + public static final String FILE_VERSION = "file.version"; + + public static final int PCR_NUMBER = 0; + public static final int PCR_VALUE = 1; +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java new file mode 100644 index 00000000..0f48178b --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/SwidTagGateway.java @@ -0,0 +1,602 @@ +package hirs.swid; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.JAXBException; +import javax.xml.bind.Marshaller; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.UnmarshalException; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.namespace.QName; + +import org.xml.sax.SAXException; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.ByteArrayInputStream; + +import java.math.BigInteger; + +import hirs.swid.utils.CsvParser; +import hirs.swid.utils.HashSwid; +import hirs.swid.xjc.CanonicalizationMethodType; +import hirs.swid.xjc.DigestMethodType; +import hirs.swid.xjc.Directory; +import hirs.swid.xjc.Entity; +import hirs.swid.xjc.Link; +import hirs.swid.xjc.ObjectFactory; +import hirs.swid.xjc.ResourceCollection; +import hirs.swid.xjc.ReferenceType; +import hirs.swid.xjc.SignatureType; +import hirs.swid.xjc.SignatureValueType; +import hirs.swid.xjc.SignatureMethodType; +import hirs.swid.xjc.SignedInfoType; +import hirs.swid.xjc.SoftwareIdentity; +import hirs.swid.xjc.SoftwareMeta; +import hirs.swid.xjc.TransformType; +import hirs.swid.xjc.TransformsType; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; + +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; + +/** + * This class provides interaction with the SWID Tag schema as defined in + * http://standards.iso.org/iso/19770/-2/2015/schema.xsd + * + */ +public class SwidTagGateway { + + private static final QName _DEFAULT_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SHA256", "ds"); + private static final QName _SHA1Value_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SHA1", "ds"); + private static final QName _SHA384Value_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SHA384", "ds"); + private static final QName _SHA512Value_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SHA512", "ds"); + private static final QName _SHA256_HASH = new QName( + "http://www.w3.org/2001/04/xmlenc#sha256", "hash", "SHA256"); + private static final QName _RIM_PCURILOCAL = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "pcURILocal", "rim"); + private static final QName _RIM_BINDINGSPEC = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "bindingSpec", "rim"); + private static final QName _RIM_BINDINGSPECVERSION = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "bindingSpecVersion", "rim"); + private static final QName _RIM_PLATFORMMANUFACTURERID = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "platformManufacturerId", "rim"); + private static final QName _RIM_PLATFORMMANUFACTURERSTR = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "platformManufacturerStr", "rim"); + private static final QName _RIM_PLATFORMMODEL = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "platformModel", "rim"); + private static final QName _RIM_COMPONENTCLASS = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "componentClass", "rim"); + private static final QName _RIM_COMPONENTMANUFACTURER = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "componentManufacturer", "rim"); + private static final QName _RIM_COMPONENTMANUFACTURERID = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "componentManufacturerId", "rim"); + private static final QName _RIM_RIMLINKHASH = new QName( + "https://trustedcomputinggroup.org/wp-content/uploads/TCG_RIM_Model", + "rimLinkHash", "rim"); + private static final QName _N8060_ENVVARPREFIX = new QName( + "http://csrc.nist.gov/ns/swid/2015-extensions/1.0", + "envVarPrefix", "n8060"); + private static final QName _N8060_ENVVARSUFFIX = new QName( + "http://csrc.nist.gov/ns/swid/2015-extensions/1.0", + "envVarSuffix", "n8060"); + private static final QName _N8060_PATHSEPARATOR = new QName( + "http://csrc.nist.gov/ns/swid/2015-extensions/1.0", + "pathSeparator", "n8060"); + + private final ObjectFactory objectFactory = new ObjectFactory(); + private final File generatedFile = new File("generated_swidTag.swidtag"); + private QName hashValue = null; + + private static final String ENTITY = "Entity"; + private static final String PAYLOAD = "Payload"; + + /** + * default generator method that has no parameters + */ + public void generateSwidTag() { + generateSwidTag(generatedFile); + } + + /** + * This generator method is used by the create method. + * + * This method should be updated to incorporate the RIM fields that are implemented + * in generateSwidTag(final File outputFile) below. + * + * @param inputFile - the file in csv format that is used as data + * @param outputFile - output specific to the given file + * @param hashType - the optional labeling of the hash type + */ + public void generateSwidTag(final String inputFile, + final String outputFile, final String hashType) { + // create file instances + File input = new File(inputFile); + File output = new File(outputFile); + List tempList = new LinkedList<>(); + + // I need to go over this again about which needs to be checked. + if (input.exists()) { + // parse the csv file + CsvParser parser = new CsvParser(input); + for (String line : parser.getContent()) { + tempList.add(line); + } + + if (hashType.contains("256")) { + hashValue = _DEFAULT_QNAME; + } else if (hashType.contains("384")) { + hashValue = _SHA384Value_QNAME; + } else if (hashType.contains("512")) { + hashValue = _SHA512Value_QNAME; + } else if (hashType.contains("1")) { + hashValue = _SHA1Value_QNAME; + } else { + hashValue = _DEFAULT_QNAME; + } + + // generate a swid tag + Properties properties = new Properties(); + InputStream is = null; + try { + is = SwidTagGateway.class.getClassLoader().getResourceAsStream(SwidTagConstants.HIRS_SWIDTAG_HEADERS); + properties.load(is); + + SoftwareIdentity swidTag = createSwidTag(properties); + + JAXBElement entity = objectFactory.createSoftwareIdentityEntity(createEntity(properties)); + swidTag.getEntityOrEvidenceOrLink().add(entity); + + // we should have resources, there for we need a collection + JAXBElement resources = objectFactory.createSoftwareIdentityPayload(createPayload(tempList, hashValue)); + swidTag.getEntityOrEvidenceOrLink().add(resources); + + JAXBElement jaxbe = objectFactory.createSoftwareIdentity(swidTag); + writeSwidTagFile(jaxbe, output); + } catch (IOException e) { + System.out.println("Error reading properties file: "); + e.printStackTrace(); + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + } + + /** + * This method generates a primary SWID tag from the values in + * resources/swidExamples.properties. + * + * @param outputFile + */ + public void generateSwidTag(final File outputFile) { + Properties properties = new Properties(); + InputStream is = null; + try { + is = SwidTagGateway.class.getClassLoader().getResourceAsStream(SwidTagConstants.EXAMPLE_PROPERTIES); + properties.load(is); + + SoftwareIdentity swidTag = createSwidTag(properties); + + JAXBElement entity = objectFactory.createSoftwareIdentityEntity(createEntity(properties)); + swidTag.getEntityOrEvidenceOrLink().add(entity); + + JAXBElement link = objectFactory.createSoftwareIdentityLink(createLink(properties)); + swidTag.getEntityOrEvidenceOrLink().add(link); + + JAXBElement meta = objectFactory.createSoftwareIdentityMeta(createSoftwareMeta(properties)); + swidTag.getEntityOrEvidenceOrLink().add(meta); + + ResourceCollection payload = createPayload(properties); + Directory directory = createDirectory(properties); + hirs.swid.xjc.File file1 = createFile("Example.com.iotBase.bin", "01.00", "15400"); + hirs.swid.xjc.File file2 = createFile("iotExec.bin", "01.00", "1024"); + directory.getDirectoryOrFile().add(file1); + directory.getDirectoryOrFile().add(file2); + payload.getDirectoryOrFileOrProcess().add(directory); + JAXBElement jaxbPayload = objectFactory.createSoftwareIdentityPayload(payload); + swidTag.getEntityOrEvidenceOrLink().add(jaxbPayload); + +// JAXBElement swidtagSignature = objectFactory.createSignature(createSignature()); +// swidTag.getEntityOrEvidenceOrLink().add(swidtagSignature); + + JAXBElement jaxbe = objectFactory.createSoftwareIdentity(swidTag); + writeSwidTagFile(jaxbe, outputFile); + } catch (IOException e) { + System.out.println("Error reading properties file: "); + e.printStackTrace(); + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException ex) { + // ignore + } + } + } + } + + /** + * This method validates the .swidtag file at the given filepath against the + * schema. A successful validation results in the output of the tag's name + * and tagId attributes, otherwise a generic error message is printed. + * + * @param path the location of the file to be validated + */ + public boolean validateSwidTag(String path) throws IOException { + JAXBElement jaxbe = unmarshallSwidTag(path); + SoftwareIdentity swidTag = (SoftwareIdentity) jaxbe.getValue(); + String output = String.format("name: %s;\ntagId: %s\n%s", + swidTag.getName(), swidTag.getTagId(), + SwidTagConstants.SCHEMA_STATEMENT); + System.out.println("SWID Tag found: "); + System.out.println(output); + return true; + } + + /** + * This method calls the marshal() method that writes the swidtag data to the output file. + * + * @param jaxbe + * @param outputFile + */ + public void writeSwidTagFile(JAXBElement jaxbe, File outputFile) { + JAXBContext jaxbContext; + try { + jaxbContext = JAXBContext.newInstance(SwidTagConstants.SCHEMA_PACKAGE); + Marshaller marshaller = jaxbContext.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); + marshaller.marshal(jaxbe, outputFile); + } catch (JAXBException e) { + System.out.println("Error generating xml: "); + e.printStackTrace(); + } + } + + /** + * Given an input swidtag at [path] parse any PCRs in the payload into an InputStream object. + * This method will be used in a following pull request. + * + * @param path + * @return + * @throws IOException + */ + public ByteArrayInputStream parsePayload(String path) throws IOException { + JAXBElement jaxbe = unmarshallSwidTag(path); + SoftwareIdentity softwareIdentity = (SoftwareIdentity) jaxbe.getValue(); + String pcrs = ""; + if (!softwareIdentity.getEntityOrEvidenceOrLink().isEmpty()) { + List swidtag = softwareIdentity.getEntityOrEvidenceOrLink(); + for (Object obj : swidtag) { + try { + JAXBElement element = (JAXBElement) obj; + String elementName = element.getName().getLocalPart(); + if (elementName.equals(PAYLOAD)) { + ResourceCollection rc = (ResourceCollection) element.getValue(); + if (!rc.getDirectoryOrFileOrProcess().isEmpty()) { + pcrs = parsePCRs(rc.getDirectoryOrFileOrProcess()); + } + } + } catch (ClassCastException e) { + System.out.println("Found a non-JAXBElement object!" + e.getMessage()); + throw new IOException("Found an invalid element in the swidtag file!"); + } + } + } + return new ByteArrayInputStream(pcrs.getBytes(StandardCharsets.UTF_8)); + } + + /** + * This method creates SoftwareIdentity element based on the parameters read in from + * a properties file. + * + * @param properties the Properties object containing parameters from file + * @return SoftwareIdentity object created from the properties + */ + private SoftwareIdentity createSwidTag(Properties properties) { + SoftwareIdentity swidTag = objectFactory.createSoftwareIdentity(); + swidTag.setName(properties.getProperty(SwidTagConstants.SOFTWARE_IDENTITY_NAME)); + swidTag.setTagId(properties.getProperty(SwidTagConstants.SOFTWARE_IDENTITY_TAGID)); + swidTag.setVersion(properties.getProperty(SwidTagConstants.SOFTWARE_IDENTITY_VERSION)); + swidTag.setCorpus(Boolean.parseBoolean(properties.getProperty(SwidTagConstants.SOFTWARE_IDENTITY_CORPUS))); + swidTag.setPatch(Boolean.parseBoolean(properties.getProperty(SwidTagConstants.SOFTWARE_IDENTITY_PATCH))); + swidTag.setSupplemental(Boolean.parseBoolean(properties.getProperty(SwidTagConstants.SOFTWARE_IDENTITY_SUPPLEMENTAL))); + + return swidTag; + } + + /** + * This method creates an Entity object based on the parameters read in from + * a properties file. + * + * @param properties the Properties object containing parameters from file + * @return Entity object created from the properties + */ + private Entity createEntity(Properties properties) { + Entity entity = objectFactory.createEntity(); + entity.setName(properties.getProperty(SwidTagConstants.ENTITY_NAME)); + entity.setRegid(properties.getProperty(SwidTagConstants.ENTITY_REGID)); + String[] roles = properties.getProperty(SwidTagConstants.ENTITY_ROLE).split(","); + for (int i = 0; i < roles.length; i++) { + entity.getRole().add(roles[i]); + } + entity.setThumbprint(properties.getProperty(SwidTagConstants.ENTITY_THUMBPRINT)); + + return entity; + } + + /** + * Thsi method creates a Link element based on the parameters read in from a properties + * file. + * @param properties the Properties object containing parameters from file + * @return Link element created from the properties + */ + private Link createLink(Properties properties) { + Link link = objectFactory.createLink(); + link.setHref(properties.getProperty(SwidTagConstants.LINK_HREF)); + link.setRel(properties.getProperty(SwidTagConstants.LINK_REL)); + + return link; + } + + /** + * This method creates a Meta element based on the parameters read in from a properties + * file. + * @param properties the Properties object containing parameters from file + * @return the Meta element created from the properties + */ + private SoftwareMeta createSoftwareMeta(Properties properties) { + SoftwareMeta softwareMeta = objectFactory.createSoftwareMeta(); + Map attributes = softwareMeta.getOtherAttributes(); + attributes.put(_RIM_PCURILOCAL, properties.getProperty(SwidTagConstants.META_PCURILOCAL)); + attributes.put(_RIM_BINDINGSPEC, properties.getProperty(SwidTagConstants.META_BINDINGSPEC)); + attributes.put(_RIM_BINDINGSPECVERSION, properties.getProperty(SwidTagConstants.META_BINDINGSPECVERSION)); + attributes.put(_RIM_PLATFORMMANUFACTURERID, properties.getProperty(SwidTagConstants.META_PLATFORMMANUFACTURERID)); + attributes.put(_RIM_PLATFORMMANUFACTURERSTR, properties.getProperty(SwidTagConstants.META_PLATFORMMANUFACTURERSTR)); + attributes.put(_RIM_PLATFORMMODEL, properties.getProperty(SwidTagConstants.META_PLATFORMMODEL)); + attributes.put(_RIM_COMPONENTCLASS, properties.getProperty(SwidTagConstants.META_COMPONENTCLASS)); + attributes.put(_RIM_COMPONENTMANUFACTURER, properties.getProperty(SwidTagConstants.META_COMPONENTMANUFACTURER)); + attributes.put(_RIM_COMPONENTMANUFACTURERID, properties.getProperty(SwidTagConstants.META_COMPONENTMANUFACTURERID)); + attributes.put(_RIM_RIMLINKHASH, properties.getProperty(SwidTagConstants.META_RIMLINKHASH)); + + return softwareMeta; + } + + /** + * This method creates a Directory from the parameters read in from a properties file. + * + * @param properties the Properties object containing parameters from file + * @return Directory object created from the properties + */ + private Directory createDirectory(Properties properties) { + Directory directory = objectFactory.createDirectory(); + directory.setLocation(properties.getProperty(SwidTagConstants.DIRECTORY_LOCATION)); + directory.setName(properties.getProperty(SwidTagConstants.DIRECTORY_NAME)); + String directoryRoot = properties.getProperty(SwidTagConstants.DIRECTORY_ROOT); + if (!directoryRoot.isEmpty()) { + directory.setRoot(directoryRoot); + } + + return directory; + } + + /** + * This method creates a hirs.swid.xjc.File from a java.nio.File object. + * This method signature is not currently used and may be removed later. + * + * @param file + * @return hirs.swid.xjc.File object from File object + */ + private hirs.swid.xjc.File createFile(File file) { + return createFile(file.getName(), "01.00", Long.toString(file.length())); + } + + /** + * This method creates a hirs.swid.xjc.File from three arguments, then calculates + * and stores its hash as an attribute in itself. + * + * @param filename + * @param location + * @return hirs.swid.xjc.File object from File object + */ + private hirs.swid.xjc.File createFile(String filename, String version, String size) { + hirs.swid.xjc.File file = objectFactory.createFile(); + file.setName(filename); + file.setVersion(version); + file.setSize(new BigInteger(size)); + String hash = HashSwid.get256Hash(file.getName()); + file.getOtherAttributes().put(_SHA256_HASH, hash); + + return file; + } + + /** + * This method creates a Payload from the parameters read in from a properties file. + * + * @param properties the Properties object containing parameters from file + * @return the Payload object created + */ + private ResourceCollection createPayload(Properties properties) { + ResourceCollection rc = objectFactory.createResourceCollection(); + + rc.getOtherAttributes().put(_N8060_ENVVARPREFIX, properties.getProperty(SwidTagConstants.PAYLOAD_ENVVARPREFIX)); + rc.getOtherAttributes().put(_N8060_ENVVARSUFFIX, properties.getProperty(SwidTagConstants.PAYLOAD_ENVVARSUFFIX)); + rc.getOtherAttributes().put(_N8060_PATHSEPARATOR, properties.getProperty(SwidTagConstants.PAYLOAD_PATHSEPARATOR)); + + return rc; + } + + /** + * This method creates a Payload from a list of Strings and a hash algorithm. + * The Strings in the list are expected to be in the form of "[PCR_NUMBER],[PCR_VALUE]" + * and the hash algorithm is attached as the file's xml namespace identifier. + * + * @param populate + * @return + */ + private ResourceCollection createPayload(List populate, QName hashStr) { + ResourceCollection rc = objectFactory.createResourceCollection(); + hirs.swid.xjc.File xjcFile = null; + String[] tempArray = null; + + for (String item : populate) { + xjcFile = objectFactory.createFile(); + + tempArray = item.split(","); + + xjcFile.setName(tempArray[SwidTagConstants.PCR_NUMBER]); + xjcFile.getOtherAttributes().put(hashStr, tempArray[SwidTagConstants.PCR_VALUE]); + rc.getDirectoryOrFileOrProcess().add(xjcFile); + } + + return rc; + } + + /** + * This method creates an xml signature based on the xmldsig schema. + * This method is incomplete and not yet implemented. + * + * @return the Signature object created + */ + private SignatureType createSignature() { + SignatureType signature = objectFactory.createSignatureType(); + SignedInfoType signedInfo = objectFactory.createSignedInfoType(); + + CanonicalizationMethodType canonicalizationMethod = objectFactory.createCanonicalizationMethodType(); + canonicalizationMethod.setAlgorithm("http://www.w3.org/TR/2001/REC-xml-c14n-20010315"); + + SignatureMethodType signatureMethod = objectFactory.createSignatureMethodType(); + signatureMethod.setAlgorithm("http://www.w3.org/2000/09/xmldsig#rsa-sha512"); + + ReferenceType reference = objectFactory.createReferenceType(); + TransformsType transforms = objectFactory.createTransformsType(); + + TransformType transform = objectFactory.createTransformType(); + transform.setAlgorithm("http://www.w3.org/2000/09/xmldsig#enveloped-signature"); + transforms.getTransform().add(transform); + + DigestMethodType digestMethod = objectFactory.createDigestMethodType(); + digestMethod.setAlgorithm("http://www.w3.org/2000/09/xmldsig#sha256"); + + reference.setTransforms(transforms); + reference.setDigestMethod(digestMethod); + reference.setDigestValue(new byte[10]); + + signedInfo.setCanonicalizationMethod(canonicalizationMethod); + signedInfo.setSignatureMethod(signatureMethod); + signedInfo.getReference().add(reference); + + SignatureValueType signatureValue = objectFactory.createSignatureValueType(); + signatureValue.setValue(new byte[10]); + + signature.setSignedInfo(signedInfo); + + return signature; + } + + /** + * This method traverses a hirs.swid.xjc.Directory recursively until it finds at + * least one hirs.swid.xjc.File. This File is expected to have an attribute of the form + * "[hash algorithm]=[hash value]." + * + * @param list of swidtag elements + * @return the hash value(s) parsed from the File object(s) + */ + private String parsePCRs(List list) { + final String newline = System.lineSeparator(); + StringBuilder sb = new StringBuilder(); + for (Object listItem : list) { + if (listItem instanceof Directory) { + Directory dir = (Directory) listItem; + if (!dir.getDirectoryOrFile().isEmpty()) { + parsePCRs(dir.getDirectoryOrFile()); + } + } else if (listItem instanceof hirs.swid.xjc.File){ + hirs.swid.xjc.File pcr = (hirs.swid.xjc.File) listItem; + String pcrHash = ""; + if (!pcr.getOtherAttributes().isEmpty()) { + Object[] fileAttributes = pcr.getOtherAttributes().values().toArray(); + pcrHash = (String) fileAttributes[0]; + } + if (pcrHash.isEmpty()) { + pcrHash = "null"; + } + sb.append(pcr.getName() + "," + pcrHash + newline); + } + } + System.out.println(sb.toString()); + return sb.toString(); + } + + /** + * This method unmarshalls the swidtag found at [path] and validates it according to the + * schema. + * + * @param path to the input swidtag + * @return the SoftwareIdentity element at the root of the swidtag + * @throws IOException if the swidtag cannot be unmarshalled or validated + */ + private JAXBElement unmarshallSwidTag(String path) throws IOException { + File input = null; + InputStream is = null; + JAXBElement jaxbe = null; + try { + input = new File(path); + is = SwidTagGateway.class.getClassLoader().getResourceAsStream(SwidTagConstants.SCHEMA_URL); + SchemaFactory schemaFactory = SchemaFactory.newInstance(SwidTagConstants.SCHEMA_LANGUAGE); + Schema schema = schemaFactory.newSchema(new StreamSource(is)); + JAXBContext jaxbContext = JAXBContext.newInstance(SwidTagConstants.SCHEMA_PACKAGE); + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + unmarshaller.setSchema(schema); + jaxbe = (JAXBElement) unmarshaller.unmarshal(input); + } catch (SAXException e) { + System.out.println("Error setting schema for validation!"); + } catch (UnmarshalException e) { + System.out.println("Error validating swidtag file!"); + } catch (IllegalArgumentException e) { + System.out.println("Input file empty."); + } catch (JAXBException e) { + e.printStackTrace(); + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException e) { + System.out.println("Error closing input stream"); + } + } + if (jaxbe != null) { + return jaxbe; + } else { + throw new IOException("Invalid swidtag file!"); + } + } + } +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/Commander.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/Commander.java new file mode 100644 index 00000000..3a5fc006 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/Commander.java @@ -0,0 +1,274 @@ +package hirs.swid.utils; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.InvalidPathException; +import java.nio.file.Paths; + +/** + * Commander is a class that handles the command line arguments for the SWID + * Tags gateway. + */ +public class Commander { + + private static final String COMMAND_PREFIX = "-"; + private static final String FULL_COMMAND_PREFIX = "--"; + private static final String CREATE_STRING = "create"; + private static final String VERIFY_STRING = "verify"; + private static final String HELP_STRING = "help"; + private static final String EXAMPLE_STRING = "example"; + private static final String PARSE_STRING = "parse"; + private static final String IN_STRING = "in"; + private static final String OUT_STRING = "out"; + private static final String HASH_STRING = "hash"; + + private boolean hasArguments = false; + private boolean validate = false; + private boolean create = false; + private boolean parse = false; + + private String validateFile; + private String createInFile; + private String createOutFile; + private String parseFile; + private String hashAlg = null; + + /** + * The main constructor for the Commander class + * + * @param args + */ + public Commander(final String[] args) { + hasArguments = args.length > 0; + + if (hasArguments) { + parseArguments(args); + } else { + //printHelp(); + } + + if (create) { + if (!Files.exists(Paths.get(getCreateInFile()))) { + create = false; + printHelp("Input file doesn't exist..."); + } + + if (hashAlg == null) { + hashAlg = "256"; + } + + if (!isValidPath(getCreateOutFile())) { + printHelp(String.format("Invalid file path on creation file...(%s)", + getCreateOutFile())); + } + } + + if (validate && create) { + // there maybe a time in which you could validate what you created + // but not right now + // print the help information + printHelp(); + } + } + + /** + * The default blank constructor + */ + public Commander() { + + } + + /** + * This method is called if an empty Commander was created, and later gets + * args. Will be used by the main constructor. + * + * @param args + */ + public final void parseArguments(final String[] args) { + String tempValue; + + for (int i = 0; i < args.length; i++) { + tempValue = args[i]; + + switch (tempValue) { + case FULL_COMMAND_PREFIX + CREATE_STRING: + case COMMAND_PREFIX + "c": + create = true; + break; + case COMMAND_PREFIX + IN_STRING: + if (create) { + createInFile = args[++i]; + } + break; + case COMMAND_PREFIX + OUT_STRING: + if (create) { + createOutFile = args[++i]; + } + break; + case FULL_COMMAND_PREFIX + VERIFY_STRING: + case COMMAND_PREFIX + "v": + validate = true; + validateFile = args[++i]; + break; + case FULL_COMMAND_PREFIX + EXAMPLE_STRING: + case COMMAND_PREFIX + "e": + hasArguments = false; + return; // default is generate + case COMMAND_PREFIX + HASH_STRING: + hashAlg = args[++i]; + break; + case FULL_COMMAND_PREFIX + PARSE_STRING: + case COMMAND_PREFIX + "p": + parse = true; + parseFile = args[++i]; + break; + case FULL_COMMAND_PREFIX + HELP_STRING: + case COMMAND_PREFIX + "h": + default: + if (Files.exists(Paths.get(args[i]))) { + validate = true; + validateFile = args[i]; + break; + } + + printHelp(); + } + } + } + + /** + * Getter for the input validate file associated with the validate flag + * + * @return + */ + public final String getValidateFile() { + return validateFile; + } + + /** + * Getter for the input create file associated with the create flag + * + * @return + */ + public final String getCreateInFile() { + return createInFile; + } + + /** + * Getter for the output file for the create flag + * + * @return + */ + public final String getCreateOutFile() { + return createOutFile; + } + + /** + * Getter for the property that indicates if something was given at the + * commandline. + * + * @return + */ + public final boolean hasArguments() { + return hasArguments; + } + + /** + * Getter for the validate command flag. + * + * @return + */ + public final boolean validate() { + return validate; + } + + /** + * Getter for the create command flag. + * + * @return + */ + public final boolean create() { + return create; + } + + /** + * Getter for the hash algorithm to be used for hash functions. + * + * @return + */ + public final String getHashAlg() { + return hashAlg; + } + + /** + * Getter for the parse command flag + * + * @return + */ + public final boolean parse() { + return parse; + } + + /** + * Getter for the file to be parsed by the parse command flag + * + * @return + */ + public final String getParseFile() { + return parseFile; + } + + /** + * Default no parameter help method. + */ + private void printHelp() { + printHelp(null); + } + + /** + * This method is used to inform the user of the allowed functionality of + * the program. + */ + private void printHelp(String message) { + StringBuilder sb = new StringBuilder(); + + if (message != null && !message.isEmpty()) { + sb.append(String.format("ERROR: %s\n\n", message)); + } + sb.append("Usage: HIRS_SwidTag\n"); + sb.append(" -c, --create \tTakes given input in the csv format\n" + + " \t-in \tand produces swidtag payloads.\n" + + " \t-out \tThe -hash argument is optional.\n" + + " \t-hash \n"); + sb.append(" -v, --verify\t\tTakes the provided input file and\n" + + " \t\t\tvalidates it against the schema at\n" + + " \t\t\thttp://standards.iso.org/iso/19770/-2/2015/schema.xsd\n"); + sb.append(" -e, --example\tCreate example swid tag file (generated_swidTag.swidtag)\n"); + sb.append(" -h, --help\t\tPrints the command help information\n"); + sb.append(" \t\tListing no command with no argument will\n" + + " \t\t\tcreate an example tag file\n"); + sb.append(" \t\tValidate the given file argument\n"); + sb.append(" -p, --parse\t\tParse a swidtag's payload\n" + + " \t\tInput swidtag"); + + System.out.println(sb.toString()); + System.exit(1); + } + + /** + * Checks that the file given to create a new swidtag is a valid path. + * @param filepath + * @return + */ + public static boolean isValidPath(String filepath) { + try { + System.out.println("Checking for a valid creation path..."); + File file = new File(filepath); + file.createNewFile(); + } catch (IOException | InvalidPathException | NullPointerException ex) { + return false; + } + return true; + } +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/CsvParser.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/CsvParser.java new file mode 100644 index 00000000..dab404d0 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/CsvParser.java @@ -0,0 +1,136 @@ +package hirs.swid.utils; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +/** + * + */ +public class CsvParser { + + private static final char DEFAULT_SEPARATOR = ','; + private static final char DEFAULT_QUOTE = '"'; + + private List content; + + public CsvParser(final File file) { + this(file.getAbsolutePath()); + } + + public CsvParser(final String csvfile) { + content = readerCsv(csvfile); + } + + /** + * This method takes an existing csv file and reads the file by line and + * adds the contents to a list of Strings. + * + * @param file valid path to a csv file + * @return + */ + private List readerCsv(final String file) { + String line = ""; + String csvSplitBy = ","; + List tempList = new LinkedList<>(); + + try (BufferedReader br = new BufferedReader(new FileReader(file))) { + while ((line = br.readLine()) != null) { + if (line.length() > 0 + && line.contains(csvSplitBy)) { + tempList.add(line); + } + } + } catch (IOException ioEx) { + System.out.println(String.format("Error reading in CSV file...(%s)", file)); + System.exit(1); + } + + return tempList; + } + + public final List getContent() { + return Collections.unmodifiableList(content); + } + + public static List parseLine(String csvLine) { + return parseLine(csvLine, DEFAULT_SEPARATOR, DEFAULT_QUOTE); + } + + public static List parseLine(String csvLine, char separators) { + return parseLine(csvLine, separators, DEFAULT_QUOTE); + } + + public static List parseLine(String csvLine, char separators, char customQuote) { + List result = new ArrayList<>(); + + if (csvLine == null || csvLine.isEmpty()) { + return result; + } + + if (customQuote == ' ') { + customQuote = DEFAULT_QUOTE; + } + + if (separators == ' ') { + separators = DEFAULT_SEPARATOR; + } + + StringBuilder currVal = new StringBuilder(); + boolean inQuotes = false; + boolean startCollectChar = false; + boolean dbleQuotesInCol = false; + + char[] chars = csvLine.toCharArray(); + + for (char ch : chars) { + if (inQuotes) { + startCollectChar = true; + if (ch == customQuote) { + inQuotes = false; + dbleQuotesInCol = false; + } else { + if (ch == '\"') { + if (!dbleQuotesInCol) { + currVal.append(ch); + dbleQuotesInCol = true; + } + } else { + currVal.append(ch); + } + } + } else { + if (ch == customQuote) { + inQuotes = true; + + if (chars[0] != '"' && customQuote == '\"') { + currVal.append('"'); + } + + if (startCollectChar) { + currVal.append('"'); + } + } else if (ch == separators) { + result.add(currVal.toString()); + currVal = new StringBuilder(); + startCollectChar = false; + } else if (ch == '\r') { + continue; + } else if (ch == '\n') { + break; + } else { + currVal.append(ch); + } + } + } + + result.add(currVal.toString()); + + return result; + } +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/HashSwid.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/HashSwid.java new file mode 100644 index 00000000..6d9ae8d7 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/utils/HashSwid.java @@ -0,0 +1,117 @@ +package hirs.swid.utils; + +import java.io.BufferedInputStream; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Base64; + +/** + * This class is a helper for creating hash values for the files associated + * with the swidtag program + */ +public class HashSwid { + + public static final String ENCODING = "UTF-8"; + public static final String SHA256 = "SHA-256"; + public static final String SHA384 = "SHA-384"; + public static final String SHA512 = "SHA-512"; + + /** + * Getter method for the hash that uses 256 bit hash + * @param value + * @return + */ + public static String get256Hash(String value) { + return getHashValue(value, SHA256); + } + + /** + * Getter method for the hash that uses 384 bit hash + * @param value + * @return + */ + public String get384Hash(String value) { + return getHashValue(value, SHA384); + } + + /** + * Getter method for the hash that uses 512 bit hash + * @param value + * @return + */ + public String get512Hash(String value) { + return getHashValue(value, SHA512); + } + + /** + * This method creates the hash based on the provided algorithm and salt + * only accessible through helper methods. + * + * @param value string object to hash + * @param salt random value to make the hash stronger + * @param sha the algorithm to use for the hash + * @return + */ + private static String getHashValue(String value, String sha) { + String resultString = null; + try { + MessageDigest md = MessageDigest.getInstance(sha); + byte[] bytes = md.digest(value.getBytes(ENCODING)); + StringBuilder sb = new StringBuilder(); + + for (int i = 0; i < bytes.length; i++) { + sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1)); + } + resultString = sb.toString(); + } catch (UnsupportedEncodingException | NoSuchAlgorithmException grex) { + System.out.println(grex.getMessage()); + } + + return resultString; + } + + /** + * This method is a public access hash function that operates on a string + * value and uses default assumptions on the salt and algorithm + * @param value string object to hash + * @return + */ + public static String getHashValue(String value) { + byte[] buffer = new byte[8192]; + int count; + byte[] hash = null; + BufferedInputStream bis = null; + + try { + MessageDigest md = MessageDigest.getInstance(SHA256); + bis = new BufferedInputStream(new FileInputStream(value)); + while ((count = bis.read(buffer)) > 0) { + md.update(buffer, 0, count); + } + + hash = md.digest(); + } catch (UnsupportedEncodingException | NoSuchAlgorithmException grex) { + System.out.println(grex.getMessage()); + } catch (IOException ioEx) { + System.out.println(String.format("%s: \n%s is not valid...", + ioEx.getMessage(), value)); + } finally { + try { + if (bis != null) { + bis.close(); + } + } catch (IOException ioEx) { + // ignored, system issue that won't affect further execution + } + + if (hash == null) { + return ""; + } + } + + return Base64.getEncoder().encodeToString(hash); + } +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/BaseElement.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/BaseElement.java new file mode 100644 index 00000000..2053fdc4 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/BaseElement.java @@ -0,0 +1,97 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyAttribute; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; +import javax.xml.namespace.QName; + +/** + * + * Attributes common to all Elements in this schema + * + * + *

+ * Java class for BaseElement complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="BaseElement">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "BaseElement", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +@XmlSeeAlso({ SoftwareIdentity.class, Entity.class, Link.class, Meta.class, + ResourceCollection.class }) +public class BaseElement { + + @XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace") + protected String lang; + @XmlAnyAttribute + private Map otherAttributes = new HashMap(); + + /** + * + * Allow xml:lang attribute on any element. + * + * + * @return possible object is {@link String } + * + */ + public String getLang() { + return lang; + } + + /** + * Sets the value of the lang property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setLang(String value) { + this.lang = value; + } + + /** + * Gets a map that contains attributes that aren't bound to any typed + * property on this class. + * + *

+ * the map is keyed by the name of the attribute and the value is the string + * value of the attribute. + * + * the map returned by this method is live, and you can add new attribute by + * updating the map directly. Because of this design, there's no setter. + * + * + * @return always non-null + */ + public Map getOtherAttributes() { + return otherAttributes; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/CanonicalizationMethodType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/CanonicalizationMethodType.java new file mode 100644 index 00000000..fa716d61 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/CanonicalizationMethodType.java @@ -0,0 +1,105 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for CanonicalizationMethodType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="CanonicalizationMethodType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "CanonicalizationMethodType", propOrder = { "content" }) +public class CanonicalizationMethodType { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "Algorithm", required = true) + @XmlSchemaType(name = "anyURI") + protected String algorithm; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Object } + * {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the algorithm property. + * + * @return possible object is {@link String } + * + */ + public String getAlgorithm() { + return algorithm; + } + + /** + * Sets the value of the algorithm property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setAlgorithm(String value) { + this.algorithm = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/DSAKeyValueType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/DSAKeyValueType.java new file mode 100644 index 00000000..ab58022a --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/DSAKeyValueType.java @@ -0,0 +1,200 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for DSAKeyValueType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="DSAKeyValueType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <sequence minOccurs="0">
+ *           <element name="P" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
+ *           <element name="Q" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
+ *         </sequence>
+ *         <element name="G" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary" minOccurs="0"/>
+ *         <element name="Y" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
+ *         <element name="J" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary" minOccurs="0"/>
+ *         <sequence minOccurs="0">
+ *           <element name="Seed" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
+ *           <element name="PgenCounter" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
+ *         </sequence>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "DSAKeyValueType", propOrder = { "p", "q", "g", "y", "j", + "seed", "pgenCounter" }) +public class DSAKeyValueType { + + @XmlElement(name = "P") + protected byte[] p; + @XmlElement(name = "Q") + protected byte[] q; + @XmlElement(name = "G") + protected byte[] g; + @XmlElement(name = "Y", required = true) + protected byte[] y; + @XmlElement(name = "J") + protected byte[] j; + @XmlElement(name = "Seed") + protected byte[] seed; + @XmlElement(name = "PgenCounter") + protected byte[] pgenCounter; + + /** + * Gets the value of the p property. + * + * @return possible object is byte[] + */ + public byte[] getP() { + return p; + } + + /** + * Sets the value of the p property. + * + * @param value + * allowed object is byte[] + */ + public void setP(byte[] value) { + this.p = value; + } + + /** + * Gets the value of the q property. + * + * @return possible object is byte[] + */ + public byte[] getQ() { + return q; + } + + /** + * Sets the value of the q property. + * + * @param value + * allowed object is byte[] + */ + public void setQ(byte[] value) { + this.q = value; + } + + /** + * Gets the value of the g property. + * + * @return possible object is byte[] + */ + public byte[] getG() { + return g; + } + + /** + * Sets the value of the g property. + * + * @param value + * allowed object is byte[] + */ + public void setG(byte[] value) { + this.g = value; + } + + /** + * Gets the value of the y property. + * + * @return possible object is byte[] + */ + public byte[] getY() { + return y; + } + + /** + * Sets the value of the y property. + * + * @param value + * allowed object is byte[] + */ + public void setY(byte[] value) { + this.y = value; + } + + /** + * Gets the value of the j property. + * + * @return possible object is byte[] + */ + public byte[] getJ() { + return j; + } + + /** + * Sets the value of the j property. + * + * @param value + * allowed object is byte[] + */ + public void setJ(byte[] value) { + this.j = value; + } + + /** + * Gets the value of the seed property. + * + * @return possible object is byte[] + */ + public byte[] getSeed() { + return seed; + } + + /** + * Sets the value of the seed property. + * + * @param value + * allowed object is byte[] + */ + public void setSeed(byte[] value) { + this.seed = value; + } + + /** + * Gets the value of the pgenCounter property. + * + * @return possible object is byte[] + */ + public byte[] getPgenCounter() { + return pgenCounter; + } + + /** + * Sets the value of the pgenCounter property. + * + * @param value + * allowed object is byte[] + */ + public void setPgenCounter(byte[] value) { + this.pgenCounter = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/DigestMethodType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/DigestMethodType.java new file mode 100644 index 00000000..effc1e5d --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/DigestMethodType.java @@ -0,0 +1,106 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.w3c.dom.Element; + +/** + *

+ * Java class for DigestMethodType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="DigestMethodType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "DigestMethodType", propOrder = { "content" }) +public class DigestMethodType { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "Algorithm", required = true) + @XmlSchemaType(name = "anyURI") + protected String algorithm; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Element } + * {@link Object } {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the algorithm property. + * + * @return possible object is {@link String } + * + */ + public String getAlgorithm() { + return algorithm; + } + + /** + * Sets the value of the algorithm property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setAlgorithm(String value) { + this.algorithm = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Directory.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Directory.java new file mode 100644 index 00000000..4cef3a38 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Directory.java @@ -0,0 +1,80 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for Directory complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="Directory">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}FilesystemItem">
+ *       <choice maxOccurs="unbounded" minOccurs="0">
+ *         <element name="Directory" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Directory"/>
+ *         <element name="File" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}File"/>
+ *       </choice>
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Directory", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", propOrder = { "directoryOrFile" }) +public class Directory extends FilesystemItem { + + @XmlElements({ @XmlElement(name = "Directory", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = Directory.class, required = false), + @XmlElement(name = "File", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = File.class, required = false) }) + protected List directoryOrFile; + + /** + * Gets the value of the directoryOrFile property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the directoryOrFile property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getDirectoryOrFile().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Directory } {@link File } + * + * + */ + public List getDirectoryOrFile() { + if (directoryOrFile == null) { + directoryOrFile = new ArrayList(); + } + return this.directoryOrFile; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Entity.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Entity.java new file mode 100644 index 00000000..40f159ea --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Entity.java @@ -0,0 +1,188 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for Entity complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="Entity">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <element name="Meta" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta"/>
+ *       </sequence>
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="regid" type="{http://www.w3.org/2001/XMLSchema}anyURI" default="http://invalid.unavailable" />
+ *       <attribute name="role" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKENS" />
+ *       <attribute name="thumbprint" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Entity", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", propOrder = { "meta" }) +public class Entity extends BaseElement { + + @XmlElement(name = "Meta") + protected List meta; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "regid") + @XmlSchemaType(name = "anyURI") + protected String regid; + @XmlAttribute(name = "role", required = true) + @XmlSchemaType(name = "NMTOKENS") + protected List role; + @XmlAttribute(name = "thumbprint") + protected String thumbprint; + + /** + * Gets the value of the meta property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the meta property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getMeta().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Meta } + * + * + */ + public List getMeta() { + if (meta == null) { + meta = new ArrayList(); + } + return this.meta; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the regid property. + * + * @return possible object is {@link String } + * + */ + public String getRegid() { + if (regid == null) { + return "http://invalid.unavailable"; + } else { + return regid; + } + } + + /** + * Sets the value of the regid property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setRegid(String value) { + this.regid = value; + } + + /** + * Gets the value of the role property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the role property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getRole().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link String } + * + * + */ + public List getRole() { + if (role == null) { + role = new ArrayList(); + } + return this.role; + } + + /** + * Gets the value of the thumbprint property. + * + * @return possible object is {@link String } + * + */ + public String getThumbprint() { + return thumbprint; + } + + /** + * Sets the value of the thumbprint property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setThumbprint(String value) { + this.thumbprint = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Evidence.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Evidence.java new file mode 100644 index 00000000..37e96f3f --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Evidence.java @@ -0,0 +1,91 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.datatype.XMLGregorianCalendar; + +/** + *

+ * Java class for Evidence complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="Evidence">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}ResourceCollection">
+ *       <attribute name="date" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
+ *       <attribute name="deviceId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Evidence", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +public class Evidence extends ResourceCollection { + + @XmlAttribute(name = "date") + @XmlSchemaType(name = "dateTime") + protected XMLGregorianCalendar date; + @XmlAttribute(name = "deviceId") + protected String deviceId; + + /** + * Gets the value of the date property. + * + * @return possible object is {@link XMLGregorianCalendar } + * + */ + public XMLGregorianCalendar getDate() { + return date; + } + + /** + * Sets the value of the date property. + * + * @param value + * allowed object is {@link XMLGregorianCalendar } + * + */ + public void setDate(XMLGregorianCalendar value) { + this.date = value; + } + + /** + * Gets the value of the deviceId property. + * + * @return possible object is {@link String } + * + */ + public String getDeviceId() { + return deviceId; + } + + /** + * Sets the value of the deviceId property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setDeviceId(String value) { + this.deviceId = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/File.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/File.java new file mode 100644 index 00000000..3a1411fd --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/File.java @@ -0,0 +1,89 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.math.BigInteger; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for File complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="File">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}FilesystemItem">
+ *       <attribute name="size" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "File", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +public class File extends FilesystemItem { + + @XmlAttribute(name = "size") + protected BigInteger size; + @XmlAttribute(name = "version") + protected String version; + + /** + * Gets the value of the size property. + * + * @return possible object is {@link BigInteger } + * + */ + public BigInteger getSize() { + return size; + } + + /** + * Sets the value of the size property. + * + * @param value + * allowed object is {@link BigInteger } + * + */ + public void setSize(BigInteger value) { + this.size = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link String } + * + */ + public String getVersion() { + return version; + } + + /** + * Sets the value of the version property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setVersion(String value) { + this.version = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/FilesystemItem.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/FilesystemItem.java new file mode 100644 index 00000000..cc73f212 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/FilesystemItem.java @@ -0,0 +1,138 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for FilesystemItem complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="FilesystemItem">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
+ *       <attribute name="key" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="location" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="root" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "FilesystemItem", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +@XmlSeeAlso({ File.class, Directory.class }) +public class FilesystemItem extends Meta { + + @XmlAttribute(name = "key") + protected Boolean key; + @XmlAttribute(name = "location") + protected String location; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "root") + protected String root; + + /** + * Gets the value of the key property. + * + * @return possible object is {@link Boolean } + * + */ + public Boolean isKey() { + return key; + } + + /** + * Sets the value of the key property. + * + * @param value + * allowed object is {@link Boolean } + * + */ + public void setKey(Boolean value) { + this.key = value; + } + + /** + * Gets the value of the location property. + * + * @return possible object is {@link String } + * + */ + public String getLocation() { + return location; + } + + /** + * Sets the value of the location property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setLocation(String value) { + this.location = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the root property. + * + * @return possible object is {@link String } + * + */ + public String getRoot() { + return root; + } + + /** + * Sets the value of the root property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setRoot(String value) { + this.root = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/KeyInfoType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/KeyInfoType.java new file mode 100644 index 00000000..766750ec --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/KeyInfoType.java @@ -0,0 +1,135 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.w3c.dom.Element; + +/** + *

+ * Java class for KeyInfoType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="KeyInfoType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}KeyName"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}KeyValue"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}RetrievalMethod"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}X509Data"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}PGPData"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}SPKIData"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}MgmtData"/>
+ *         <any processContents='lax' namespace='##other'/>
+ *       </choice>
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "KeyInfoType", propOrder = { "content" }) +public class KeyInfoType { + + @XmlElementRefs({ + @XmlElementRef(name = "SPKIData", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "RetrievalMethod", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "KeyValue", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "KeyName", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "X509Data", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "PGPData", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "MgmtData", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false) }) + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link String } + * {@link JAXBElement }{@code <}{@link SPKIDataType }{@code >} {@link Element } + * {@link JAXBElement }{@code <}{@link RetrievalMethodType }{@code >} + * {@link JAXBElement }{@code <}{@link KeyValueType }{@code >} {@link Object } + * {@link JAXBElement }{@code <}{@link String }{@code >} {@link JAXBElement } + * {@code <}{@link X509DataType }{@code >} {@link JAXBElement }{@code <} + * {@link PGPDataType }{@code >} {@link JAXBElement }{@code <}{@link String } + * {@code >} + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/KeyValueType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/KeyValueType.java new file mode 100644 index 00000000..d9fa96f7 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/KeyValueType.java @@ -0,0 +1,89 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlType; +import org.w3c.dom.Element; + +/** + *

+ * Java class for KeyValueType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="KeyValueType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}DSAKeyValue"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}RSAKeyValue"/>
+ *         <any processContents='lax' namespace='##other'/>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "KeyValueType", propOrder = { "content" }) +public class KeyValueType { + + @XmlElementRefs({ + @XmlElementRef(name = "RSAKeyValue", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "DSAKeyValue", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false) }) + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Object } + * {@link String } {@link JAXBElement }{@code <}{@link RSAKeyValueType } + * {@code >} {@link JAXBElement }{@code <}{@link DSAKeyValueType }{@code >} + * {@link Element } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Link.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Link.java new file mode 100644 index 00000000..963f43d6 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Link.java @@ -0,0 +1,214 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

+ * Java class for Link complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="Link">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
+ *       <attribute name="artifact" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="href" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="media" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Media" />
+ *       <attribute name="ownership" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Ownership" />
+ *       <attribute name="rel" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
+ *       <attribute name="type" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}MediaType" />
+ *       <attribute name="use" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Use" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Link", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +public class Link extends BaseElement { + + @XmlAttribute(name = "artifact") + protected String artifact; + @XmlAttribute(name = "href", required = true) + @XmlSchemaType(name = "anyURI") + protected String href; + @XmlAttribute(name = "media") + protected String media; + @XmlAttribute(name = "ownership") + protected Ownership ownership; + @XmlAttribute(name = "rel", required = true) + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NMTOKEN") + protected String rel; + @XmlAttribute(name = "type") + protected String type; + @XmlAttribute(name = "use") + protected Use use; + + /** + * Gets the value of the artifact property. + * + * @return possible object is {@link String } + * + */ + public String getArtifact() { + return artifact; + } + + /** + * Sets the value of the artifact property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setArtifact(String value) { + this.artifact = value; + } + + /** + * Gets the value of the href property. + * + * @return possible object is {@link String } + * + */ + public String getHref() { + return href; + } + + /** + * Sets the value of the href property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setHref(String value) { + this.href = value; + } + + /** + * Gets the value of the media property. + * + * @return possible object is {@link String } + * + */ + public String getMedia() { + return media; + } + + /** + * Sets the value of the media property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setMedia(String value) { + this.media = value; + } + + /** + * Gets the value of the ownership property. + * + * @return possible object is {@link Ownership } + * + */ + public Ownership getOwnership() { + return ownership; + } + + /** + * Sets the value of the ownership property. + * + * @param value + * allowed object is {@link Ownership } + * + */ + public void setOwnership(Ownership value) { + this.ownership = value; + } + + /** + * Gets the value of the rel property. + * + * @return possible object is {@link String } + * + */ + public String getRel() { + return rel; + } + + /** + * Sets the value of the rel property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setRel(String value) { + this.rel = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the use property. + * + * @return possible object is {@link Use } + * + */ + public Use getUse() { + return use; + } + + /** + * Sets the value of the use property. + * + * @param value + * allowed object is {@link Use } + * + */ + public void setUse(Use value) { + this.use = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ManifestType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ManifestType.java new file mode 100644 index 00000000..a5b66458 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ManifestType.java @@ -0,0 +1,108 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

+ * Java class for ManifestType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="ManifestType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}Reference" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ManifestType", propOrder = { "reference" }) +public class ManifestType { + + @XmlElement(name = "Reference", required = true) + protected List reference; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the reference property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the reference property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getReference().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ReferenceType } + * + * + */ + public List getReference() { + if (reference == null) { + reference = new ArrayList(); + } + return this.reference; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Meta.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Meta.java new file mode 100644 index 00000000..7611f9f8 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Meta.java @@ -0,0 +1,41 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for Meta complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="Meta">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Meta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +@XmlSeeAlso({ SoftwareMeta.class, Resource.class, Process.class, + FilesystemItem.class }) +public class Meta extends BaseElement { + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ObjectFactory.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ObjectFactory.java new file mode 100644 index 00000000..c699be32 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ObjectFactory.java @@ -0,0 +1,844 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.math.BigInteger; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlElementDecl; +import javax.xml.bind.annotation.XmlRegistry; +import javax.xml.namespace.QName; + +/** + * This object contains factory methods for each Java content interface and Java + * element interface generated in the hirs.swid.xjc package. + *

+ * An ObjectFactory allows you to programatically construct new instances of the + * Java representation for XML content. The Java representation of XML content + * can consist of schema derived interfaces and classes representing the binding + * of schema type definitions, element declarations and model groups. Factory + * methods for each of these are provided in this class. + *

+ */ +@XmlRegistry +public class ObjectFactory { + + private final static QName _SPKIData_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SPKIData"); + private final static QName _KeyInfo_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "KeyInfo"); + private final static QName _SignatureValue_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SignatureValue"); + private final static QName _KeyValue_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "KeyValue"); + private final static QName _Transforms_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "Transforms"); + private final static QName _DigestMethod_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "DigestMethod"); + private final static QName _X509Data_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "X509Data"); + private final static QName _SignatureProperty_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SignatureProperty"); + private final static QName _KeyName_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "KeyName"); + private final static QName _RSAKeyValue_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "RSAKeyValue"); + private final static QName _SoftwareIdentity_QNAME = new QName( + "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", + "SoftwareIdentity"); + private final static QName _Signature_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "Signature"); + private final static QName _MgmtData_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "MgmtData"); + private final static QName _SignatureMethod_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SignatureMethod"); + private final static QName _Object_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "Object"); + private final static QName _SignatureProperties_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SignatureProperties"); + private final static QName _Transform_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "Transform"); + private final static QName _PGPData_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "PGPData"); + private final static QName _Reference_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "Reference"); + private final static QName _RetrievalMethod_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "RetrievalMethod"); + private final static QName _DSAKeyValue_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "DSAKeyValue"); + private final static QName _DigestValue_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "DigestValue"); + private final static QName _CanonicalizationMethod_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "CanonicalizationMethod"); + private final static QName _SignedInfo_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SignedInfo"); + private final static QName _Manifest_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "Manifest"); + private final static QName _PGPDataTypePGPKeyID_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "PGPKeyID"); + private final static QName _PGPDataTypePGPKeyPacket_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "PGPKeyPacket"); + private final static QName _SignatureMethodTypeHMACOutputLength_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "HMACOutputLength"); + private final static QName _X509DataTypeX509IssuerSerial_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "X509IssuerSerial"); + private final static QName _X509DataTypeX509CRL_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "X509CRL"); + private final static QName _X509DataTypeX509SubjectName_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "X509SubjectName"); + private final static QName _X509DataTypeX509SKI_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "X509SKI"); + private final static QName _X509DataTypeX509Certificate_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "X509Certificate"); + private final static QName _SoftwareIdentityLink_QNAME = new QName( + "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Link"); + private final static QName _SoftwareIdentityEvidence_QNAME = new QName( + "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Evidence"); + private final static QName _SoftwareIdentityPayload_QNAME = new QName( + "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Payload"); + private final static QName _SoftwareIdentityEntity_QNAME = new QName( + "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Entity"); + private final static QName _SoftwareIdentityMeta_QNAME = new QName( + "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Meta"); + private final static QName _TransformTypeXPath_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "XPath"); + private final static QName _SPKIDataTypeSPKISexp_QNAME = new QName( + "http://www.w3.org/2000/09/xmldsig#", "SPKISexp"); + + /** + * Create a new ObjectFactory that can be used to create new instances of + * schema derived classes for package: hirs.swid.xjc + * + */ + public ObjectFactory() { + } + + /** + * Create an instance of {@link SoftwareIdentity } + * + */ + public SoftwareIdentity createSoftwareIdentity() { + return new SoftwareIdentity(); + } + + /** + * Create an instance of {@link SoftwareMeta } + * + */ + public SoftwareMeta createSoftwareMeta() { + return new SoftwareMeta(); + } + + /** + * Create an instance of {@link Entity } + * + */ + public Entity createEntity() { + return new Entity(); + } + + /** + * Create an instance of {@link Meta } + * + */ + public Meta createMeta() { + return new Meta(); + } + + /** + * Create an instance of {@link FilesystemItem } + * + */ + public FilesystemItem createFilesystemItem() { + return new FilesystemItem(); + } + + /** + * Create an instance of {@link Resource } + * + */ + public Resource createResource() { + return new Resource(); + } + + /** + * Create an instance of {@link Process } + * + */ + public Process createProcess() { + return new Process(); + } + + /** + * Create an instance of {@link BaseElement } + * + */ + public BaseElement createBaseElement() { + return new BaseElement(); + } + + /** + * Create an instance of {@link Evidence } + * + */ + public Evidence createEvidence() { + return new Evidence(); + } + + /** + * Create an instance of {@link File } + * + */ + public File createFile() { + return new File(); + } + + /** + * Create an instance of {@link Link } + * + */ + public Link createLink() { + return new Link(); + } + + /** + * Create an instance of {@link Directory } + * + */ + public Directory createDirectory() { + return new Directory(); + } + + /** + * Create an instance of {@link ResourceCollection } + * + */ + public ResourceCollection createResourceCollection() { + return new ResourceCollection(); + } + + /** + * Create an instance of {@link PGPDataType } + * + */ + public PGPDataType createPGPDataType() { + return new PGPDataType(); + } + + /** + * Create an instance of {@link KeyValueType } + * + */ + public KeyValueType createKeyValueType() { + return new KeyValueType(); + } + + /** + * Create an instance of {@link DSAKeyValueType } + * + */ + public DSAKeyValueType createDSAKeyValueType() { + return new DSAKeyValueType(); + } + + /** + * Create an instance of {@link ReferenceType } + * + */ + public ReferenceType createReferenceType() { + return new ReferenceType(); + } + + /** + * Create an instance of {@link RetrievalMethodType } + * + */ + public RetrievalMethodType createRetrievalMethodType() { + return new RetrievalMethodType(); + } + + /** + * Create an instance of {@link TransformsType } + * + */ + public TransformsType createTransformsType() { + return new TransformsType(); + } + + /** + * Create an instance of {@link CanonicalizationMethodType } + * + */ + public CanonicalizationMethodType createCanonicalizationMethodType() { + return new CanonicalizationMethodType(); + } + + /** + * Create an instance of {@link DigestMethodType } + * + */ + public DigestMethodType createDigestMethodType() { + return new DigestMethodType(); + } + + /** + * Create an instance of {@link ManifestType } + * + */ + public ManifestType createManifestType() { + return new ManifestType(); + } + + /** + * Create an instance of {@link SignaturePropertyType } + * + */ + public SignaturePropertyType createSignaturePropertyType() { + return new SignaturePropertyType(); + } + + /** + * Create an instance of {@link X509DataType } + * + */ + public X509DataType createX509DataType() { + return new X509DataType(); + } + + /** + * Create an instance of {@link SignedInfoType } + * + */ + public SignedInfoType createSignedInfoType() { + return new SignedInfoType(); + } + + /** + * Create an instance of {@link RSAKeyValueType } + * + */ + public RSAKeyValueType createRSAKeyValueType() { + return new RSAKeyValueType(); + } + + /** + * Create an instance of {@link SPKIDataType } + * + */ + public SPKIDataType createSPKIDataType() { + return new SPKIDataType(); + } + + /** + * Create an instance of {@link SignatureValueType } + * + */ + public SignatureValueType createSignatureValueType() { + return new SignatureValueType(); + } + + /** + * Create an instance of {@link KeyInfoType } + * + */ + public KeyInfoType createKeyInfoType() { + return new KeyInfoType(); + } + + /** + * Create an instance of {@link SignatureType } + * + */ + public SignatureType createSignatureType() { + return new SignatureType(); + } + + /** + * Create an instance of {@link SignaturePropertiesType } + * + */ + public SignaturePropertiesType createSignaturePropertiesType() { + return new SignaturePropertiesType(); + } + + /** + * Create an instance of {@link SignatureMethodType } + * + */ + public SignatureMethodType createSignatureMethodType() { + return new SignatureMethodType(); + } + + /** + * Create an instance of {@link ObjectType } + * + */ + public ObjectType createObjectType() { + return new ObjectType(); + } + + /** + * Create an instance of {@link TransformType } + * + */ + public TransformType createTransformType() { + return new TransformType(); + } + + /** + * Create an instance of {@link X509IssuerSerialType } + * + */ + public X509IssuerSerialType createX509IssuerSerialType() { + return new X509IssuerSerialType(); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SPKIDataType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKIData") + public JAXBElement createSPKIData(SPKIDataType value) { + return new JAXBElement(_SPKIData_QNAME, + SPKIDataType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link KeyInfoType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyInfo") + public JAXBElement createKeyInfo(KeyInfoType value) { + return new JAXBElement(_KeyInfo_QNAME, KeyInfoType.class, + null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link SignatureValueType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureValue") + public JAXBElement createSignatureValue( + SignatureValueType value) { + return new JAXBElement(_SignatureValue_QNAME, + SignatureValueType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link KeyValueType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyValue") + public JAXBElement createKeyValue(KeyValueType value) { + return new JAXBElement(_KeyValue_QNAME, + KeyValueType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TransformsType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Transforms") + public JAXBElement createTransforms(TransformsType value) { + return new JAXBElement(_Transforms_QNAME, + TransformsType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link DigestMethodType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestMethod") + public JAXBElement createDigestMethod( + DigestMethodType value) { + return new JAXBElement(_DigestMethod_QNAME, + DigestMethodType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link X509DataType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509Data") + public JAXBElement createX509Data(X509DataType value) { + return new JAXBElement(_X509Data_QNAME, + X509DataType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link SignaturePropertyType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureProperty") + public JAXBElement createSignatureProperty( + SignaturePropertyType value) { + return new JAXBElement(_SignatureProperty_QNAME, + SignaturePropertyType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyName") + public JAXBElement createKeyName(String value) { + return new JAXBElement(_KeyName_QNAME, String.class, null, + value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link RSAKeyValueType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "RSAKeyValue") + public JAXBElement createRSAKeyValue(RSAKeyValueType value) { + return new JAXBElement(_RSAKeyValue_QNAME, + RSAKeyValueType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link SoftwareIdentity }{@code >} + * + */ + @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "SoftwareIdentity") + public JAXBElement createSoftwareIdentity( + SoftwareIdentity value) { + return new JAXBElement(_SoftwareIdentity_QNAME, + SoftwareIdentity.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SignatureType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Signature") + public JAXBElement createSignature(SignatureType value) { + return new JAXBElement(_Signature_QNAME, + SignatureType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "MgmtData") + public JAXBElement createMgmtData(String value) { + return new JAXBElement(_MgmtData_QNAME, String.class, null, + value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link SignatureMethodType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureMethod") + public JAXBElement createSignatureMethod( + SignatureMethodType value) { + return new JAXBElement(_SignatureMethod_QNAME, + SignatureMethodType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ObjectType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Object") + public JAXBElement createObject(ObjectType value) { + return new JAXBElement(_Object_QNAME, ObjectType.class, + null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link SignaturePropertiesType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureProperties") + public JAXBElement createSignatureProperties( + SignaturePropertiesType value) { + return new JAXBElement( + _SignatureProperties_QNAME, SignaturePropertiesType.class, + null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link TransformType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Transform") + public JAXBElement createTransform(TransformType value) { + return new JAXBElement(_Transform_QNAME, + TransformType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link PGPDataType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPData") + public JAXBElement createPGPData(PGPDataType value) { + return new JAXBElement(_PGPData_QNAME, PGPDataType.class, + null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ReferenceType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Reference") + public JAXBElement createReference(ReferenceType value) { + return new JAXBElement(_Reference_QNAME, + ReferenceType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link RetrievalMethodType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "RetrievalMethod") + public JAXBElement createRetrievalMethod( + RetrievalMethodType value) { + return new JAXBElement(_RetrievalMethod_QNAME, + RetrievalMethodType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link DSAKeyValueType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DSAKeyValue") + public JAXBElement createDSAKeyValue(DSAKeyValueType value) { + return new JAXBElement(_DSAKeyValue_QNAME, + DSAKeyValueType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestValue") + public JAXBElement createDigestValue(byte[] value) { + return new JAXBElement(_DigestValue_QNAME, byte[].class, null, + ((byte[]) value)); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link CanonicalizationMethodType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "CanonicalizationMethod") + public JAXBElement createCanonicalizationMethod( + CanonicalizationMethodType value) { + return new JAXBElement( + _CanonicalizationMethod_QNAME, + CanonicalizationMethodType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SignedInfoType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignedInfo") + public JAXBElement createSignedInfo(SignedInfoType value) { + return new JAXBElement(_SignedInfo_QNAME, + SignedInfoType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link ManifestType } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Manifest") + public JAXBElement createManifest(ManifestType value) { + return new JAXBElement(_Manifest_QNAME, + ManifestType.class, null, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPKeyID", scope = PGPDataType.class) + public JAXBElement createPGPDataTypePGPKeyID(byte[] value) { + return new JAXBElement(_PGPDataTypePGPKeyID_QNAME, + byte[].class, PGPDataType.class, ((byte[]) value)); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPKeyPacket", scope = PGPDataType.class) + public JAXBElement createPGPDataTypePGPKeyPacket(byte[] value) { + return new JAXBElement(_PGPDataTypePGPKeyPacket_QNAME, + byte[].class, PGPDataType.class, ((byte[]) value)); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link BigInteger } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "HMACOutputLength", scope = SignatureMethodType.class) + public JAXBElement createSignatureMethodTypeHMACOutputLength( + BigInteger value) { + return new JAXBElement( + _SignatureMethodTypeHMACOutputLength_QNAME, BigInteger.class, + SignatureMethodType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link X509IssuerSerialType }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509IssuerSerial", scope = X509DataType.class) + public JAXBElement createX509DataTypeX509IssuerSerial( + X509IssuerSerialType value) { + return new JAXBElement( + _X509DataTypeX509IssuerSerial_QNAME, + X509IssuerSerialType.class, X509DataType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509CRL", scope = X509DataType.class) + public JAXBElement createX509DataTypeX509CRL(byte[] value) { + return new JAXBElement(_X509DataTypeX509CRL_QNAME, + byte[].class, X509DataType.class, ((byte[]) value)); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509SubjectName", scope = X509DataType.class) + public JAXBElement createX509DataTypeX509SubjectName(String value) { + return new JAXBElement(_X509DataTypeX509SubjectName_QNAME, + String.class, X509DataType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509SKI", scope = X509DataType.class) + public JAXBElement createX509DataTypeX509SKI(byte[] value) { + return new JAXBElement(_X509DataTypeX509SKI_QNAME, + byte[].class, X509DataType.class, ((byte[]) value)); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509Certificate", scope = X509DataType.class) + public JAXBElement createX509DataTypeX509Certificate(byte[] value) { + return new JAXBElement(_X509DataTypeX509Certificate_QNAME, + byte[].class, X509DataType.class, ((byte[]) value)); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Link }{@code >} + * + */ + @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Link", scope = SoftwareIdentity.class) + public JAXBElement createSoftwareIdentityLink(Link value) { + return new JAXBElement(_SoftwareIdentityLink_QNAME, Link.class, + SoftwareIdentity.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Evidence } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Evidence", scope = SoftwareIdentity.class) + public JAXBElement createSoftwareIdentityEvidence(Evidence value) { + return new JAXBElement(_SoftwareIdentityEvidence_QNAME, + Evidence.class, SoftwareIdentity.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <} + * {@link ResourceCollection }{@code >} + * + */ + @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Payload", scope = SoftwareIdentity.class) + public JAXBElement createSoftwareIdentityPayload( + ResourceCollection value) { + return new JAXBElement( + _SoftwareIdentityPayload_QNAME, ResourceCollection.class, + SoftwareIdentity.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link Entity }{@code >} + * + */ + @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Entity", scope = SoftwareIdentity.class) + public JAXBElement createSoftwareIdentityEntity(Entity value) { + return new JAXBElement(_SoftwareIdentityEntity_QNAME, + Entity.class, SoftwareIdentity.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link SoftwareMeta } + * {@code >} + * + */ + @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Meta", scope = SoftwareIdentity.class) + public JAXBElement createSoftwareIdentityMeta( + SoftwareMeta value) { + return new JAXBElement(_SoftwareIdentityMeta_QNAME, + SoftwareMeta.class, SoftwareIdentity.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "XPath", scope = TransformType.class) + public JAXBElement createTransformTypeXPath(String value) { + return new JAXBElement(_TransformTypeXPath_QNAME, String.class, + TransformType.class, value); + } + + /** + * Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + */ + @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKISexp", scope = SPKIDataType.class) + public JAXBElement createSPKIDataTypeSPKISexp(byte[] value) { + return new JAXBElement(_SPKIDataTypeSPKISexp_QNAME, + byte[].class, SPKIDataType.class, ((byte[]) value)); + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ObjectType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ObjectType.java new file mode 100644 index 00000000..a3ade994 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ObjectType.java @@ -0,0 +1,160 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.w3c.dom.Element; + +/** + *

+ * Java class for ObjectType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="ObjectType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded" minOccurs="0">
+ *         <any processContents='lax'/>
+ *       </sequence>
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <attribute name="MimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="Encoding" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ObjectType", propOrder = { "content" }) +public class ObjectType { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(name = "MimeType") + protected String mimeType; + @XmlAttribute(name = "Encoding") + @XmlSchemaType(name = "anyURI") + protected String encoding; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Element } + * {@link Object } {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the mimeType property. + * + * @return possible object is {@link String } + * + */ + public String getMimeType() { + return mimeType; + } + + /** + * Sets the value of the mimeType property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setMimeType(String value) { + this.mimeType = value; + } + + /** + * Gets the value of the encoding property. + * + * @return possible object is {@link String } + * + */ + public String getEncoding() { + return encoding; + } + + /** + * Sets the value of the encoding property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setEncoding(String value) { + this.encoding = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Ownership.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Ownership.java new file mode 100644 index 00000000..c789c42b --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Ownership.java @@ -0,0 +1,85 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for Ownership. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ * + *
+ * <simpleType name="Ownership">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *     <enumeration value="abandon"/>
+ *     <enumeration value="private"/>
+ *     <enumeration value="shared"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "Ownership", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +@XmlEnum +public enum Ownership { + + /** + * + * Determines the relative strength of ownership of the target piece of + * software. + * + * + */ + @XmlEnumValue("abandon") + ABANDON("abandon"), + + /** + * + * If this is uninstalled, then the [Link]'d software should be removed too. + * + * + */ + @XmlEnumValue("private") + PRIVATE("private"), + + /** + * + * If this is uninstalled, then the [Link]'d software should be removed if + * nobody else is sharing it + * + * + */ + @XmlEnumValue("shared") + SHARED("shared"); + private final String value; + + Ownership(String v) { + value = v; + } + + public String value() { + return value; + } + + public static Ownership fromValue(String v) { + for (Ownership c : Ownership.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/PGPDataType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/PGPDataType.java new file mode 100644 index 00000000..d4541faa --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/PGPDataType.java @@ -0,0 +1,103 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlType; +import org.w3c.dom.Element; + +/** + *

+ * Java class for PGPDataType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="PGPDataType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice>
+ *         <sequence>
+ *           <element name="PGPKeyID" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *           <element name="PGPKeyPacket" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
+ *           <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *         </sequence>
+ *         <sequence>
+ *           <element name="PGPKeyPacket" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *           <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *         </sequence>
+ *       </choice>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "PGPDataType", propOrder = { "content" }) +public class PGPDataType { + + @XmlElementRefs({ + @XmlElementRef(name = "PGPKeyID", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "PGPKeyPacket", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false) }) + @XmlAnyElement(lax = true) + protected List content; + + /** + * Gets the rest of the content model. + * + *

+ * You are getting this "catch-all" property because of the following + * reason: The field name "PGPKeyPacket" is used by two different parts of a + * schema. See: line 218 of + * http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd line 213 of + * http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd + *

+ * To get rid of this property, apply a property customization to one of + * both of the following declarations to change their names: Gets the value + * of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link byte[]}{@code >} {@link JAXBElement } + * {@code <}{@link byte[]}{@code >} {@link Object } {@link Element } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Process.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Process.java new file mode 100644 index 00000000..b148fc17 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Process.java @@ -0,0 +1,89 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.math.BigInteger; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for Process complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="Process">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="pid" type="{http://www.w3.org/2001/XMLSchema}integer" />
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Process", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +public class Process extends Meta { + + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "pid") + protected BigInteger pid; + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the pid property. + * + * @return possible object is {@link BigInteger } + * + */ + public BigInteger getPid() { + return pid; + } + + /** + * Sets the value of the pid property. + * + * @param value + * allowed object is {@link BigInteger } + * + */ + public void setPid(BigInteger value) { + this.pid = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/RSAKeyValueType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/RSAKeyValueType.java new file mode 100644 index 00000000..1626f2f3 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/RSAKeyValueType.java @@ -0,0 +1,85 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for RSAKeyValueType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="RSAKeyValueType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="Modulus" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
+ *         <element name="Exponent" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "RSAKeyValueType", propOrder = { "modulus", "exponent" }) +public class RSAKeyValueType { + + @XmlElement(name = "Modulus", required = true) + protected byte[] modulus; + @XmlElement(name = "Exponent", required = true) + protected byte[] exponent; + + /** + * Gets the value of the modulus property. + * + * @return possible object is byte[] + */ + public byte[] getModulus() { + return modulus; + } + + /** + * Sets the value of the modulus property. + * + * @param value + * allowed object is byte[] + */ + public void setModulus(byte[] value) { + this.modulus = value; + } + + /** + * Gets the value of the exponent property. + * + * @return possible object is byte[] + */ + public byte[] getExponent() { + return exponent; + } + + /** + * Sets the value of the exponent property. + * + * @param value + * allowed object is byte[] + */ + public void setExponent(byte[] value) { + this.exponent = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ReferenceType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ReferenceType.java new file mode 100644 index 00000000..c0b84012 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ReferenceType.java @@ -0,0 +1,194 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

+ * Java class for ReferenceType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="ReferenceType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}Transforms" minOccurs="0"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}DigestMethod"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}DigestValue"/>
+ *       </sequence>
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *       <attribute name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ReferenceType", propOrder = { "transforms", "digestMethod", + "digestValue" }) +public class ReferenceType { + + @XmlElement(name = "Transforms") + protected TransformsType transforms; + @XmlElement(name = "DigestMethod", required = true) + protected DigestMethodType digestMethod; + @XmlElement(name = "DigestValue", required = true) + protected byte[] digestValue; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + @XmlAttribute(name = "URI") + @XmlSchemaType(name = "anyURI") + protected String uri; + @XmlAttribute(name = "Type") + @XmlSchemaType(name = "anyURI") + protected String type; + + /** + * Gets the value of the transforms property. + * + * @return possible object is {@link TransformsType } + * + */ + public TransformsType getTransforms() { + return transforms; + } + + /** + * Sets the value of the transforms property. + * + * @param value + * allowed object is {@link TransformsType } + * + */ + public void setTransforms(TransformsType value) { + this.transforms = value; + } + + /** + * Gets the value of the digestMethod property. + * + * @return possible object is {@link DigestMethodType } + * + */ + public DigestMethodType getDigestMethod() { + return digestMethod; + } + + /** + * Sets the value of the digestMethod property. + * + * @param value + * allowed object is {@link DigestMethodType } + * + */ + public void setDigestMethod(DigestMethodType value) { + this.digestMethod = value; + } + + /** + * Gets the value of the digestValue property. + * + * @return possible object is byte[] + */ + public byte[] getDigestValue() { + return digestValue; + } + + /** + * Sets the value of the digestValue property. + * + * @param value + * allowed object is byte[] + */ + public void setDigestValue(byte[] value) { + this.digestValue = value; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + + /** + * Gets the value of the uri property. + * + * @return possible object is {@link String } + * + */ + public String getURI() { + return uri; + } + + /** + * Sets the value of the uri property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setURI(String value) { + this.uri = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Resource.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Resource.java new file mode 100644 index 00000000..52f804e6 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Resource.java @@ -0,0 +1,64 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for Resource complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="Resource">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
+ *       <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "Resource", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +public class Resource extends Meta { + + @XmlAttribute(name = "type", required = true) + protected String type; + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ResourceCollection.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ResourceCollection.java new file mode 100644 index 00000000..d005b148 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/ResourceCollection.java @@ -0,0 +1,86 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlElements; +import javax.xml.bind.annotation.XmlSeeAlso; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for ResourceCollection complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="ResourceCollection">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
+ *       <choice maxOccurs="unbounded" minOccurs="0">
+ *         <element name="Directory" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Directory"/>
+ *         <element name="File" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}File"/>
+ *         <element name="Process" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Process"/>
+ *         <element name="Resource" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Resource"/>
+ *       </choice>
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "ResourceCollection", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", propOrder = { "directoryOrFileOrProcess" }) +@XmlSeeAlso({ Evidence.class }) +public class ResourceCollection extends BaseElement { + + @XmlElements({ @XmlElement(name = "Directory", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = Directory.class, required = false), + @XmlElement(name = "File", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = File.class, required = false), + @XmlElement(name = "Process", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = Process.class, required = false), + @XmlElement(name = "Resource", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = Resource.class, required = false) }) + protected List directoryOrFileOrProcess; + + /** + * Gets the value of the directoryOrFileOrProcess property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the directoryOrFileOrProcess property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getDirectoryOrFileOrProcess().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link Directory } {@link File } {@link Process } {@link Resource } + * + * + */ + public List getDirectoryOrFileOrProcess() { + if (directoryOrFileOrProcess == null) { + directoryOrFileOrProcess = new ArrayList(); + } + return this.directoryOrFileOrProcess; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/RetrievalMethodType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/RetrievalMethodType.java new file mode 100644 index 00000000..18b7de4e --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/RetrievalMethodType.java @@ -0,0 +1,117 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for RetrievalMethodType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="RetrievalMethodType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}Transforms" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "RetrievalMethodType", propOrder = { "transforms" }) +public class RetrievalMethodType { + + @XmlElement(name = "Transforms") + protected TransformsType transforms; + @XmlAttribute(name = "URI") + @XmlSchemaType(name = "anyURI") + protected String uri; + @XmlAttribute(name = "Type") + @XmlSchemaType(name = "anyURI") + protected String type; + + /** + * Gets the value of the transforms property. + * + * @return possible object is {@link TransformsType } + * + */ + public TransformsType getTransforms() { + return transforms; + } + + /** + * Sets the value of the transforms property. + * + * @param value + * allowed object is {@link TransformsType } + * + */ + public void setTransforms(TransformsType value) { + this.transforms = value; + } + + /** + * Gets the value of the uri property. + * + * @return possible object is {@link String } + * + */ + public String getURI() { + return uri; + } + + /** + * Sets the value of the uri property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setURI(String value) { + this.uri = value; + } + + /** + * Gets the value of the type property. + * + * @return possible object is {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SPKIDataType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SPKIDataType.java new file mode 100644 index 00000000..a2596552 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SPKIDataType.java @@ -0,0 +1,81 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlType; +import org.w3c.dom.Element; + +/** + *

+ * Java class for SPKIDataType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SPKIDataType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded">
+ *         <element name="SPKISexp" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *         <any processContents='lax' namespace='##other' minOccurs="0"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SPKIDataType", propOrder = { "spkiSexpAndAny" }) +public class SPKIDataType { + + @XmlElementRef(name = "SPKISexp", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class) + @XmlAnyElement(lax = true) + protected List spkiSexpAndAny; + + /** + * Gets the value of the spkiSexpAndAny property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the spkiSexpAndAny property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getSPKISexpAndAny().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Element } + * {@link Object } {@link JAXBElement }{@code <}{@link byte[]}{@code >} + * + * + */ + public List getSPKISexpAndAny() { + if (spkiSexpAndAny == null) { + spkiSexpAndAny = new ArrayList(); + } + return this.spkiSexpAndAny; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureMethodType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureMethodType.java new file mode 100644 index 00000000..988dc645 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureMethodType.java @@ -0,0 +1,110 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for SignatureMethodType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SignatureMethodType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="HMACOutputLength" type="{http://www.w3.org/2000/09/xmldsig#}HMACOutputLengthType" minOccurs="0"/>
+ *         <any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignatureMethodType", propOrder = { "content" }) +public class SignatureMethodType { + + @XmlElementRef(name = "HMACOutputLength", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false) + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "Algorithm", required = true) + @XmlSchemaType(name = "anyURI") + protected String algorithm; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Object } + * {@link String } {@link JAXBElement }{@code <}{@link BigInteger }{@code >} + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the algorithm property. + * + * @return possible object is {@link String } + * + */ + public String getAlgorithm() { + return algorithm; + } + + /** + * Sets the value of the algorithm property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setAlgorithm(String value) { + this.algorithm = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignaturePropertiesType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignaturePropertiesType.java new file mode 100644 index 00000000..4366bd68 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignaturePropertiesType.java @@ -0,0 +1,108 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

+ * Java class for SignaturePropertiesType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SignaturePropertiesType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}SignatureProperty" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignaturePropertiesType", propOrder = { "signatureProperty" }) +public class SignaturePropertiesType { + + @XmlElement(name = "SignatureProperty", required = true) + protected List signatureProperty; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the signatureProperty property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the signatureProperty property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getSignatureProperty().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link SignaturePropertyType } + * + * + */ + public List getSignatureProperty() { + if (signatureProperty == null) { + signatureProperty = new ArrayList(); + } + return this.signatureProperty; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignaturePropertyType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignaturePropertyType.java new file mode 100644 index 00000000..1a0f88f0 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignaturePropertyType.java @@ -0,0 +1,136 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.w3c.dom.Element; + +/** + *

+ * Java class for SignaturePropertyType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SignaturePropertyType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded">
+ *         <any processContents='lax' namespace='##other'/>
+ *       </choice>
+ *       <attribute name="Target" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignaturePropertyType", propOrder = { "content" }) +public class SignaturePropertyType { + + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "Target", required = true) + @XmlSchemaType(name = "anyURI") + protected String target; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Element } + * {@link Object } {@link String } + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the target property. + * + * @return possible object is {@link String } + * + */ + public String getTarget() { + return target; + } + + /** + * Sets the value of the target property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setTarget(String value) { + this.target = value; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureType.java new file mode 100644 index 00000000..60bed84a --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureType.java @@ -0,0 +1,181 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

+ * Java class for SignatureType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SignatureType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}SignedInfo"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}SignatureValue"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}KeyInfo" minOccurs="0"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}Object" maxOccurs="unbounded" minOccurs="0"/>
+ *       </sequence>
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignatureType", propOrder = { "signedInfo", "signatureValue", + "keyInfo", "object" }) +public class SignatureType { + + @XmlElement(name = "SignedInfo", required = true) + protected SignedInfoType signedInfo; + @XmlElement(name = "SignatureValue", required = true) + protected SignatureValueType signatureValue; + @XmlElement(name = "KeyInfo") + protected KeyInfoType keyInfo; + @XmlElement(name = "Object") + protected List object; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the signedInfo property. + * + * @return possible object is {@link SignedInfoType } + * + */ + public SignedInfoType getSignedInfo() { + return signedInfo; + } + + /** + * Sets the value of the signedInfo property. + * + * @param value + * allowed object is {@link SignedInfoType } + * + */ + public void setSignedInfo(SignedInfoType value) { + this.signedInfo = value; + } + + /** + * Gets the value of the signatureValue property. + * + * @return possible object is {@link SignatureValueType } + * + */ + public SignatureValueType getSignatureValue() { + return signatureValue; + } + + /** + * Sets the value of the signatureValue property. + * + * @param value + * allowed object is {@link SignatureValueType } + * + */ + public void setSignatureValue(SignatureValueType value) { + this.signatureValue = value; + } + + /** + * Gets the value of the keyInfo property. + * + * @return possible object is {@link KeyInfoType } + * + */ + public KeyInfoType getKeyInfo() { + return keyInfo; + } + + /** + * Sets the value of the keyInfo property. + * + * @param value + * allowed object is {@link KeyInfoType } + * + */ + public void setKeyInfo(KeyInfoType value) { + this.keyInfo = value; + } + + /** + * Gets the value of the object property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the object property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getObject().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ObjectType } + * + * + */ + public List getObject() { + if (object == null) { + object = new ArrayList(); + } + return this.object; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureValueType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureValueType.java new file mode 100644 index 00000000..a47d237e --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignatureValueType.java @@ -0,0 +1,92 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

+ * Java class for SignatureValueType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SignatureValueType">
+ *   <simpleContent>
+ *     <extension base="<http://www.w3.org/2001/XMLSchema>base64Binary">
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *     </extension>
+ *   </simpleContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignatureValueType", propOrder = { "value" }) +public class SignatureValueType { + + @XmlValue + protected byte[] value; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the value property. + * + * @return possible object is byte[] + */ + public byte[] getValue() { + return value; + } + + /** + * Sets the value of the value property. + * + * @param value + * allowed object is byte[] + */ + public void setValue(byte[] value) { + this.value = value; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignedInfoType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignedInfoType.java new file mode 100644 index 00000000..9f69e2c9 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SignedInfoType.java @@ -0,0 +1,157 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlID; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; + +/** + *

+ * Java class for SignedInfoType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SignedInfoType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}SignatureMethod"/>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}Reference" maxOccurs="unbounded"/>
+ *       </sequence>
+ *       <attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SignedInfoType", propOrder = { "canonicalizationMethod", + "signatureMethod", "reference" }) +public class SignedInfoType { + + @XmlElement(name = "CanonicalizationMethod", required = true) + protected CanonicalizationMethodType canonicalizationMethod; + @XmlElement(name = "SignatureMethod", required = true) + protected SignatureMethodType signatureMethod; + @XmlElement(name = "Reference", required = true) + protected List reference; + @XmlAttribute(name = "Id") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlID + @XmlSchemaType(name = "ID") + protected String id; + + /** + * Gets the value of the canonicalizationMethod property. + * + * @return possible object is {@link CanonicalizationMethodType } + * + */ + public CanonicalizationMethodType getCanonicalizationMethod() { + return canonicalizationMethod; + } + + /** + * Sets the value of the canonicalizationMethod property. + * + * @param value + * allowed object is {@link CanonicalizationMethodType } + * + */ + public void setCanonicalizationMethod(CanonicalizationMethodType value) { + this.canonicalizationMethod = value; + } + + /** + * Gets the value of the signatureMethod property. + * + * @return possible object is {@link SignatureMethodType } + * + */ + public SignatureMethodType getSignatureMethod() { + return signatureMethod; + } + + /** + * Sets the value of the signatureMethod property. + * + * @param value + * allowed object is {@link SignatureMethodType } + * + */ + public void setSignatureMethod(SignatureMethodType value) { + this.signatureMethod = value; + } + + /** + * Gets the value of the reference property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the reference property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getReference().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link ReferenceType } + * + * + */ + public List getReference() { + if (reference == null) { + reference = new ArrayList(); + } + return this.reference; + } + + /** + * Gets the value of the id property. + * + * @return possible object is {@link String } + * + */ + public String getId() { + return id; + } + + /** + * Sets the value of the id property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setId(String value) { + this.id = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SoftwareIdentity.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SoftwareIdentity.java new file mode 100644 index 00000000..8c91164b --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SoftwareIdentity.java @@ -0,0 +1,343 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.adapters.CollapsedStringAdapter; +import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; +import org.w3c.dom.Element; + +/** + *

+ * Java class for SoftwareIdentity complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SoftwareIdentity">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
+ *       <choice maxOccurs="unbounded">
+ *         <element name="Entity" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Entity" maxOccurs="unbounded"/>
+ *         <element name="Evidence" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Evidence" minOccurs="0"/>
+ *         <element name="Link" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Link" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="Meta" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}SoftwareMeta" maxOccurs="unbounded" minOccurs="0"/>
+ *         <element name="Payload" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}ResourceCollection" minOccurs="0"/>
+ *         <any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
+ *       </choice>
+ *       <attribute name="corpus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="patch" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="media" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Media" />
+ *       <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="supplemental" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
+ *       <attribute name="tagId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="tagVersion" type="{http://www.w3.org/2001/XMLSchema}integer" default="0" />
+ *       <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" default="0.0" />
+ *       <attribute name="versionScheme" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" default="multipartnumeric" />
+ *       <anyAttribute processContents='lax' namespace='##other'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SoftwareIdentity", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", propOrder = { "entityOrEvidenceOrLink" }) +public class SoftwareIdentity extends BaseElement { + + @XmlElementRefs({ + @XmlElementRef(name = "Evidence", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = JAXBElement.class, required = false), + @XmlElementRef(name = "Meta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = JAXBElement.class, required = false), + @XmlElementRef(name = "Entity", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = JAXBElement.class, required = false), + @XmlElementRef(name = "Payload", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = JAXBElement.class, required = false), + @XmlElementRef(name = "Link", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = JAXBElement.class, required = false) }) + @XmlAnyElement(lax = true) + protected List entityOrEvidenceOrLink; + @XmlAttribute(name = "corpus") + protected Boolean corpus; + @XmlAttribute(name = "patch") + protected Boolean patch; + @XmlAttribute(name = "media") + protected String media; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "supplemental") + protected Boolean supplemental; + @XmlAttribute(name = "tagId", required = true) + protected String tagId; + @XmlAttribute(name = "tagVersion") + protected BigInteger tagVersion; + @XmlAttribute(name = "version") + protected String version; + @XmlAttribute(name = "versionScheme") + @XmlJavaTypeAdapter(CollapsedStringAdapter.class) + @XmlSchemaType(name = "NMTOKEN") + protected String versionScheme; + + /** + * Gets the value of the entityOrEvidenceOrLink property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the entityOrEvidenceOrLink property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getEntityOrEvidenceOrLink().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link Evidence }{@code >} {@link JAXBElement } + * {@code <}{@link SoftwareMeta }{@code >} {@link JAXBElement }{@code <} + * {@link Entity }{@code >} {@link Element } {@link JAXBElement }{@code <} + * {@link ResourceCollection }{@code >} {@link Object } {@link JAXBElement } + * {@code <}{@link Link }{@code >} + * + * + */ + public List getEntityOrEvidenceOrLink() { + if (entityOrEvidenceOrLink == null) { + entityOrEvidenceOrLink = new ArrayList(); + } + return this.entityOrEvidenceOrLink; + } + + /** + * Gets the value of the corpus property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isCorpus() { + if (corpus == null) { + return false; + } else { + return corpus; + } + } + + /** + * Sets the value of the corpus property. + * + * @param value + * allowed object is {@link Boolean } + * + */ + public void setCorpus(Boolean value) { + this.corpus = value; + } + + /** + * Gets the value of the patch property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isPatch() { + if (patch == null) { + return false; + } else { + return patch; + } + } + + /** + * Sets the value of the patch property. + * + * @param value + * allowed object is {@link Boolean } + * + */ + public void setPatch(Boolean value) { + this.patch = value; + } + + /** + * Gets the value of the media property. + * + * @return possible object is {@link String } + * + */ + public String getMedia() { + return media; + } + + /** + * Sets the value of the media property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setMedia(String value) { + this.media = value; + } + + /** + * Gets the value of the name property. + * + * @return possible object is {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the supplemental property. + * + * @return possible object is {@link Boolean } + * + */ + public boolean isSupplemental() { + if (supplemental == null) { + return false; + } else { + return supplemental; + } + } + + /** + * Sets the value of the supplemental property. + * + * @param value + * allowed object is {@link Boolean } + * + */ + public void setSupplemental(Boolean value) { + this.supplemental = value; + } + + /** + * Gets the value of the tagId property. + * + * @return possible object is {@link String } + * + */ + public String getTagId() { + return tagId; + } + + /** + * Sets the value of the tagId property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setTagId(String value) { + this.tagId = value; + } + + /** + * Gets the value of the tagVersion property. + * + * @return possible object is {@link BigInteger } + * + */ + public BigInteger getTagVersion() { + if (tagVersion == null) { + return new BigInteger("0"); + } else { + return tagVersion; + } + } + + /** + * Sets the value of the tagVersion property. + * + * @param value + * allowed object is {@link BigInteger } + * + */ + public void setTagVersion(BigInteger value) { + this.tagVersion = value; + } + + /** + * Gets the value of the version property. + * + * @return possible object is {@link String } + * + */ + public String getVersion() { + if (version == null) { + return "0.0"; + } else { + return version; + } + } + + /** + * Sets the value of the version property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setVersion(String value) { + this.version = value; + } + + /** + * Gets the value of the versionScheme property. + * + * @return possible object is {@link String } + * + */ + public String getVersionScheme() { + if (versionScheme == null) { + return "multipartnumeric"; + } else { + return versionScheme; + } + } + + /** + * Sets the value of the versionScheme property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setVersionScheme(String value) { + this.versionScheme = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SoftwareMeta.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SoftwareMeta.java new file mode 100644 index 00000000..0f30dcf0 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/SoftwareMeta.java @@ -0,0 +1,400 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for SoftwareMeta complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="SoftwareMeta">
+ *   <complexContent>
+ *     <extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
+ *       <attribute name="activationStatus" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="channelType" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="colloquialVersion" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="edition" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="entitlementDataRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" />
+ *       <attribute name="entitlementKey" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="generator" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="persistentId" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="product" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="productFamily" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="revision" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="summary" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="unspscCode" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <attribute name="unspscVersion" type="{http://www.w3.org/2001/XMLSchema}string" />
+ *       <anyAttribute processContents='lax'/>
+ *     </extension>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "SoftwareMeta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +public class SoftwareMeta extends Meta { + + @XmlAttribute(name = "activationStatus") + protected String activationStatus; + @XmlAttribute(name = "channelType") + protected String channelType; + @XmlAttribute(name = "colloquialVersion") + protected String colloquialVersion; + @XmlAttribute(name = "description") + protected String description; + @XmlAttribute(name = "edition") + protected String edition; + @XmlAttribute(name = "entitlementDataRequired") + protected Boolean entitlementDataRequired; + @XmlAttribute(name = "entitlementKey") + protected String entitlementKey; + @XmlAttribute(name = "generator") + protected String generator; + @XmlAttribute(name = "persistentId") + protected String persistentId; + @XmlAttribute(name = "product") + protected String product; + @XmlAttribute(name = "productFamily") + protected String productFamily; + @XmlAttribute(name = "revision") + protected String revision; + @XmlAttribute(name = "summary") + protected String summary; + @XmlAttribute(name = "unspscCode") + protected String unspscCode; + @XmlAttribute(name = "unspscVersion") + protected String unspscVersion; + + /** + * Gets the value of the activationStatus property. + * + * @return possible object is {@link String } + * + */ + public String getActivationStatus() { + return activationStatus; + } + + /** + * Sets the value of the activationStatus property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setActivationStatus(String value) { + this.activationStatus = value; + } + + /** + * Gets the value of the channelType property. + * + * @return possible object is {@link String } + * + */ + public String getChannelType() { + return channelType; + } + + /** + * Sets the value of the channelType property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setChannelType(String value) { + this.channelType = value; + } + + /** + * Gets the value of the colloquialVersion property. + * + * @return possible object is {@link String } + * + */ + public String getColloquialVersion() { + return colloquialVersion; + } + + /** + * Sets the value of the colloquialVersion property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setColloquialVersion(String value) { + this.colloquialVersion = value; + } + + /** + * Gets the value of the description property. + * + * @return possible object is {@link String } + * + */ + public String getDescription() { + return description; + } + + /** + * Sets the value of the description property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setDescription(String value) { + this.description = value; + } + + /** + * Gets the value of the edition property. + * + * @return possible object is {@link String } + * + */ + public String getEdition() { + return edition; + } + + /** + * Sets the value of the edition property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setEdition(String value) { + this.edition = value; + } + + /** + * Gets the value of the entitlementDataRequired property. + * + * @return possible object is {@link Boolean } + * + */ + public Boolean isEntitlementDataRequired() { + return entitlementDataRequired; + } + + /** + * Sets the value of the entitlementDataRequired property. + * + * @param value + * allowed object is {@link Boolean } + * + */ + public void setEntitlementDataRequired(Boolean value) { + this.entitlementDataRequired = value; + } + + /** + * Gets the value of the entitlementKey property. + * + * @return possible object is {@link String } + * + */ + public String getEntitlementKey() { + return entitlementKey; + } + + /** + * Sets the value of the entitlementKey property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setEntitlementKey(String value) { + this.entitlementKey = value; + } + + /** + * Gets the value of the generator property. + * + * @return possible object is {@link String } + * + */ + public String getGenerator() { + return generator; + } + + /** + * Sets the value of the generator property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setGenerator(String value) { + this.generator = value; + } + + /** + * Gets the value of the persistentId property. + * + * @return possible object is {@link String } + * + */ + public String getPersistentId() { + return persistentId; + } + + /** + * Sets the value of the persistentId property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setPersistentId(String value) { + this.persistentId = value; + } + + /** + * Gets the value of the product property. + * + * @return possible object is {@link String } + * + */ + public String getProduct() { + return product; + } + + /** + * Sets the value of the product property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setProduct(String value) { + this.product = value; + } + + /** + * Gets the value of the productFamily property. + * + * @return possible object is {@link String } + * + */ + public String getProductFamily() { + return productFamily; + } + + /** + * Sets the value of the productFamily property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setProductFamily(String value) { + this.productFamily = value; + } + + /** + * Gets the value of the revision property. + * + * @return possible object is {@link String } + * + */ + public String getRevision() { + return revision; + } + + /** + * Sets the value of the revision property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setRevision(String value) { + this.revision = value; + } + + /** + * Gets the value of the summary property. + * + * @return possible object is {@link String } + * + */ + public String getSummary() { + return summary; + } + + /** + * Sets the value of the summary property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setSummary(String value) { + this.summary = value; + } + + /** + * Gets the value of the unspscCode property. + * + * @return possible object is {@link String } + * + */ + public String getUnspscCode() { + return unspscCode; + } + + /** + * Sets the value of the unspscCode property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setUnspscCode(String value) { + this.unspscCode = value; + } + + /** + * Gets the value of the unspscVersion property. + * + * @return possible object is {@link String } + * + */ + public String getUnspscVersion() { + return unspscVersion; + } + + /** + * Sets the value of the unspscVersion property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setUnspscVersion(String value) { + this.unspscVersion = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/TransformType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/TransformType.java new file mode 100644 index 00000000..ee7c45bb --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/TransformType.java @@ -0,0 +1,111 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlAttribute; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlMixed; +import javax.xml.bind.annotation.XmlSchemaType; +import javax.xml.bind.annotation.XmlType; +import org.w3c.dom.Element; + +/** + *

+ * Java class for TransformType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="TransformType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <choice maxOccurs="unbounded" minOccurs="0">
+ *         <any processContents='lax' namespace='##other'/>
+ *         <element name="XPath" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *       </choice>
+ *       <attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "TransformType", propOrder = { "content" }) +public class TransformType { + + @XmlElementRef(name = "XPath", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false) + @XmlMixed + @XmlAnyElement(lax = true) + protected List content; + @XmlAttribute(name = "Algorithm", required = true) + @XmlSchemaType(name = "anyURI") + protected String algorithm; + + /** + * Gets the value of the content property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the content property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getContent().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list {@link Object } + * {@link String } {@link Element } {@link JAXBElement }{@code <}{@link String } + * {@code >} + * + * + */ + public List getContent() { + if (content == null) { + content = new ArrayList(); + } + return this.content; + } + + /** + * Gets the value of the algorithm property. + * + * @return possible object is {@link String } + * + */ + public String getAlgorithm() { + return algorithm; + } + + /** + * Sets the value of the algorithm property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setAlgorithm(String value) { + this.algorithm = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/TransformsType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/TransformsType.java new file mode 100644 index 00000000..dfc8f5dc --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/TransformsType.java @@ -0,0 +1,76 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for TransformsType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="TransformsType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element ref="{http://www.w3.org/2000/09/xmldsig#}Transform" maxOccurs="unbounded"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "TransformsType", propOrder = { "transform" }) +public class TransformsType { + + @XmlElement(name = "Transform", required = true) + protected List transform; + + /** + * Gets the value of the transform property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the transform property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getTransform().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link TransformType } + * + * + */ + public List getTransform() { + if (transform == null) { + transform = new ArrayList(); + } + return this.transform; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Use.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Use.java new file mode 100644 index 00000000..10e4e181 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/Use.java @@ -0,0 +1,83 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for Use. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ * + *
+ * <simpleType name="Use">
+ *   <restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
+ *     <enumeration value="required"/>
+ *     <enumeration value="recommended"/>
+ *     <enumeration value="optional"/>
+ *   </restriction>
+ * </simpleType>
+ * 
+ * + */ +@XmlType(name = "Use", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") +@XmlEnum +public enum Use { + + /** + * + * The [Link]'d software is absolutely required for installation + * + * + */ + @XmlEnumValue("required") + REQUIRED("required"), + + /** + * + * Not absolutely required, but install unless directed not to + * + * + */ + @XmlEnumValue("recommended") + RECOMMENDED("recommended"), + + /** + * + * Not absolutely required, install only when asked + * + * + */ + @XmlEnumValue("optional") + OPTIONAL("optional"); + private final String value; + + Use(String v) { + value = v; + } + + public String value() { + return value; + } + + public static Use fromValue(String v) { + for (Use c : Use.values()) { + if (c.value.equals(v)) { + return c; + } + } + throw new IllegalArgumentException(v); + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/X509DataType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/X509DataType.java new file mode 100644 index 00000000..d451cf6a --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/X509DataType.java @@ -0,0 +1,99 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.util.ArrayList; +import java.util.List; +import javax.xml.bind.JAXBElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlAnyElement; +import javax.xml.bind.annotation.XmlElementRef; +import javax.xml.bind.annotation.XmlElementRefs; +import javax.xml.bind.annotation.XmlType; +import org.w3c.dom.Element; + +/** + *

+ * Java class for X509DataType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="X509DataType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence maxOccurs="unbounded">
+ *         <choice>
+ *           <element name="X509IssuerSerial" type="{http://www.w3.org/2000/09/xmldsig#}X509IssuerSerialType"/>
+ *           <element name="X509SKI" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *           <element name="X509SubjectName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *           <element name="X509Certificate" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *           <element name="X509CRL" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
+ *           <any processContents='lax' namespace='##other'/>
+ *         </choice>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "X509DataType", propOrder = { "x509IssuerSerialOrX509SKIOrX509SubjectName" }) +public class X509DataType { + + @XmlElementRefs({ + @XmlElementRef(name = "X509SKI", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "X509IssuerSerial", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "X509CRL", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "X509SubjectName", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false), + @XmlElementRef(name = "X509Certificate", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false) }) + @XmlAnyElement(lax = true) + protected List x509IssuerSerialOrX509SKIOrX509SubjectName; + + /** + * Gets the value of the x509IssuerSerialOrX509SKIOrX509SubjectName + * property. + * + *

+ * This accessor method returns a reference to the live list, not a + * snapshot. Therefore any modification you make to the returned list will + * be present inside the JAXB object. This is why there is not a + * set method for the + * x509IssuerSerialOrX509SKIOrX509SubjectName property. + * + *

+ * For example, to add a new item, do as follows: + * + *

+	 * getX509IssuerSerialOrX509SKIOrX509SubjectName().add(newItem);
+	 * 
+ * + * + *

+ * Objects of the following type(s) are allowed in the list + * {@link JAXBElement }{@code <}{@link byte[]}{@code >} {@link JAXBElement } + * {@code <}{@link X509IssuerSerialType }{@code >} {@link Element } + * {@link JAXBElement }{@code <}{@link byte[]}{@code >} {@link Object } + * {@link JAXBElement }{@code <}{@link String }{@code >} {@link JAXBElement } + * {@code <}{@link byte[]}{@code >} + * + * + */ + public List getX509IssuerSerialOrX509SKIOrX509SubjectName() { + if (x509IssuerSerialOrX509SKIOrX509SubjectName == null) { + x509IssuerSerialOrX509SKIOrX509SubjectName = new ArrayList(); + } + return this.x509IssuerSerialOrX509SKIOrX509SubjectName; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/X509IssuerSerialType.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/X509IssuerSerialType.java new file mode 100644 index 00000000..0edbbff2 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/X509IssuerSerialType.java @@ -0,0 +1,91 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +package hirs.swid.xjc; + +import java.math.BigInteger; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlType; + +/** + *

+ * Java class for X509IssuerSerialType complex type. + *

+ *

+ * The following schema fragment specifies the expected content contained within + * this class. + *

+ *
+ * <complexType name="X509IssuerSerialType">
+ *   <complexContent>
+ *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
+ *       <sequence>
+ *         <element name="X509IssuerName" type="{http://www.w3.org/2001/XMLSchema}string"/>
+ *         <element name="X509SerialNumber" type="{http://www.w3.org/2001/XMLSchema}integer"/>
+ *       </sequence>
+ *     </restriction>
+ *   </complexContent>
+ * </complexType>
+ * 
+ * + * + */ +@XmlAccessorType(XmlAccessType.FIELD) +@XmlType(name = "X509IssuerSerialType", propOrder = { "x509IssuerName", + "x509SerialNumber" }) +public class X509IssuerSerialType { + + @XmlElement(name = "X509IssuerName", required = true) + protected String x509IssuerName; + @XmlElement(name = "X509SerialNumber", required = true) + protected BigInteger x509SerialNumber; + + /** + * Gets the value of the x509IssuerName property. + * + * @return possible object is {@link String } + * + */ + public String getX509IssuerName() { + return x509IssuerName; + } + + /** + * Sets the value of the x509IssuerName property. + * + * @param value + * allowed object is {@link String } + * + */ + public void setX509IssuerName(String value) { + this.x509IssuerName = value; + } + + /** + * Gets the value of the x509SerialNumber property. + * + * @return possible object is {@link BigInteger } + * + */ + public BigInteger getX509SerialNumber() { + return x509SerialNumber; + } + + /** + * Sets the value of the x509SerialNumber property. + * + * @param value + * allowed object is {@link BigInteger } + * + */ + public void setX509SerialNumber(BigInteger value) { + this.x509SerialNumber = value; + } + +} diff --git a/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/package-info.java b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/package-info.java new file mode 100644 index 00000000..59d16a78 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/java/hirs/swid/xjc/package-info.java @@ -0,0 +1,10 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2018.03.20 at 08:11:19 AM EDT +// + +@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2000/09/xmldsig#", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED) +package hirs.swid.xjc; + diff --git a/tools/tcg_rim_tool/src/main/resources/hirsSwidTagHeader.properties b/tools/tcg_rim_tool/src/main/resources/hirsSwidTagHeader.properties new file mode 100644 index 00000000..2e8e2b96 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/resources/hirsSwidTagHeader.properties @@ -0,0 +1,16 @@ +# Software Identity +softwareIdentity.name=HIRS SWID Tag application +softwareIdentity.tagId=hirs.swid.SwidTags +softwareIdentity.tagVersion= +softwareIdentity.version=0.1 +softwareIdentity.versionScheme= +softwareIdentity.media= +softwareIdentity.corpus=false +softwareIdentity.patch=false +softwareIdentity.supplemental=false + +# Entity +entity.name=HIRS +entity.regid=hirs.org +entity.role=softwareCreator,tagCreator +#entity.thumbprint= \ No newline at end of file diff --git a/tools/tcg_rim_tool/src/main/resources/swidExample.properties b/tools/tcg_rim_tool/src/main/resources/swidExample.properties new file mode 100644 index 00000000..9dcd82bb --- /dev/null +++ b/tools/tcg_rim_tool/src/main/resources/swidExample.properties @@ -0,0 +1,61 @@ +# Software Identity +softwareIdentity.name=HIRS SWID Tag example +softwareIdentity.tagId=hirs.swid.SwidTags.example +softwareIdentity.tagVersion= +softwareIdentity.version=0.1 +softwareIdentity.versionScheme= +softwareIdentity.media= +softwareIdentity.corpus=false +softwareIdentity.patch=false +softwareIdentity.supplemental=false + +# Entity +entity.name=HIRS +entity.regid=hirs.org +entity.role=softwareCreator,tagCreator +#entity.thumbprint= + +# Link +link.href=https://Example.com/support/ProductA/firmware/installfiles +link.rel=installationmedia + +# Software Meta +softwareMeta.activationStatus= +softwareMeta.channelType= +softwareMeta.colloquialVersion= +softwareMeta.description= +softwareMeta.edition= +softwareMeta.entitlementDataRequired= +softwareMeta.entitlementKey= +softwareMeta.generator= +softwareMeta.persistentId= +softwareMeta.product= +softwareMeta.productFamily= +softwareMeta.revision= +softwareMeta.summary= +softwareMeta.unspscCode= +softwareMeta.unspscVersion= +softwareMeta.pcUriLocal=/boot/tcg/manifest/swidtag +softwareMeta.bindingSpec=IOT RIM +softwareMeta.bindingSpecVersion=1.2 +softwareMeta.platformManufacturerId=00201234 +softwareMeta.platformManufacturerStr=Example.com +softwareMeta.platformModel=ProductA +softwareMeta.componentClass=Firmware +softwareMeta.componentManufacturer=BIOSVendorA +softwareMeta.componentManufacturerId=00213022 +softwareMeta.rimLinkHash=88f21d8e44d4271149297404df91caf207130bfa116582408abd04ede6db7f51 + +# Payload +n8060.envvarprefix=$ +n8060.envvarsuffix= +n8060.pathseparator=/ +directory.key=false +directory.location=/boot/iot/ +directory.name=iotBase +directory.root= +file.key= +file.name= +file.size= +file.version= +file.hash= diff --git a/tools/tcg_rim_tool/src/main/resources/swid_schema.xsd b/tools/tcg_rim_tool/src/main/resources/swid_schema.xsd new file mode 100644 index 00000000..e3d3d202 --- /dev/null +++ b/tools/tcg_rim_tool/src/main/resources/swid_schema.xsd @@ -0,0 +1,1338 @@ + + + + + + + + Schema for ISO-IEC 19770-2 Software Identification Tags + http://standards.iso.org/iso/19770/-2/2015/schema.xsd + + Copyright 2015 ISO/IEC, all rights reserved + + Copyright notice: ISO and IEC grant the users of this Standard the right + to use this XSD file free of charge for the purpose of implementing the + present Standard. + + Disclaimer: In no event shall ISO and/or IEC be liable for any damages + whatsoever (including, but not limited to, damages for loss of profits, + business interruption, loss of information, or any other pecuniary + loss) arising out of or related to the use of or inability to use the + XSD file. ISO and IEC disclaim all warranties, express or implied, + including but not limited to warranties of merchantability and fitness + for a particular purpose. + + + 2.0 + + + + + + + Represents the root element specifying data about a software component + + + + + + + + Attributes common to all Elements in this schema + + + + + + + Allow xml:lang attribute on any element. + + + + + + + + Allows any undeclared attributes on any element as long as the + attribute is placed in a different namespace. + + + + + + + + + + + + Specifies the organizations related to the software component + referenced by this SWID tag. + + + + + + + + An open-ended collection of elements that can be used to attach + arbitrary metadata to an Entity. + + + + + + + + + The name of the organization claiming a particular role in the + SWID tag. + + + + + + + + The regid of the organization. If the regid is unknown, the + value "invalid.unavailable" is provided by default (see + RFC 6761 for more details on the default value). + + + + + + + + The relationship between this organization and this tag e.g. tag, + softwareCreator, licensor, tagCreator, etc. The role of + tagCreator is required for every SWID tag. + + EntityRole may include any role value, but the pre-defined roles + include: aggregator, distributor, licensor, softwareCreator, + tagCreator + + Other roles will be defined as the market uses the SWID tags. + + + + + + + + this value provides a hexadecimal string that contains a hash + (or thumbprint) of the signing entities certificate. + + + + + + + + + + + + + + The element is used to provide results from a scan of a system + where software that does not have a SWID tag is discovered. + This information is not provided by the software creator, and + is instead created when a system is being scanned and the + evidence for why software is believed to be installed on the + device is provided in the Evidence element. + + + + + + Date and time the evidence was gathered. + + + + + + + + Identifier for the device the evidence was gathered from. + + + + + + + + + + + + + + Represents an individual file + + + + + + + Files that are considered important or required for the use of + a software component. Typical key files would be those which, + if not available on a system, would cause the software not to + execute. + + Key files will typically be used to validate that software + referenced by the SWID tag is actually installed on a specific + computing device + + + + + + + + The directory or location where a file was found or can expected + to be located. does not include the filename itself. This can + be relative path from the 'root' attribute. + + + + + + + + The filename without any path characters + + + + + + + + A system-specific root folder that the 'location' + attribute is an offset from. If this is not specified + the assumption is the 'root' is the same folder as + the location of the SWIDTAG. + + + + + + + + Permits any user-defined attributes in file tags + + + + + + + + + + + + + Provides the ability to apply a directory structure to the files + defined in a Payload or Evidence element. + + + + + + + + A Directory element allows one or more directories to be + defined in the file structure. + + + + + + + + A File element that allows one or more files to be specified + for a given location. + + + + + + + + + + + + + + + Represents an individual file + + + + + + + The file size in bytes of the file + + + + + + + + The file version + + + + + + + + + + + + + + Provides process information for data that will show up in a + devices process table. + + + + + + + The process name as it will be found in the devices process + table. + + + + + + + + The process ID for the executing process - note that this will + typically only be provided when the Process element is included as part + of Evidence. + + + + + + + + + + + + + + A container that can be used to provide arbitrary resource + information about an application installed on a device, or + evidence collected from a device. + + + + + + + The type of resource (ie, registrykey, port, rootUrl) + + + + + + + + + + + + + + This type is used by Payload to provide details on what may rbe + installed on a device, and by Evidence to indicate what an + inventory process discovered on a device. + + + + + + + + One or more directory elements + + + + + + + + One or more File elements + + + + + + + + One or more Process elements + + + + + + + + One or more generic resource elements + + + + + + + + + + + + + + + A reference to any another item (can include details that are + related to the SWID tag such as details on where software + downloads can be found, vulnerability database associations, + use rights, etc). + + This is modeled directly to match the HTML [LINK] element; it is + critical for streamlining software discovery scenarios that + these are kept consistent. + + + + + + + For installation media (rel="installationmedia") - dictates the + canonical name for the file. + + Items with the same artifact name should be considered mirrors + of each other (so download from wherever works). + + + + + + + + The link to the item being referenced. + + The href can point to several different things, and can be any + of the following: + + - a RELATIVE URI (no scheme) - which is interpreted depending on + context (ie, "./folder/supplemental.swidtag" ) + + - a physical file location with any system-acceptable + URI scheme (ie, file:// http:// https:// ftp:// ... etc ) + + - an URI with "swid:" as the scheme, which refers to another + swid by tagId. This URI would need to be resolved in the + context of the system by software that can lookup other + swidtags.( ie, "swid:2df9de35-0aff-4a86-ace6-f7dddd1ade4c" ) + + - an URI with "swidpath:" as the scheme, which refers to another + swid by an XPATH query. This URI would need to be resolved in + the context of the system by software that can lookup other + swidtags, and select the appropriate one based on an XPATH + query. Examples: + + swidpath://SoftwareIdentity[Entity/@regid='http://contoso.com'] + would retrieve all swidtags that had an entity where the + regid was Contoso + + swidpath://SoftwareIdentity[Meta/@persistentId='b0c55172-38e9-4e36-be86-92206ad8eddb'] + would retrieve swidtags that matched the persistentId + + See XPATH query standard : http://www.w3.org/TR/xpath20/ + + + + + + + + An attribute defined by the W3C Media Queries Recommendation + (see http://www.w3.org/TR/css3-mediaqueries/). + + A hint to the consumer of the link to what the target item is + applicable for. + + + + + + + + Determines the relative strength of ownership of the target + piece of software. + + + + + + + + The relationship between this SWID and the target file. + + Relationships can be identified by referencing the IANA + registration library - + https://www.iana.org/assignments/link-relations/link-relations.xhtml. + + + + + + + + The IANA MediaType for the target file; this provides the + consumer with intelligence of what to expect. + + See http://www.iana.org/assignments/media-types/media-types.xhtml + for more details on link type. + + + + + + + + Determines if the target software is a hard requirement or not + + + + + + + + + + + + + + An open-ended collection of key/value data related to this SWID. + + + + + + + Permits any user-defined attributes in Meta tags + + + + + + + + + + + + + + + + Specifies the organizations related to the software component + referenced by this SWID tag. + + This has a minOccurs of 1 because the spec declares that + you must have at least a Entity with role='tagCreator' + + + + + + + + This element is used to provide results from a scan of a + system where software that does not have a SWID tag is + discovered. This information is not provided by the + software creator, but is instead created when a system + is being scanned and the evidence for why software is + believed to be installed on the device is provided in the + Evidence element. + + + + + + + + A reference to any another item (can include details that + are related to the SWID tag such as details on where software + downloads can be found, vulnerability database associations, + use rights, etc). + + Note: This is modelled directly to match the HTML [LINK] + element; it is critical for streamlining software discovery + scenarios that these are kept consistent. + + + + + + + + An open-ended collection of key/value data related to this SWID. + + + + + + + + The items that may be installed on a device when the software is + installed. Note that Payload may be a superset of the items + installed and, depending on optimization systems for a device, + may or may not include every item that could be created or + executed on a device when software is installed. + + In general, payload will be used to indicate the files that + may be installed with a software product and will often be a + superset of those files (i.e. if a particular optional + component is not installed, the files associated with that + component may be included in payload, but not installed on + the device). + + + + + + + + Allows any undeclared elements in the SoftwareIdentity element + as long as the element is placed in a different namespace. + + As xs:any supercedes an xs:element declaration, this continues + to support digital signatures using the ds:Signature element: + + Signatures are not a mandatory part of the software + identification tag standard, and can be used as required + by any tag producer to ensure that sections of a tag are not + modified and/or to provide authentication of the signer. If + signatures are included in the software identification tag, + they shall follow the W3C recommendation defining the XML + signature syntax which provides message integrity + authentication as well as signer authentication services for + data of any type. + + + + + + + + + + Set to true, if this attribute specifies that this SWID tag is a + collection of information that describes the pre-installation + data of software component. + + + + + + + + Set to true if this SWID describes a product patch or + modification to a different software element. + + + + + + + + media is a hint to the tag consumer to understand what this + SWID tag applies to (see the [Link] tags media attribute). + + + + + + + + This attribute provides the software component name as it would + typically be referenced. For example, what would be seen in the + add/remove dialog on a Windows device, or what is specified as + the name of a packaged software product or a patch identifier + name on a Linux device. + + + + + + + + Specifies that this tag provides supplemental tag data that can + be merged with primary tag data to create a complete record of + the software information. + + Supplemental tags will often be provided at install time and may + be provided by different entities (such as the tag consumer, or + a Value Added Reseller). + + + + + + + + tagId shall be a globally unique identifier and should be + assigned a GUID reference (see ISO/IEC 19770-5 definition + for GUID). + + The tagID provides a unique reference for the specific product, + version, edition, revision, etc (essentially, the same binary + distribution). If two tagIDs match and the tagCreator is the + same, the underlying products they represent are expected to be + exactly the same. + + This allows IT systems to identify if a software item (for + example, a patch) is installed simply by referencing the + specific tagID value which is likely to be readily available + in a software inventory. + + It is recommended, when possible, that a 16 byte GUID + be used for this field as this provides global uniqueness without + a significant amount of overhead for space. + + If use of a 16 byte GUID is not possible, a text based globally + unique ID may be constructed, this ID should include a unique + naming authority for the tagCreator and sufficient additional + details that the tagId is unique for the software product, + version, edition, revision, etc. This would likely look as + follows (+ is used as a string concatenation symbol): + + regid + productName + version + edition + revision + ... + + + + + + + + The tagVersion indicates if a specific release of a software + product has more than one tag that can represent that specific + release. This may be the case if a software tag producer creates + and releases an incorrect tag that they subsequently want to fix, + but with no underlying changes to the product the SWID tag + represents. This could happen if, for example, a patch is + distributed that has a Link reference that does not cover all the + various software releases it can patch. A newer SWID tag for that + patch can be generated and the tagVersion value incremented to + indicate that the data is updated. + + + + + + + + Underlying development version for the software component. + + + + + + + + Scheme used for the version number. Some possible common values are: + + value="alphanumeric" + Strictly a string, sorting alphanumericaly + + value="decimal" + A floating point number : ( ie, 1.25 is less than 1.3 ) + + value="multipartnumeric" + Numbers seperated by dots, where the numbers are interpreted as + integers (ie, 1.2.3 , 1.4.5.6 , 1.2.3.4.5.6.7 ) + + value="multipartnumeric+suffix" + Numbers seperated by dots, where the numbers are interpreted as + integers with an additional string suffix: (ie, 1.2.3a) + + value="semver" + Follows the semver.org spec + + value="unknown" + Unknown, no attempt should be made to order these + + + + + + + + + + + + + + An open-ended collection of key/value data related to this SWID. + + The attributes included in this Element are predefined attributes + to ensure common usage across the industry. The schema allows for + any additional attribute to be included in a SWID tag, though it is + recommended that industry norms for new attributes are defined and + followed to the degree possible. + + + + + + + Identification of the activation status of this software title + (e.g. Trial, Serialized, Licensed, Unlicensed, etc). Typically, + this is used in supplemental tags. + + + + + + + + Provides information on which channel this particular + software was targeted for (e.g. Volume, Retail, OEM, + Academic, etc). Typically used in supplemental tags. + + + + + + + + The informal or colloquial version of the product (i.e. 2013). + Note that this version may be the same through multiple releases + of a software product where the version specified in + SoftwareEntity is much more specific and will change for each + software release. + + Note that this representation of version is typically used to + identify a group of specific software releases that are part of + the same release/support infrastructure + (i.e. Fabrikam Office 2013). This version is used for string + comparisons only and is not compared to be an earlier or later + release (that is done via the SoftwareEntity version). + + + + + + + + A longer, detailed description of the software. This description + can be multiple sentences (differentiated from summary which is + a very short, one-sentence description). + + + + + + + + The variation of the product (Extended, Enterprise, Professional, + Standard etc) + + + + + + + + An indicator to determine if there should be accompanying proof + of entitlement when a software license reconciliation is + completed. + + + + + + + + A vendor-specific textual key that can be used to reconcile the + validity of an entitlement. (e.g. serial number, product or + license key). + + + + + + + + The name of the software tool that created a SWID tag. This + element is typically used if tags are created on the fly, or + based on a catalogue based analysis for data found on a + computing device. + + + + + + + + A GUID used to represent products installed where the products + are related, but may be different versions. See one + representation of this value through the use of what, in a + windows installation process is referred to as an upgradeCode + - http://msdn.microsoft.com/en-us/library/aa372375(v=vs.85).aspx + as one example of the use of this value. + + + + + + + + The base name of the product (e.g. Office, Creative Suites, + Websphere, etc). + + + + + + + + The overall product family this software belongs to. Product + family is not used to identify that a product is part of a + suite, but is instead used when a set of products that are all + related may be installed on multiple different devices. + + For example, an Enterprise backup system may consist of a backup + server, multiple different backup systems that support mail + servers, databases and ERP systems as well as individual software + items that backup client devices. In this case all software + titles that are part of the backup system would have the same + productFamily name so they can be grouped together in reporting + systems. + + + + + + + + The informal or colloquial representation of the sub-version of + the given product (ie, SP1, R2, RC1, Beta 2, etc). Note that the + SoftwareIdentity.version will provide very exact version details, + the revision is intended for use in environments where reporting + on the informal or colloquial representation of the software is + important (for example, if for a certain business process, an + organization recognizes that it must have ServicePack 1 or later + of a specific product installed on all devices, they can use the + revision data value to quickly identify any devices that do not + meet this requirement). + + Depending on how a software organizations distributes revisions, + this value could be specified in a primary (if distributed as an + upgrade) or supplemental (if distributed as a patch) SWID tag. + + + + + + + + A short (one-sentence) description of the software. + + + + + + + + An 8 digit code that provides UNSPSC classification of the + software product this SWID tag identifies. For more + information see, http://www.unspsc.org/ + + + + + + + + The version of the UNSPSC code used to define the UNSPSC code + value. For more information see, http://www.unspsc.org/. + + + + + + + + + + + An expression that the document evaluator can use to determine if the + target of the link is applicable to the current platform (the host + environment) + + Used as an optimization hint to notify a system that it can + ignore something when it's not likely to be used. + + The format of this string is modeled upon the MediaQuery definition at + http://www.w3.org/TR/css3-mediaqueries/ + + This is one or more EXPRESSIONs where the items are connected + with an OPERATOR: + + media="EXPRESSION [[OPERATOR] [EXPRESSION]...]" + + EXPRESSION is processed case-insensitive and defined either : + (ENVIRONMENT) + indicates the presence of the environment + or + ([PREFIX-]ENVIRONMENT.ATTRIBUTE:VALUE) + indicates a comparison of an attribute of the environment. + + ENVIRONMENT is a text identifier that specifies any software,hardware + feature or aspect of the system the software is intended to run in. + + Common ENVIRONMENTs include (but not limited to): + linux + windows + java + powershell + ios + chipset + peripheral + + ATTRIBUTE is a property of an ENVIRONMENT with a specific value. + Common attributes include (but not limited to): + version + vendor + architecture + + PREFIX is defined as one of: + MIN # property has a minimum value of VALUE + MAX # property has a maximum value of VALUE + + if a PREFIX is not provided, then the property should equal VALUE + + OPERATOR is defined of one of: + AND + NOT + + Examples: + media="(windows)" + # applies to only systems that identify themselves as 'Windows' + + media="(windows) not (windows.architecture:x64)" + # applies to only systems that identify + # themselves as windows and are not for an x64 cpu + + media="(windows) and (min-windows.version:6.1)" + # applies to systems that identify themselves as + # windows and at least version 6.1 + + media="(linux) and (linux.vendor:redhat) and (min-linux.kernelversion:3.0)" + # applies to systems that identify themselves as + # linux, made by redhat and with a kernel version of at least 3.0 + + media="(freebsd) and (min-freebsd.kernelversion:6.6)" + # applies to systems that identify themselves as + # freebsd, with a kernel version of at least 6.6 + + media="(powershell) and (min-powershell.version:3.0)" + # applies to systems that have powershell 3.0 or greater + + Properties are expected to be able to be resolved by the host + environment without having to do significant computation. + + + + + + + + + The IANA MediaType for the target href; this provides the SWID tag + consumer with intelligence of what to expect. + + See http://www.iana.org/assignments/media-types/media-types.xhtml + for more details on link type. + + + + + + + + + + + + Determines the relative strength of ownership of the target + piece of software. + + + + + + + + If this is uninstalled, then the [Link]'d software should be removed + too. + + + + + + + + If this is uninstalled, then the [Link]'d software should be removed + if nobody else is sharing it + + + + + + + + + + + Determines if the target software is a hard requirement. + + + + + + + + The [Link]'d software is absolutely required for installation + + + + + + + + Not absolutely required, but install unless directed not to + + + + + + + + Not absolutely required, install only when asked + + + + + + + + \ No newline at end of file diff --git a/tools/tcg_rim_tool/src/test/java/hirs/swid/TestSwidTagGateway.java b/tools/tcg_rim_tool/src/test/java/hirs/swid/TestSwidTagGateway.java new file mode 100644 index 00000000..e82b9197 --- /dev/null +++ b/tools/tcg_rim_tool/src/test/java/hirs/swid/TestSwidTagGateway.java @@ -0,0 +1,128 @@ +package hirs.swid; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.util.Scanner; + +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.AfterClass; +import org.testng.annotations.Test; + +public class TestSwidTagGateway { + private SwidTagGateway gateway; + private String inputFile, outputFile, hashType; + private InputStream expectedFile; + private static final String TEST_CSV_INPUT = "testCsv.swidtag"; + private static final String TEST_BLANK_SWIDTAG = "generated_swidTag.swidtag"; + + @BeforeClass + public void setUp() throws Exception { + gateway = new SwidTagGateway(); + inputFile = TestSwidTagGateway.class.getClassLoader().getResource("examplecsv.csv").getFile(); + hashType = "SHA256"; + } + + @AfterClass + public void tearDown() throws Exception { + if (expectedFile != null) { + expectedFile.close(); + } + } + + @Test + public void testGenerateSwidTagStringStringString() { + outputFile = "testGenerateSwidTagStringStringString.swidtag"; + gateway.generateSwidTag(inputFile, outputFile, hashType); + expectedFile = (InputStream) TestSwidTagGateway.class.getClassLoader().getResourceAsStream(TEST_CSV_INPUT); + Assert.assertTrue(compareFileBytesToExpectedFile(outputFile)); + } + + @Test + public void testGenerateSwidTagFile() { + outputFile = "testGenerateSwidTagFile.swidtag"; + gateway.generateSwidTag(new File(outputFile)); + expectedFile = (InputStream) TestSwidTagGateway.class.getClassLoader().getResourceAsStream(TEST_BLANK_SWIDTAG); + Assert.assertTrue(compareFileBytesToExpectedFile(outputFile)); + } + + @Test + public void testValidateSwidTag() { + try { + Assert.assertTrue(gateway.validateSwidTag(TestSwidTagGateway.class.getClassLoader().getResource(TEST_BLANK_SWIDTAG).getPath())); + } catch (IOException e) { + Assert.fail("Invalid swidtag!"); + } + } + + @Test + public void testParsePayload() { + InputStream is = null; + try { + is = gateway.parsePayload(outputFile); + Scanner scanner = new Scanner(is, "UTF-8"); + String test = "PCR0,18382098108101841048"; + String temp = ""; + while (scanner.hasNext()) { + temp = scanner.next(); + } + Assert.assertEquals(test, temp); + } catch (IOException e) { + Assert.fail("Error parsing test file!"); + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException e) { + Assert.fail("Failed to close input stream!"); + } + } + } + } + + private boolean compareFileBytesToExpectedFile(String file) { + FileInputStream testFile = null; + try { + int data; + testFile = new FileInputStream(file); + while ((data = testFile.read()) != -1) { + int expected = expectedFile.read(); + if (data != expected) { + System.out.println("Expected: " + expected); + System.out.println("Got: " + data); + return false; + } + } + } catch (FileNotFoundException e) { + e.printStackTrace(); + return false; + } catch (IOException e) { + e.printStackTrace(); + return false; + } catch (NullPointerException e) { + e.printStackTrace(); + return false; + } finally { + if (testFile != null) { + try { + testFile.close(); + } catch (IOException e) { + e.printStackTrace(); + return false; + } + } + if (expectedFile != null) { + try { + expectedFile.close(); + } catch (IOException e) { + e.printStackTrace(); + return false; + } + } + } + return true; + } +} diff --git a/tools/tcg_rim_tool/src/test/resources/examplecsv.csv b/tools/tcg_rim_tool/src/test/resources/examplecsv.csv new file mode 100644 index 00000000..37d97688 --- /dev/null +++ b/tools/tcg_rim_tool/src/test/resources/examplecsv.csv @@ -0,0 +1,6 @@ +PCR0,18382098108101841048 + + + + + diff --git a/tools/tcg_rim_tool/src/test/resources/generated_swidTag.swidtag b/tools/tcg_rim_tool/src/test/resources/generated_swidTag.swidtag new file mode 100644 index 00000000..6c494993 --- /dev/null +++ b/tools/tcg_rim_tool/src/test/resources/generated_swidTag.swidtag @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tools/tcg_rim_tool/src/test/resources/testCsv.swidtag b/tools/tcg_rim_tool/src/test/resources/testCsv.swidtag new file mode 100644 index 00000000..7583802f --- /dev/null +++ b/tools/tcg_rim_tool/src/test/resources/testCsv.swidtag @@ -0,0 +1,7 @@ + + + + + + + diff --git a/tools/tcg_rim_tool/tcg_rim_tool.spec b/tools/tcg_rim_tool/tcg_rim_tool.spec new file mode 100644 index 00000000..2e2b2397 --- /dev/null +++ b/tools/tcg_rim_tool/tcg_rim_tool.spec @@ -0,0 +1,32 @@ +Name: tcg_rim_tool +Version: 1.0 +Release: 1%{?dist} +Summary: A java command-line tool to create PC client root RIM + +License: ASL 2.0 +URL: https://github.com/nsacyber/HIRS +Source0: %{name}.tar.gz + +BuildRequires: java-headless >= 1:1.8.0 + +%description +This tool will generate a root RIM file for PC clients in accordance with the schema located at http://standards.iso.org/iso/19770/-2/2015/schema.xsd. The generated RIM can either be empty if no arguments are given, or contain a payload if an input file is provided. The tool can also verify a given RIMfile against the schema. Use -h or --help to see a list of commands and uses. + + +%prep +%setup -q -c -n %{name} + + +%build +./gradlew build + +%install +mkdir -p %{buildroot}/opt/hirs/rim/ +cp build/libs/%{name}-%{version}.jar %{buildroot}/opt/hirs/rim/ + +%files +/opt/hirs/rim/%{name}-%{version}.jar + +%changelog +* Mon Jan 6 2020 chubtub +- First change