From 4a6115f443805e911f58cb168e33c0d9f5387cdc Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Fri, 21 Feb 2020 11:16:46 -0500 Subject: [PATCH] [#212] Added functionality to process and display RIM files. (#226) * Some initial additions to the details page for displaying Rim information. * Initial changes for uploading a rim file. * This is an update to the display of the Reference Integrity Manifest code base that'll allow a user to upload a swidtag. This code includes some additions from #217, slightly modified. * This code update include changes to import, archive and delete a swidtag into the RIM object. * This commit consolidated the SwidTagGatway code and Constants into Reference Manifest. * This is the final main push of code that will upload, process, store, retrive/delete and display the contents of a RIM swid tag. * Interim commit for demo purposes. * Updated Unit Tests * This commit adds the unit tests that weren't added in the previous commit * Updated code to reduce execution time when processing reference manifest objects. * Updated code for better GUI performance. * Removed previously added suppression entries. --- ...tionCertificateAuthorityConfiguration.java | 57 +- .../hirs/attestationca/portal/page/Page.java | 5 + .../CertificateRequestPageController.java | 27 +- ...eferenceManifestDetailsPageController.java | 151 ++ .../ReferenceManifestPageController.java | 304 +++- .../ReferenceManifestDetailsPageParams.java | 67 + .../util/CertificateStringMapBuilder.java | 17 - .../WEB-INF/jsp/certificate-details.jsp | 30 +- .../WEB-INF/jsp/reference-manifests.jsp | 8 +- .../main/webapp/WEB-INF/jsp/rim-details.jsp | 163 ++ .../src/main/webapp/common/common.css | 2 +- .../src/main/webapp/common/common.js | 35 +- ...ementKeyCredentialsPageControllerTest.java | 2 +- ...PlatformCredentialsPageControllerTest.java | 2 +- ...enceManifestDetailsPageControllerTest.java | 107 ++ .../ReferenceManifestPageControllerTest.java | 189 +++ ...rustChainManagementPageControllerTest.java | 4 +- .../test/resources/rims/generated_bad.swidtag | 12 + .../resources/rims/generated_good.swidtag | 51 + HIRS_Utils/config/checkstyle/suppressions.xml | 1 + HIRS_Utils/config/findbugs/suppressions.xml | 3 + .../hirs/data/persist/ReferenceManifest.java | 989 +++++++++++- .../java/hirs/data/persist/SwidResource.java | 115 ++ .../persist/DBReferenceManifestManager.java | 88 ++ .../persist/ReferenceManifestManager.java | 12 +- .../persist/ReferenceManifestSelector.java | 190 +++ .../main/java/hirs/utils/xjc/BaseElement.java | 97 ++ .../utils/xjc/CanonicalizationMethodType.java | 105 ++ .../java/hirs/utils/xjc/DSAKeyValueType.java | 200 +++ .../java/hirs/utils/xjc/DigestMethodType.java | 106 ++ .../main/java/hirs/utils/xjc/Directory.java | 80 + .../src/main/java/hirs/utils/xjc/Entity.java | 188 +++ .../main/java/hirs/utils/xjc/Evidence.java | 91 ++ .../src/main/java/hirs/utils/xjc/File.java | 89 ++ .../java/hirs/utils/xjc/FilesystemItem.java | 138 ++ .../main/java/hirs/utils/xjc/KeyInfoType.java | 135 ++ .../java/hirs/utils/xjc/KeyValueType.java | 89 ++ .../src/main/java/hirs/utils/xjc/Link.java | 214 +++ .../java/hirs/utils/xjc/ManifestType.java | 108 ++ .../src/main/java/hirs/utils/xjc/Meta.java | 41 + .../java/hirs/utils/xjc/ObjectFactory.java | 844 +++++++++++ .../main/java/hirs/utils/xjc/ObjectType.java | 160 ++ .../main/java/hirs/utils/xjc/Ownership.java | 85 ++ .../main/java/hirs/utils/xjc/PGPDataType.java | 103 ++ .../src/main/java/hirs/utils/xjc/Process.java | 89 ++ .../java/hirs/utils/xjc/RSAKeyValueType.java | 85 ++ .../java/hirs/utils/xjc/ReferenceType.java | 194 +++ .../main/java/hirs/utils/xjc/Resource.java | 64 + .../hirs/utils/xjc/ResourceCollection.java | 86 ++ .../hirs/utils/xjc/RetrievalMethodType.java | 117 ++ .../java/hirs/utils/xjc/SPKIDataType.java | 81 + .../hirs/utils/xjc/SignatureMethodType.java | 110 ++ .../utils/xjc/SignaturePropertiesType.java | 108 ++ .../hirs/utils/xjc/SignaturePropertyType.java | 136 ++ .../java/hirs/utils/xjc/SignatureType.java | 181 +++ .../hirs/utils/xjc/SignatureValueType.java | 92 ++ .../java/hirs/utils/xjc/SignedInfoType.java | 157 ++ .../java/hirs/utils/xjc/SoftwareIdentity.java | 344 +++++ .../java/hirs/utils/xjc/SoftwareMeta.java | 400 +++++ .../java/hirs/utils/xjc/TransformType.java | 111 ++ .../java/hirs/utils/xjc/TransformsType.java | 76 + .../src/main/java/hirs/utils/xjc/Use.java | 83 + .../java/hirs/utils/xjc/X509DataType.java | 99 ++ .../hirs/utils/xjc/X509IssuerSerialType.java | 91 ++ .../java/hirs/utils/xjc/package-info.java | 10 + HIRS_Utils/src/main/resources/swid_schema.xsd | 1338 +++++++++++++++++ 66 files changed, 9386 insertions(+), 170 deletions(-) create mode 100644 HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageController.java create mode 100644 HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/params/ReferenceManifestDetailsPageParams.java create mode 100644 HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp create mode 100644 HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageControllerTest.java create mode 100644 HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageControllerTest.java create mode 100644 HIRS_AttestationCAPortal/src/test/resources/rims/generated_bad.swidtag create mode 100644 HIRS_AttestationCAPortal/src/test/resources/rims/generated_good.swidtag create mode 100644 HIRS_Utils/src/main/java/hirs/data/persist/SwidResource.java create mode 100644 HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestSelector.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/BaseElement.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/CanonicalizationMethodType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/DSAKeyValueType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/DigestMethodType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Directory.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Entity.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Evidence.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/File.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/FilesystemItem.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/KeyInfoType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/KeyValueType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Link.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/ManifestType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Meta.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectFactory.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Ownership.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/PGPDataType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Process.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/RSAKeyValueType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/ReferenceType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Resource.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/ResourceCollection.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/RetrievalMethodType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SPKIDataType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureMethodType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertiesType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertyType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureValueType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SignedInfoType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareIdentity.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareMeta.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/TransformType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/TransformsType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/Use.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/X509DataType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/X509IssuerSerialType.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/xjc/package-info.java create mode 100644 HIRS_Utils/src/main/resources/swid_schema.xsd diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/AttestationCertificateAuthorityConfiguration.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/AttestationCertificateAuthorityConfiguration.java index 27708ecb..48f07eea 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/AttestationCertificateAuthorityConfiguration.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/configuration/AttestationCertificateAuthorityConfiguration.java @@ -35,33 +35,36 @@ import hirs.persist.DBDeviceGroupManager; import hirs.persist.DBDeviceManager; import hirs.persist.DeviceGroupManager; import hirs.persist.DeviceManager; +import hirs.persist.ReferenceManifestManager; +import hirs.persist.DBReferenceManifestManager; import hirs.persist.HibernateConfiguration; import hirs.structs.converters.SimpleStructConverter; import hirs.structs.converters.StructConverter; import hirs.utils.LogConfigurationUtil; /** - * Provides application context configuration for the Attestation Certificate Authority - * application. The properties are processed in order and as such, the last property file read in - * will override properties that may had already been defined previously. In other words, the - * 'defaults.properties' file provides a basic standard of properties that can be overrode by the + * Provides application context configuration for the Attestation Certificate + * Authority application. The properties are processed in order and as such, the + * last property file read in will override properties that may had already been + * defined previously. In other words, the 'defaults.properties' file provides a + * basic standard of properties that can be overrode by the */ @Configuration @PropertySources({ - @PropertySource(value = "classpath:defaults.properties"), + @PropertySource(value = "classpath:defaults.properties"), - // detects if file exists, if not, ignore errors - @PropertySource(value = "file:/etc/hirs/aca/aca.properties", - ignoreResourceNotFound = true) + // detects if file exists, if not, ignore errors + @PropertySource(value = "file:/etc/hirs/aca/aca.properties", + ignoreResourceNotFound = true) }) @ComponentScan({ "hirs.attestationca", "hirs.attestationca.service", "hirs.attestationca.rest", - "hirs.validation", "hirs.data.service" }) + "hirs.validation", "hirs.data.service" }) @Import(HibernateConfiguration.class) @EnableWebMvc public class AttestationCertificateAuthorityConfiguration extends WebMvcConfigurerAdapter { - private static final Logger LOG = - LogManager.getLogger(AttestationCertificateAuthorityConfiguration.class); + private static final Logger LOG + = LogManager.getLogger(AttestationCertificateAuthorityConfiguration.class); static { try { @@ -91,10 +94,9 @@ public class AttestationCertificateAuthorityConfiguration extends WebMvcConfigur @Autowired private LocalSessionFactoryBean sessionFactory; - /** - * @return bean to resolve injected annotation.Value - * property expressions for beans. + * @return bean to resolve injected annotation.Value property expressions + * for beans. */ @Bean public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() { @@ -102,8 +104,9 @@ public class AttestationCertificateAuthorityConfiguration extends WebMvcConfigur } /** - * Initialization of the ACA. Detects environment and runs configuration methods as required. - * This method is intended to be invoked by the Spring application context. + * Initialization of the ACA. Detects environment and runs configuration + * methods as required. This method is intended to be invoked by the Spring + * application context. */ @PostConstruct void initialize() { @@ -184,7 +187,8 @@ public class AttestationCertificateAuthorityConfiguration extends WebMvcConfigur } /** - * @return the {@link java.security.KeyStore} that contains the certificates for the ACA. + * @return the {@link java.security.KeyStore} that contains the certificates + * for the ACA. */ @Bean public KeyStore keyStore() { @@ -198,16 +202,17 @@ public class AttestationCertificateAuthorityConfiguration extends WebMvcConfigur } catch (Exception e) { LOG.error(String.format( "Encountered error while loading ACA key store. The most common issue is " - + "that configured password does not work on the configured key" - + " store %s.", keyStorePath)); + + "that configured password does not work on the configured key" + + " store %s.", keyStorePath)); LOG.error(String.format("Exception message: %s", e.getMessage())); throw new BeanInitializationException(e.getMessage(), e); } } /** - * Prototyped {@link StructConverter}. In other words, all instances returned by this method - * will be configured identically, but subsequent invocations will return a new instance. + * Prototyped {@link StructConverter}. In other words, all instances + * returned by this method will be configured identically, but subsequent + * invocations will return a new instance. * * @return ready to use {@link StructConverter}. */ @@ -237,6 +242,16 @@ public class AttestationCertificateAuthorityConfiguration extends WebMvcConfigur return new DBDeviceManager(sessionFactory.getObject()); } + /** + * Creates a {@link ReferenceManifestManager} ready to use. + * + * @return {@link ReferenceManifestManager} + */ + @Bean + public ReferenceManifestManager referenceManifestManager() { + return new DBReferenceManifestManager(sessionFactory.getObject()); + } + @Override public void addResourceHandlers(final ResourceHandlerRegistry resourceHandlerRegistry) { resourceHandlerRegistry.addResourceHandler("/client-files/**") diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/Page.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/Page.java index 4b04be6d..52d9a196 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/Page.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/Page.java @@ -49,6 +49,11 @@ public enum Page { */ REFERENCE_MANIFESTS("Reference Integrity Manifests", "ic_important_devices", "first"), + /** + * Non-menu page to display rims. + */ + RIM_DETAILS("Reference Integrity Manifest Details", + "", null, true, false, null, null), /** * Page that manages Attestation CA Policy. */ diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java index b8d106dc..acbdf711 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/CertificateRequestPageController.java @@ -182,7 +182,7 @@ public class CertificateRequestPageController extends PageController { + + private final ReferenceManifestManager referenceManifestManager; + private static final Logger LOGGER = + LogManager.getLogger(ReferenceManifestDetailsPageController.class); + + /** + * Constructor providing the Page's display and routing specification. + * @param referenceManifestManager the reference manifest manager + */ + @Autowired + public ReferenceManifestDetailsPageController( + final ReferenceManifestManager referenceManifestManager) { + super(Page.RIM_DETAILS); + this.referenceManifestManager = referenceManifestManager; + } + + /** + * + * @param params The object to map url parameters into. + * @param model The data model for the request. Can contain data from + * redirect. + * @return the path for the view and data model for the page. + */ + @Override + public ModelAndView initPage(final ReferenceManifestDetailsPageParams params, + final Model model) { + // get the basic information to render the page + ModelAndView mav = getBaseModelAndView(); + PageMessages messages = new PageMessages(); + + // Map with the rim information + HashMap data = new HashMap<>(); + + // Check if parameters were set + if (params.getId() == null) { + String typeError = "ID was not provided"; + messages.addError(typeError); + LOGGER.error(typeError); + mav.addObject(MESSAGES_ATTRIBUTE, messages); + } else { + try { + UUID uuid = UUID.fromString(params.getId()); + data.putAll(getRimDetailInfo(uuid, referenceManifestManager)); + } catch (IllegalArgumentException iaEx) { + String uuidError = "Failed to parse ID from: " + params.getId(); + messages.addError(uuidError); + LOGGER.error(uuidError, iaEx); + } catch (Exception ioEx) { + LOGGER.error(ioEx); + } + if (data.isEmpty()) { + String notFoundMessage = "Unable to find RIM with ID: " + params.getId(); + messages.addError(notFoundMessage); + LOGGER.warn(notFoundMessage); + mav.addObject(MESSAGES_ATTRIBUTE, messages); + } else { + mav.addObject(INITIAL_DATA, data); + } + } + + // return the model and view + return mav; + } + + /** + * This method takes the place of an entire class for a string builder. + * Gathers all information and returns it for displays. + * @param uuid database reference for the requested RIM. + * @param referenceManifestManager the reference manifest manager. + * @return mapping of the RIM information from the database. + */ + public static HashMap getRimDetailInfo(final UUID uuid, + final ReferenceManifestManager referenceManifestManager) { + HashMap data = new HashMap<>(); + + ReferenceManifest rim = ReferenceManifest + .select(referenceManifestManager) + .byEntityId(uuid).getRIM(); + + if (rim != null) { + // Software Identity + data.put("swidName", rim.getSwidName()); + data.put("swidVersion", rim.getSwidVersion()); + data.put("swidCorpus", Boolean.toString(rim.isSwidCorpus())); + data.put("swidPatch", Boolean.toString(rim.isSwidPatch())); + data.put("swidSupplemental", Boolean.toString( + rim.isSwidSupplemental())); + data.put("swidTagId", rim.getTagId()); + // Entity + data.put("entityName", rim.getEntityName()); + data.put("entityRegId", rim.getEntityRegId()); + data.put("entityRole", rim.getEntityRole()); + data.put("entityThumbprint", rim.getEntityThumbprint()); + // Link + data.put("linkHref", rim.getLinkHref()); + data.put("linkRel", rim.getLinkRel()); + + data.put("platformManufacturer", rim.getPlatformManufacturer()); + data.put("platformManufacturerId", rim.getPlatformManufacturerId()); + data.put("platformModel", rim.getPlatformModel()); + data.put("platformVersion", rim.getPlatformVersion()); + data.put("firmwareVersion", rim.getFirmwareVersion()); + data.put("payloadType", rim.getPayloadType()); + data.put("colloquialVersion", rim.getColloquialVersion()); + data.put("edition", rim.getEdition()); + data.put("product", rim.getProduct()); + data.put("revision", rim.getRevision()); + data.put("bindingSpec", rim.getBindingSpec()); + data.put("bindingSpecVersion", rim.getBindingSpecVersion()); + data.put("pcUriGlobal", rim.getPcURIGlobal()); + data.put("pcUriLocal", rim.getPcURILocal()); + data.put("rimLinkHash", rim.getRimLinkHash()); + + // checkout later + data.put("rimType", rim.getRimType()); + data.put("swidFiles", rim.parseResource()); + } else { + LOGGER.error(String.format("Unable to find Reference Integrity " + + "Manifest with ID: %s", uuid)); + } + + return data; + } +} diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java index 418dee9f..f8c6e8e8 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java @@ -5,35 +5,53 @@ import hirs.attestationca.portal.datatables.DataTableInput; import hirs.attestationca.portal.datatables.DataTableResponse; import hirs.attestationca.portal.page.Page; import hirs.attestationca.portal.page.PageController; -import hirs.attestationca.portal.page.params.ReferenceManifestPageParams; import hirs.FilteredRecordsList; +import hirs.attestationca.portal.datatables.OrderedListQueryDataTableAdapter; +import hirs.attestationca.portal.page.PageMessages; +import hirs.attestationca.portal.page.params.NoPageParams; +import hirs.persist.DBManagerException; import hirs.persist.ReferenceManifestManager; +import hirs.persist.CriteriaModifier; import hirs.data.persist.ReferenceManifest; +import hirs.data.persist.certificate.Certificate; +import java.io.IOException; +import java.net.URISyntaxException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.HashMap; +import java.util.Map; +import java.util.UUID; +import javax.servlet.http.HttpServletResponse; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.criterion.Restrictions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import org.springframework.web.servlet.view.RedirectView; /** - * Controller for the Certificate Details page. + * Controller for the Reference Manifest page. */ @Controller @RequestMapping("/reference-manifests") public class ReferenceManifestPageController -extends PageController { +extends PageController { private static final String BIOS_RELEASE_DATE_FORMAT = "yyyy-MM-dd"; @@ -45,9 +63,9 @@ extends PageController { /** * This class was created for the purposes of avoiding findbugs message: * As the JavaDoc states, DateFormats are inherently unsafe for - * multithreaded use. The detector has found a call to an instance + * multi-threaded use. The detector has found a call to an instance * of DateFormat that has been obtained via a static field. - * This looks suspicous. + * This looks suspicious. * * This class can have uses elsewhere but for now it will remain here. */ @@ -102,20 +120,21 @@ extends PageController { * @return the path for the view and data model for the page. */ @Override - public ModelAndView initPage(final ReferenceManifestPageParams params, + public ModelAndView initPage(final NoPageParams params, final Model model) { return getBaseModelAndView(); } /** - * Returns the list of RIMs using the datatable input for paging, + * Returns the list of RIMs using the data table input for paging, * ordering, and filtering. * @param input the data tables input * @return the data tables response, including the result set * and paging information */ @ResponseBody - @RequestMapping(value = "list", produces = MediaType.APPLICATION_JSON_VALUE, + @RequestMapping(value = "/list", + produces = MediaType.APPLICATION_JSON_VALUE, method = RequestMethod.GET) public DataTableResponse getTableData( final DataTableInput input) { @@ -124,9 +143,276 @@ extends PageController { String orderColumnName = input.getOrderColumnName(); LOGGER.debug("Ordering on column: " + orderColumnName); + // check that the alert is not archived and that it is in the specified report + CriteriaModifier criteriaModifier = new CriteriaModifier() { + @Override + public void modify(final Criteria criteria) { + criteria.add(Restrictions.isNull(Certificate.ARCHIVE_FIELD)); + + } + }; FilteredRecordsList records - = new FilteredRecordsList<>(); + = OrderedListQueryDataTableAdapter.getOrderedList( + ReferenceManifest.class, + referenceManifestManager, + input, orderColumnName, criteriaModifier); + + LOGGER.debug("Returning list of size: " + records.size()); return new DataTableResponse<>(records, input); } + + /** + * Upload and processes a reference manifest(s). + * + * @param files the files to process + * @param attr the redirection attributes + * @return the redirection view + * @throws URISyntaxException if malformed URI + * @throws Exception if malformed URI + */ + @RequestMapping(value = "/upload", method = RequestMethod.POST) + protected RedirectView upload( + @RequestParam("file") final MultipartFile[] files, + final RedirectAttributes attr) throws URISyntaxException, Exception { + Map model = new HashMap<>(); + PageMessages messages = new PageMessages(); + + // loop through the files + for (MultipartFile file : files) { + //Parse reference manifests + ReferenceManifest rims = parseRIMs(file, messages); + + //Store only if it was parsed + if (rims != null) { + storeManifest(file.getOriginalFilename(), + messages, + rims, + referenceManifestManager); + } + } + + //Add messages to the model + model.put(MESSAGES_ATTRIBUTE, messages); + + return redirectTo(Page.REFERENCE_MANIFESTS, + new NoPageParams(), model, attr); + } + + /** + * Archives (soft delete) the Reference Integrity Manifest entry. + * + * @param id the UUID of the rim to delete + * @param attr RedirectAttributes used to forward data back to the original + * page. + * @return redirect to this page + * @throws URISyntaxException if malformed URI + */ + @RequestMapping(value = "/delete", method = RequestMethod.POST) + public RedirectView delete(@RequestParam final String id, + final RedirectAttributes attr) throws URISyntaxException { + LOGGER.info("Handling request to delete " + id); + + Map model = new HashMap<>(); + PageMessages messages = new PageMessages(); + + try { + ReferenceManifest referenceManifest = getRimFromDb(id); + + if (referenceManifest == null) { + String notFoundMessage = "Unable to locate RIM with ID: " + id; + messages.addError(notFoundMessage); + LOGGER.warn(notFoundMessage); + } else { + referenceManifest.archive(); + referenceManifestManager.update(referenceManifest); + + String deleteCompletedMessage = "RIM successfully deleted"; + messages.addInfo(deleteCompletedMessage); + LOGGER.info(deleteCompletedMessage); + } + } catch (IllegalArgumentException ex) { + String uuidError = "Failed to parse ID from: " + id; + messages.addError(uuidError); + LOGGER.error(uuidError, ex); + } catch (DBManagerException ex) { + String dbError = "Failed to archive cert: " + id; + messages.addError(dbError); + LOGGER.error(dbError, ex); + } + + model.put(MESSAGES_ATTRIBUTE, messages); + return redirectTo(Page.REFERENCE_MANIFESTS, new NoPageParams(), model, attr); + } + + /** + * Handles request to download the rim by writing it to the response stream + * for download. + * + * @param id the UUID of the rim to download + * @param response the response object (needed to update the header with the + * file name) + * @throws java.io.IOException when writing to response output stream + */ + @RequestMapping(value = "/download", method = RequestMethod.GET) + public void download(@RequestParam final String id, + final HttpServletResponse response) + throws IOException { + LOGGER.info("Handling RIM request to download " + id); + + try { + ReferenceManifest referenceManifest = getRimFromDb(id); + + if (referenceManifest == null) { + String notFoundMessage = "Unable to locate RIM with ID: " + id; + LOGGER.warn(notFoundMessage); + // send a 404 error when invalid Reference Manifest + response.sendError(HttpServletResponse.SC_NOT_FOUND); + } else { + StringBuilder fileName = new StringBuilder("filename=\""); + fileName.append(referenceManifest.getSwidName()); + fileName.append("_["); + fileName.append(referenceManifest.getRimHash()); + fileName.append("]"); + fileName.append(".swidTag\""); + + // Set filename for download. + response.setHeader("Content-Disposition", "attachment;" + fileName); + response.setContentType("application/octet-stream"); + + // write cert to output stream + response.getOutputStream().write(referenceManifest.getRimBytes()); + } + } catch (IllegalArgumentException ex) { + String uuidError = "Failed to parse ID from: " + id; + LOGGER.error(uuidError, ex); + // send a 404 error when invalid certificate + response.sendError(HttpServletResponse.SC_NOT_FOUND); + } + } + + /** + * This method takes the parameter and looks for this information in the + * Database. + * + * @param id of the RIM + * @return the associated RIM from the DB + * @throws IllegalArgumentException + */ + private ReferenceManifest getRimFromDb(final String id) throws IllegalArgumentException { + UUID uuid = UUID.fromString(id); + + return ReferenceManifest + .select(referenceManifestManager) + .byEntityId(uuid).getRIM(); + } + + /** + * Takes the rim files provided and returns a {@link ReferenceManifest} + * object. + * @param file the provide user file via browser. + * @param messages the object that handles displaying information to the + * user. + * @return a single or collection of reference manifest files. + */ + private ReferenceManifest parseRIMs( + final MultipartFile file, + final PageMessages messages) { + + byte[] fileBytes; + String fileName = file.getOriginalFilename(); + + // build the manifest from the uploaded bytes + try { + fileBytes = file.getBytes(); + } catch (IOException e) { + final String failMessage + = String.format("Failed to read uploaded file (%s): ", fileName); + LOGGER.error(failMessage, e); + messages.addError(failMessage + e.getMessage()); + return null; + } + + try { + return new ReferenceManifest(fileBytes); + // the this is a List is object is a JaxBElement that can + // be matched up to the QName + } catch (IOException ioEx) { + final String failMessage + = String.format("Failed to parse uploaded file (%s): ", fileName); + LOGGER.error(failMessage, ioEx); + messages.addError(failMessage + ioEx.getMessage()); + return null; + } + } + + /** + * Stores the {@link ReferenceManifest} objects. + * @param fileName name of the file given + * @param messages message object for user display of statuses + * @param referenceManifest the object to store + * @param referenceManifestManager the class that handles the storage + * process. + */ + private void storeManifest( + final String fileName, + final PageMessages messages, + final ReferenceManifest referenceManifest, + final ReferenceManifestManager referenceManifestManager) { + + ReferenceManifest existingManifest; + + // look for existing manifest in the database + try { + existingManifest = ReferenceManifest + .select(referenceManifestManager) + .includeArchived() + .byHashCode(referenceManifest.getRimHash()) + .getRIM(); + } catch (DBManagerException e) { + final String failMessage = String.format("Querying for existing certificate " + + "failed (%s): ", fileName); + messages.addError(failMessage + e.getMessage()); + LOGGER.error(failMessage, e); + return; + } + + try { + // save the new certificate if no match is found + if (existingManifest == null) { + referenceManifestManager.save(referenceManifest); + + final String successMsg = String.format("New RIM successfully uploaded (%s): ", + fileName); + messages.addSuccess(successMsg); + LOGGER.info(successMsg); + return; + } + } catch (DBManagerException dbmEx) { + final String failMessage = String.format("Storing new RIM failed (%s): ", fileName); + messages.addError(failMessage + dbmEx.getMessage()); + LOGGER.error(failMessage, dbmEx); + return; + } + + try { + // if an identical RIM is archived, update the existing RIM to + // unarchive it and change the creation date + if (existingManifest.isArchived()) { + existingManifest.restore(); + existingManifest.resetCreateTime(); + referenceManifestManager.update(existingManifest); + + final String successMsg + = String.format("Pre-existing RIM found and unarchived (%s): ", fileName); + messages.addSuccess(successMsg); + LOGGER.info(successMsg); + } + } catch (DBManagerException dbmEx) { + final String failMessage = String.format("Found an identical pre-existing RIM in the " + + "archive, but failed to unarchive it (%s): ", fileName); + messages.addError(failMessage + dbmEx.getMessage()); + LOGGER.error(failMessage, dbmEx); + } + } } diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/params/ReferenceManifestDetailsPageParams.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/params/ReferenceManifestDetailsPageParams.java new file mode 100644 index 00000000..9abf51cc --- /dev/null +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/params/ReferenceManifestDetailsPageParams.java @@ -0,0 +1,67 @@ + +package hirs.attestationca.portal.page.params; + +import hirs.attestationca.portal.page.PageParams; +import java.util.LinkedHashMap; + +/** + * URL parameters object for the Reference Manifest Details page and controller. + */ +public class ReferenceManifestDetailsPageParams implements PageParams { + + private String id; + + /** + * Constructor to set all RIM Details URL parameters. + * + * @param id the String parameter to set + */ + public ReferenceManifestDetailsPageParams(final String id) { + this.id = id; + } + + /** + * Default constructor for Spring. + * + */ + public ReferenceManifestDetailsPageParams() { + this.id = null; + } + + /** + * Returns the String id parameter. + * + * @return the String id parameter. + */ + public String getId() { + return id; + } + + /** + * Sets the String id parameter. + * + * @param id the String id parameter. + */ + public void setId(final String id) { + this.id = id; + } + + /** + * Allows PageController to iterate over the url parameters. + * + * @return map containing the object's URL parameters. + */ + @Override + public LinkedHashMap asMap() { + LinkedHashMap map = new LinkedHashMap<>(); + map.put("id", id); + return map; + } + + @Override + public String toString() { + return "ReferenceManifestDetailsPageParams{" + + "id:' " + id + + "}"; + } +} diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java index 2a09f63e..1b1691e8 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/util/CertificateStringMapBuilder.java @@ -20,7 +20,6 @@ import hirs.data.persist.certificate.IssuedAttestationCertificate; import hirs.data.persist.certificate.attributes.ComponentIdentifier; import hirs.data.persist.certificate.attributes.PlatformConfiguration; import hirs.persist.CertificateManager; -import hirs.persist.ReferenceManifestManager; import hirs.utils.BouncyCastleUtils; import java.util.Collections; @@ -491,20 +490,4 @@ public final class CertificateStringMapBuilder { } return data; } - - /** - * Returns the Reference Integrity Manifest information. - * - * @param uuid ID for the reference integrity manifest. - * @param referenceManifestManager the reference manifest - * manager for retrieving certs. - * @return a hash map with the reference manifest manager. - */ - public static HashMap getReferenceManifestInformation(final UUID uuid, - final ReferenceManifestManager referenceManifestManager) { - HashMap data = new HashMap<>(); - - - return data; - } } diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp index 73a8c6ee..7b0c1c7e 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/certificate-details.jsp @@ -35,12 +35,6 @@ - - Reference Integrity Manifest - - - - Unknown Certificate @@ -106,18 +100,22 @@
Subject
${initialData.subject}
- -
-
Serial Number
-
-
-
-
Validity
-
-
Not Before: ${initialData.beginValidity}
-
Not After: ${initialData.endValidity}
+ + +
+
Serial Number
+
+
+ +
+
Validity
+
+
Not Before: ${initialData.beginValidity}
+
Not After: ${initialData.endValidity}
+
+
Signature
diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/reference-manifests.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/reference-manifests.jsp index c15ac0d1..b4d5cda5 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/reference-manifests.jsp +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/reference-manifests.jsp @@ -46,8 +46,8 @@ var columns = [ {data: 'tagId'}, {data: 'rimType'}, - {data: 'manufacturer'}, - {data: 'model'}, + {data: 'platformManufacturer'}, + {data: 'platformModel'}, {data: 'firmwareVersion'}, { data: 'id', @@ -58,8 +58,8 @@ // sets up a hidden input field containing the ID which is // used as a parameter to the REST POST call to delete var html = ''; - html += certificateDetailsLink('referencemanifest', full.id, true); - html += certificateDownloadLink(full.id, pagePath); + html += rimDetailsLink(full.id); + html += rimDownloadLink(full.id, pagePath); html += certificateDeleteLink(full.id, pagePath); return html; diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp new file mode 100644 index 00000000..325f55ef --- /dev/null +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp @@ -0,0 +1,163 @@ +<%@ page contentType="text/html"%> +<%@ page pageEncoding="UTF-8"%><%-- JSP TAGS--%> +<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> +<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%> +<%@taglib prefix="form" uri="http://www.springframework.org/tags/form"%> +<%@taglib prefix="fn" uri = "http://java.sun.com/jsp/jstl/functions" %> +<%@taglib prefix="my" tagdir="/WEB-INF/tags"%><%--CONTENT--%> + + + + + + Reference Integrity Manifest + + + + + + +
+
+
Software Identity
+
+
SWID Name: ${initialData.swidName}
+
SWID Version: ${initialData.swidVersion}
+
SWID Tag ID: ${initialData.swidTagId}
+
SWID Tag Version: 
+ +
SWID Corpus:  +
+
+ +
SWID Patch:  +
+
+ +
SWID Supplemental:  +
+
+
+
+
+
Entity
+
+
Entity Name: ${initialData.entityName}
+ +
Entity Reg ID: ${initialData.entityRegId}
+
+
Entity Role: ${initialData.entityRole}
+
Entity Thumbprint: ${initialData.entityThumbprint}
+
+
+
+
Link
+ +
+
+
Meta
+ +
+
+
+
Support RIM(s)
+
+
+ +
+
+ + + +
+ +
+ +
+
+
+ ${resource.getName()} + +
+
+ File Size: + ${resource.getSize()}
+ Hash: + ${resource.getHashValue()}
+ + RIM Format: + ${resource.getRimFormat()}
+
+ + RIM Type: + ${resource.getRimType()}
+
+ + URI Global: + ${resource.getRimUriGlobal()}
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ + \ No newline at end of file diff --git a/HIRS_AttestationCAPortal/src/main/webapp/common/common.css b/HIRS_AttestationCAPortal/src/main/webapp/common/common.css index e333960d..0f382886 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/common/common.css +++ b/HIRS_AttestationCAPortal/src/main/webapp/common/common.css @@ -214,7 +214,7 @@ body { padding-left: 30px; } -/*turst chain*/ +/*trust chain*/ #aca-cert-viewer .row { display: -webkit-box; display: -webkit-flex; diff --git a/HIRS_AttestationCAPortal/src/main/webapp/common/common.js b/HIRS_AttestationCAPortal/src/main/webapp/common/common.js index 0888efc8..54ad5b3c 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/common/common.js +++ b/HIRS_AttestationCAPortal/src/main/webapp/common/common.js @@ -74,7 +74,7 @@ function setDataTables(id, url, columns) { * @param type of certificate * @param id of the certificate * @param sameType boolean indicating if the details is the same -* certificatr type. +* certificate type. */ function certificateDetailsLink(type, id, sameType){ var href = portal + '/certificate-details?id=' + id + '&type=' + type; @@ -107,6 +107,24 @@ function certificateDetailsLink(type, id, sameType){ return html; } +/** +* Create a RIM details like for the specified rim. +* type and ID with the corresponding icon. +* @param id of the rim +*/ +function rimDetailsLink(id){ + var href = portal + '/rim-details?id=' + id; + var title = ""; + var icon = icons; + + title = "Details"; + icon += '/ic_assignment_black_24dp.png'; + + var html = '' + + ''; + return html; +} + /** * Create a certificate delete link for the specified ID * @param id of the certificate @@ -135,5 +153,20 @@ function certificateDownloadLink(id, pagePath){ var html = '' + ''; + return html; +} + +/** +* Create a rim download link for the specified ID +* @param id of the rim +* @param pagePath path to the link +*/ +function rimDownloadLink(id, pagePath){ + var icon = icons + '/ic_file_download_black_24dp.png'; + var href = pagePath + '/download?id=' + id; + + var html = '' + + ''; + return html; } \ No newline at end of file diff --git a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/EndorsementKeyCredentialsPageControllerTest.java b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/EndorsementKeyCredentialsPageControllerTest.java index 63f7f793..c808fa4b 100644 --- a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/EndorsementKeyCredentialsPageControllerTest.java +++ b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/EndorsementKeyCredentialsPageControllerTest.java @@ -82,7 +82,7 @@ public class EndorsementKeyCredentialsPageControllerTest extends PageControllerT FlashMap flashMap = result.getFlashMap(); PageMessages pageMessages = (PageMessages) flashMap.get("messages"); Assert.assertEquals(pageMessages.getSuccess().get(0), "New certificate successfully " - + "uploaded (" + EKCERT + ")"); + + "uploaded (" + EKCERT + "): "); Assert.assertEquals(pageMessages.getError().size(), 0); // verify the cert was actually stored diff --git a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/PlatformCredentialsPageControllerTest.java b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/PlatformCredentialsPageControllerTest.java index 9bbb166f..0da31a04 100644 --- a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/PlatformCredentialsPageControllerTest.java +++ b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/PlatformCredentialsPageControllerTest.java @@ -144,7 +144,7 @@ public class PlatformCredentialsPageControllerTest extends PageControllerTest { Assert.assertEquals(pageMessages.getSuccess().size(), 1); Assert.assertEquals(pageMessages.getError().size(), 0); Assert.assertEquals(pageMessages.getSuccess().get(0), - "Pre-existing certificate found and unarchived (" + REALPCCERT + ")"); + "Pre-existing certificate found and unarchived (" + REALPCCERT + "): "); // verify the cert was actually stored Set records = certificateManager.get(PlatformCredential.select( diff --git a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageControllerTest.java b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageControllerTest.java new file mode 100644 index 00000000..8245a924 --- /dev/null +++ b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageControllerTest.java @@ -0,0 +1,107 @@ +package hirs.attestationca.portal.page.controllers; + +import hirs.data.persist.ReferenceManifest; +import hirs.persist.DBReferenceManifestManager; +import hirs.attestationca.portal.page.Page; +import hirs.attestationca.portal.page.PageController; +import hirs.attestationca.portal.page.PageControllerTest; +import java.io.IOException; +import java.net.URISyntaxException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.Files; +import java.util.Map; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasProperty; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.Rollback; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.model; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +/** + * Integration tests that test the URL End Points of + * EndorsementKeyCredentialsPageController. + */ +@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS) +public class ReferenceManifestDetailsPageControllerTest extends PageControllerTest { + + private static final String GOOD_RIM_FILE = "/rims/generated_good.swidtag"; + private static final String ID = "046b6c7f-0b8a-43b9-b35d-6489e6daee91"; + + @Autowired + private DBReferenceManifestManager referenceManifestManager; + private ReferenceManifest referenceManifest; + + + /** + * Prepares tests. + * + * @throws IOException if test resources are not found + */ + @BeforeClass + public void prepareTests() throws IOException { + Path fPath; + try { + fPath = Paths.get(this.getClass().getResource(GOOD_RIM_FILE).toURI()); + } catch (URISyntaxException e) { + throw new IOException("Could not resolve path URI", e); + } + referenceManifest = new ReferenceManifest(Files.readAllBytes(fPath)); + referenceManifestManager.save(referenceManifest); + } + + /** + * Constructor. + */ + public ReferenceManifestDetailsPageControllerTest() { + super(Page.RIM_DETAILS); + } + + /** + * Tests initial page when the Reference Integrity Manifest + * was not found. + * @throws Exception if an exception occurs + */ + @Test + public void testInitPage() throws Exception { + // Get error message + getMockMvc() + .perform(MockMvcRequestBuilders.get("/" + getPage().getViewName()) + .param("id", ID)) + .andExpect(status().isOk()) + .andExpect(model().attribute(PageController.MESSAGES_ATTRIBUTE, + hasProperty("error", hasItem("Unable to find RIM with ID: " + ID)))) + .andReturn(); + } + + /** + * Tests initial page for an Reference Integrity Manifest. + * + * @throws Exception if an exception occurs + */ + @Test + @Rollback + @SuppressWarnings("unchecked") + public void testInitPageRim() throws Exception { + MvcResult result = getMockMvc() + .perform(MockMvcRequestBuilders.get("/" + getPage().getViewName()) + .param("id", referenceManifest.getId().toString()) + .param("swidTagId", referenceManifest.getTagId())) + .andExpect(status().isOk()) + .andExpect(model().attributeExists(PolicyPageController.INITIAL_DATA)) + .andReturn(); + + // Obtain initialData HashMap + Map initialData = (Map) result + .getModelAndView() + .getModel() + .get(PolicyPageController.INITIAL_DATA); + Assert.assertEquals(initialData.get("swidTagId"), referenceManifest.getTagId()); + } +} diff --git a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageControllerTest.java b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageControllerTest.java new file mode 100644 index 00000000..3e5b5250 --- /dev/null +++ b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageControllerTest.java @@ -0,0 +1,189 @@ +package hirs.attestationca.portal.page.controllers; + +import hirs.data.persist.ReferenceManifest; +import hirs.persist.ReferenceManifestManager; +import hirs.attestationca.portal.page.Page; +import hirs.attestationca.portal.page.PageControllerTest; +import hirs.attestationca.portal.page.PageMessages; +import java.io.IOException; +import java.util.Set; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.io.ClassPathResource; +import org.springframework.mock.web.MockMultipartFile; +import org.springframework.test.annotation.DirtiesContext; +import org.springframework.test.annotation.Rollback; +import org.springframework.test.web.servlet.MvcResult; +import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import org.springframework.web.servlet.FlashMap; +import org.testng.Assert; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +/** + * Integration tests that test the URL End Points of + * ReferenceManifestPageController. + */ +@DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) +public class ReferenceManifestPageControllerTest extends PageControllerTest { + + private static final String GOOD_RIM_FILE = "generated_good.swidtag"; + private static final String BAD_RIM_FILE = "generated_bad.swidtag"; + + @Autowired + private ReferenceManifestManager referenceManifestManager; + private MockMultipartFile validRimFile; + private MockMultipartFile nonValidRimFile; + + /** + * Constructor. + */ + public ReferenceManifestPageControllerTest() { + super(Page.REFERENCE_MANIFESTS); + } + + /** + * Prepares tests. + * + * @throws IOException if test resources are not found + */ + @BeforeMethod + public void prepareTests() throws IOException { + // create a multi part file for the controller upload + validRimFile = new MockMultipartFile("file", GOOD_RIM_FILE, "", + new ClassPathResource("rims/" + GOOD_RIM_FILE).getInputStream()); + nonValidRimFile = new MockMultipartFile("file", BAD_RIM_FILE, "", + new ClassPathResource("rims/" + BAD_RIM_FILE).getInputStream()); + } + + private void archiveTestCert(final ReferenceManifest referenceManifest) throws Exception { + // now, archive the record + getMockMvc().perform(MockMvcRequestBuilders + .post("/reference-manifests/delete") + .param("id", referenceManifest.getId().toString())) + .andExpect(status().is3xxRedirection()) + .andReturn(); + + Set records + = referenceManifestManager.get(ReferenceManifest + .select(referenceManifestManager).includeArchived()); + Assert.assertEquals(records.size(), 1); + + Assert.assertTrue(records.iterator().next().isArchived()); + } + + /** + * Tests uploading a RIM that is a Reference Integrity Manifest, and + * archiving it. + * + * @throws Exception if an exception occurs + */ + @Test + @Rollback + public void uploadAndArchiveValidRim() throws Exception { + ReferenceManifest rim = uploadTestRim(); + archiveTestRim(rim); + } + + /** + * Tests uploading a rim that is not a valid Reference Integrity Manifest, + * which results in failure. + * + * @throws Exception if an exception occurs + */ + @Test + @Rollback + public void uploadNonValidRim() throws Exception { + MvcResult result = getMockMvc().perform(MockMvcRequestBuilders + .fileUpload("/reference-manifests/upload") + .file(nonValidRimFile)) + .andExpect(status().is3xxRedirection()) + .andReturn(); + + // verify redirection messages + FlashMap flashMap = result.getFlashMap(); + PageMessages pageMessages = (PageMessages) flashMap.get("messages"); + Assert.assertEquals(pageMessages.getSuccess().size(), 0); + Assert.assertEquals(pageMessages.getError().size(), 1); + } + + /** + * Tests that uploading a RIM when an identical RIM is archived will cause + * the existing RIM to be unarchived and updated. + * + * @throws Exception if an exception occurs + */ + @Test + @Rollback + public void uploadCausesUnarchive() throws Exception { + ReferenceManifest rim = uploadTestRim(); + archiveTestCert(rim); + + // upload the same cert again + MvcResult result = getMockMvc().perform(MockMvcRequestBuilders + .fileUpload("/reference-manifests/upload") + .file(validRimFile)) + .andExpect(status().is3xxRedirection()) + .andReturn(); + + // verify redirection messages + FlashMap flashMap = result.getFlashMap(); + PageMessages pageMessages = (PageMessages) flashMap.get("messages"); + Assert.assertEquals(pageMessages.getSuccess().size(), 1); + Assert.assertEquals(pageMessages.getError().size(), 0); + Assert.assertEquals(pageMessages.getSuccess().get(0), + "Pre-existing RIM found and unarchived (generated_good.swidtag): "); + + // verify the cert was actually stored + Set records = referenceManifestManager.get(ReferenceManifest.select( + referenceManifestManager)); + Assert.assertEquals(records.size(), 1); + + ReferenceManifest newRim = records.iterator().next(); + + // verify that the rim was unarchived + Assert.assertFalse(newRim.isArchived()); + // verify that the createTime was updated + Assert.assertTrue(newRim.getCreateTime().getTime() > rim.getCreateTime().getTime()); + } + + private ReferenceManifest uploadTestRim() throws Exception { + MvcResult result = getMockMvc().perform(MockMvcRequestBuilders + .fileUpload("/reference-manifests/upload") + .file(validRimFile)) + .andExpect(status().is3xxRedirection()) + .andReturn(); + + // verify redirection messages + FlashMap flashMap = result.getFlashMap(); + PageMessages pageMessages = (PageMessages) flashMap.get("messages"); + Assert.assertEquals(pageMessages.getSuccess().size(), 1); + Assert.assertEquals(pageMessages.getError().size(), 0); + + // verify the cert was actually stored + Set records + = referenceManifestManager.get(ReferenceManifest.select(referenceManifestManager)); + Assert.assertEquals(records.size(), 1); + + ReferenceManifest rim = records.iterator().next(); + Assert.assertFalse(rim.isArchived()); + + return rim; + } + + private void archiveTestRim(final ReferenceManifest rim) throws Exception { + // now, archive the record + getMockMvc().perform(MockMvcRequestBuilders + .post("/reference-manifests/delete") + .param("id", rim.getId().toString())) + .andExpect(status().is3xxRedirection()) + .andReturn(); + + Set records + = referenceManifestManager.get(ReferenceManifest + .select(referenceManifestManager).includeArchived()); + Assert.assertEquals(records.size(), 1); + + Assert.assertTrue(records.iterator().next().isArchived()); + } +} diff --git a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/TrustChainManagementPageControllerTest.java b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/TrustChainManagementPageControllerTest.java index 489d66a8..fea681aa 100644 --- a/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/TrustChainManagementPageControllerTest.java +++ b/HIRS_AttestationCAPortal/src/test/java/hirs/attestationca/portal/page/controllers/TrustChainManagementPageControllerTest.java @@ -165,7 +165,7 @@ public class TrustChainManagementPageControllerTest extends PageControllerTest { FlashMap flashMap = result.getFlashMap(); PageMessages pageMessages = (PageMessages) flashMap.get("messages"); Assert.assertEquals(pageMessages.getSuccess() - .get(0), "New certificate successfully uploaded (" + NONCACERT + ")"); + .get(0), "New certificate successfully uploaded (" + NONCACERT + "): "); Assert.assertEquals(pageMessages.getError().size(), 0); // verify the cert was actually stored @@ -218,7 +218,7 @@ public class TrustChainManagementPageControllerTest extends PageControllerTest { Assert.assertEquals(pageMessages.getSuccess().size(), 1); Assert.assertEquals(pageMessages.getError().size(), 0); Assert.assertEquals(pageMessages.getSuccess().get(0), - "Pre-existing certificate found and unarchived (" + NONCACERT + ")"); + "Pre-existing certificate found and unarchived (" + NONCACERT + "): "); // verify the cert can be retrieved without looking at archived certs Set records = certificateManager.get(CertificateAuthorityCredential diff --git a/HIRS_AttestationCAPortal/src/test/resources/rims/generated_bad.swidtag b/HIRS_AttestationCAPortal/src/test/resources/rims/generated_bad.swidtag new file mode 100644 index 00000000..54264d42 --- /dev/null +++ b/HIRS_AttestationCAPortal/src/test/resources/rims/generated_bad.swidtag @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/HIRS_AttestationCAPortal/src/test/resources/rims/generated_good.swidtag b/HIRS_AttestationCAPortal/src/test/resources/rims/generated_good.swidtag new file mode 100644 index 00000000..a76786ca --- /dev/null +++ b/HIRS_AttestationCAPortal/src/test/resources/rims/generated_good.swidtag @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + 1Q6yBiNzRDboqNf/E+3uKGPqcAekPV24lSAcfp63TKo= + + + X2RsKxcqlhshMOEGZrcF1j2y5cBAMuSsd+YgOL1aJj2T6FGVx8c4ec2Z8ENUcuVlFI4zMLZGzeJI +EjxnmN5GTRayF5wOqt25oyeif+9s2VwRm4mPZp24JbpDfIeyxRVBXXcPm6h6ydRfupvEsOJLihxd +t3KxYQXEqnpteGuLSmg2jJk8oKKpb+e9GeOOw9QjQGKH49+f3snA5rghNW8x8jaxvM64tf+GRT/q +XAMSpZiGMPe9PvLgp8VqPw4P0HBE4bwUVBnaf6qtkI7psAc6uem4qeghP02cZOdcW8W0ZJjcxOeH +xYLu4qdByZ/m+Z97YQj4dwSQCAulHFWs246a4Q== + + + CN=chubtub,OU=hirs,O=nsacyber,L=Unknown,ST=Unknown,C=US + MIIDaTCCAlGgAwIBAgIEVTtDKzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQGEwJVUzEQMA4GA1UE +CBMHVW5rbm93bjEQMA4GA1UEBxMHVW5rbm93bjERMA8GA1UEChMIbnNhY3liZXIxDTALBgNVBAsT +BGhpcnMxEDAOBgNVBAMTB2NodWJ0dWIwHhcNMjAwMTI5MTYxODI5WhcNMjEwMTIzMTYxODI5WjBl +MQswCQYDVQQGEwJVUzEQMA4GA1UECBMHVW5rbm93bjEQMA4GA1UEBxMHVW5rbm93bjERMA8GA1UE +ChMIbnNhY3liZXIxDTALBgNVBAsTBGhpcnMxEDAOBgNVBAMTB2NodWJ0dWIwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCFuwsH9AREu1t/u1dFyWIUaHff0R+wR2gDfQ8VOZKAMnJjSUfc +P7m4kFedXOMj9AHQp8Ck6rMLcj5rXg81MxCykEZ8zb189A0iaaLg7fqqlQljDMc4LRhl7ZEAI9u1 ++SPg+tS/xfFrd6SmRwcpa/2D77EmILYTneQqcxEUg2aNZbP/I1vJK/ibTL4mI/Y2D5fIKPI9aI+0 +rs0nqlEZcAViYgo8Ejxur9/3erdxQZS4csFmnIyF595w+0dbECsmG8VKTvt5x2z3Tm4spXKFDa5M +0OmkyP3OMhPUWwDeAXziKzBWZ/Ak1S69/C5HceN/WrtX7AKhq2WYEyAnidZyMdDDAgMBAAGjITAf +MB0GA1UdDgQWBBQXLczKOk0woNFfZMhqpY9p9bRncTANBgkqhkiG9w0BAQsFAAOCAQEAC7/atbbJ +fntti1K1JJ/J2V5wJVYmhUUyuFzpTY1Dfwp/aNYILnOEs9WHrpI1AsgIXc1hLprs0vPM0kZsmaV9 +QfvYEijV11c9NCxphKvw9cfuawR09RMNdNQ6VJuFfLd5prMFdd13lcbBDx7tfd9Ryj2D9EcuiC1H +Zyhrl5TzDeGEKSdlWUZVaa3GGg1bX/zV3rpFx5y+Vjen5NZXaZOavxtBakYIlY2/AEAiEe13EeJE +Tjee053v9SWHtGvrjWOY2e1UQ2NOM6y+lUzv8IHFrQDpEzIycL8Uv2+S+KFZpQmpaPhIqm3RjmLf +mD0XYHlNxV1SE5YmatMB5qDAFvYcDw== + + + + diff --git a/HIRS_Utils/config/checkstyle/suppressions.xml b/HIRS_Utils/config/checkstyle/suppressions.xml index 0e0157dc..25de9ea3 100644 --- a/HIRS_Utils/config/checkstyle/suppressions.xml +++ b/HIRS_Utils/config/checkstyle/suppressions.xml @@ -26,4 +26,5 @@ + diff --git a/HIRS_Utils/config/findbugs/suppressions.xml b/HIRS_Utils/config/findbugs/suppressions.xml index 5967ae61..95613d09 100644 --- a/HIRS_Utils/config/findbugs/suppressions.xml +++ b/HIRS_Utils/config/findbugs/suppressions.xml @@ -32,4 +32,7 @@ + + + diff --git a/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceManifest.java b/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceManifest.java index 1e5e627a..8c341709 100644 --- a/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceManifest.java +++ b/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceManifest.java @@ -1,132 +1,618 @@ package hirs.data.persist; -import java.io.StringReader; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.Map; +import java.util.List; +import java.util.ArrayList; import javax.persistence.Access; import javax.persistence.AccessType; import javax.persistence.Column; import javax.persistence.Entity; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; +import javax.xml.namespace.QName; +import javax.xml.bind.JAXBElement; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.base.Preconditions; +import hirs.persist.DBReferenceManifestManager; +import hirs.persist.ReferenceManifestManager; +import hirs.persist.ReferenceManifestSelector; +import hirs.utils.xjc.BaseElement; +import hirs.utils.xjc.ResourceCollection; +import hirs.utils.xjc.SoftwareIdentity; +import hirs.utils.xjc.SoftwareMeta; +import hirs.utils.xjc.Meta; +import hirs.utils.xjc.Directory; +import hirs.utils.xjc.FilesystemItem; +import java.io.InputStream; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import javax.persistence.Table; +import javax.xml.XMLConstants; +import javax.xml.bind.JAXBContext; +import javax.xml.bind.JAXBException; +import javax.xml.bind.UnmarshalException; +import javax.xml.bind.Unmarshaller; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.validation.Schema; /** - * + * This class represents the Reference Integrity Manifest object that will be + * loaded into the DB and displayed in the ACA. */ @Entity +@Table(name = "ReferenceManifest") +@XmlRootElement(name = "ReferenceManifest") +@XmlAccessorType(XmlAccessType.FIELD) @Access(AccessType.FIELD) -public class ReferenceManifest extends ArchivableEntity { +public class ReferenceManifest extends ArchivableEntity { - private static final Logger LOGGER = LogManager.getLogger(); + /** + * String for the xml schema ios standard. + */ + 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"; + /** + * String for the xml schema URL file name. + */ + public static final String SCHEMA_URL = "swid_schema.xsd"; + /** + * String for the language type for the xml schema. + */ + public static final String SCHEMA_LANGUAGE = XMLConstants.W3C_XML_SCHEMA_NS_URI; + /** + * String for the package location of the xml generated java files. + */ + public static final String SCHEMA_PACKAGE = "hirs.utils.xjc"; + + private static final Logger LOGGER = LogManager.getLogger(ReferenceManifest.class); + private static JAXBContext jaxbContext; + + /** + * This class enables the retrieval of PlatformCredentials by their + * attributes. + */ + public static class Selector + extends ReferenceManifestSelector { + + /** + * Construct a new ReferenceManifestSelector that will use the given + * {@link ReferenceManifestManager} to retrieve one or many Reference + * Integrity Manifest. + * + * @param referenceManifestManager the RIM manager to be used to + * retrieve RIMs + */ + public Selector(final ReferenceManifestManager referenceManifestManager) { + super(referenceManifestManager); + } + } @Column - private String manufacturer = null; + private String swidName = null; @Column - private String model = null; + private String swidVersion = null; + @Column + private boolean swidCorpus = false; + @Column + private boolean swidPatch = false; + @Column + private boolean swidSupplemental = false; + @Column + private String platformManufacturer = null; + @Column + private String platformManufacturerId = null; + @Column + private String platformModel = null; @Column private String firmwareVersion = null; @Column private String tagId = null; @Column private String rimType = null; - + @Column + private String colloquialVersion = null; + @Column + private String product = null; + @Column + private String revision = null; + @Column + private String edition = null; + @Column + private String rimLinkHash = null; + @Column + private String bindingSpec = null; + @Column + private String bindingSpecVersion = null; + @Column + private String platformVersion = null; + @Column + private String payloadType = null; + @Column + private String pcURIGlobal = null; + @Column + private String pcURILocal = null; + @Column(columnDefinition = "blob", nullable = false) + @JsonIgnore + private byte[] rimBytes; /** - * Holds the different RIM types. + * Holds the name of the 'rimHash' field. */ - public enum RimType { - /** - * Primary Reference Integrity Manifest. - */ - PRIMARY_RIM("Primary"), - /** - * Supplemental Reference Integrity Manifest. - */ - SUPPLEMENTAL_RIM("Supplemental"), - /** - * Patch Reference Integrity Manifest. - */ - PATCH_RIM("Patch"); + public static final String RIM_HASH_FIELD = "rimHash"; + @Column(nullable = false) + @JsonIgnore + private final int rimHash; - private String type; - - /** - * Default constructor. - * @param type a string for the type. - */ - RimType(final String type) { - this.type = type; - } - - /** - * Assessor for RIM Type. - * @return string for type - */ - public String getType() { - return type; - } - } + private String entityName = null; + private String entityRegId = null; + private String entityRole = null; + private String entityThumbprint = null; + private String linkHref = null; + private String linkRel = null; /** - * Default constructor of given name. - */ - public ReferenceManifest() { - } - - /** - * Returns a new Device instance from the XML string. This - * unmarshals the XML string and generates a ReferenceManifest - * object. - * This is a utility method for creating ReferenceManifest - * objects. + * Get a Selector for use in retrieving ReferenceManifest. * - * @param xml - * XML representation of device - * @return device - * @throws JAXBException - * if unable to unmarshal the string + * @param rimMan the ReferenceManifestManager to be used to retrieve + * persisted RIMs + * @return a ReferenceManifest.Selector instance to use for retrieving RIMs */ - public static ReferenceManifest getInstance(final String xml) throws JAXBException { - final JAXBContext context = JAXBContext.newInstance(Device.class); - final Unmarshaller unmarshaller = context.createUnmarshaller(); - final StringReader reader = new StringReader(xml); - return (ReferenceManifest) unmarshaller.unmarshal(reader); + public static Selector select(final ReferenceManifestManager rimMan) { + return new Selector(rimMan); } /** - * Getter for the manufacturuer info. - * @return string for the manufacturuer + * Default constructor necessary for Hibernate. */ - public String getManufacturer() { - return manufacturer; + protected ReferenceManifest() { + super(); + this.swidName = null; + this.swidVersion = null; + this.swidVersion = null; + this.swidCorpus = false; + this.swidPatch = false; + this.swidSupplemental = false; + this.platformManufacturer = null; + this.platformManufacturerId = null; + this.platformModel = null; + this.firmwareVersion = null; + this.tagId = null; + this.rimBytes = null; + this.rimHash = 0; + this.linkHref = null; + this.linkRel = null; + this.entityName = null; + this.entityRegId = null; + this.entityRole = null; + this.entityThumbprint = null; + this.colloquialVersion = null; + this.product = null; + this.revision = null; + this.edition = null; + this.rimLinkHash = null; + this.bindingSpec = null; + this.bindingSpecVersion = null; + this.platformVersion = null; + this.payloadType = null; + this.pcURIGlobal = null; + this.pcURILocal = null; } /** - * Setter for the manufacturuer info. - * @param manufacturer passed in info. + * Main constructor for the RIM object. This takes in a byte array of a + * valid swidtag file and parses the information. + * + * @param rimBytes byte array representation of the RIM + * @throws IOException if unable to unmarshal the string */ - public void setManufacturer(final String manufacturer) { - this.manufacturer = manufacturer; + public ReferenceManifest(final byte[] rimBytes) throws IOException { + Preconditions.checkArgument(rimBytes != null, + "Cannot construct a RIM from a null byte array"); + + Preconditions.checkArgument(rimBytes.length > 0, + "Cannot construct a RIM from an empty byte array"); + + this.rimBytes = rimBytes.clone(); + + SoftwareIdentity si = validateSwidTag(new ByteArrayInputStream(rimBytes)); + + // begin parsing valid swid tag + if (si != null) { + this.tagId = si.getTagId(); + this.swidName = si.getName(); + this.swidCorpus = si.isCorpus(); + this.swidPatch = si.isPatch(); + this.swidSupplemental = si.isSupplemental(); + this.swidVersion = si.getVersion(); + + for (Object object : si.getEntityOrEvidenceOrLink()) { + if (object instanceof JAXBElement) { + JAXBElement element = (JAXBElement) object; + String elementName = element.getName().getLocalPart(); + switch (elementName) { + case "Meta": + parseSoftwareMeta((SoftwareMeta) element.getValue()); + break; + case "Entity": + hirs.utils.xjc.Entity entity + = (hirs.utils.xjc.Entity) element.getValue(); + if (entity != null) { + this.entityName = entity.getName(); + this.entityRegId = entity.getRegid(); + StringBuilder sb = new StringBuilder(); + for (String role : entity.getRole()) { + sb.append(String.format("%s%n", role)); + } + this.entityRole = sb.toString(); + this.entityThumbprint = entity.getThumbprint(); + } + break; + case "Link": + hirs.utils.xjc.Link link + = (hirs.utils.xjc.Link) element.getValue(); + if (link != null) { + this.linkHref = link.getHref(); + this.linkRel = link.getRel(); + } + break; + case "Payload": + parseResource((ResourceCollection) element.getValue()); + break; + case "Signature": + // left blank for a followup issue enhancement + default: + } + } + } + } + + this.rimHash = Arrays.hashCode(this.rimBytes); } /** - * Getter for the model info. - * @return string for the model + * This method and code is pulled and adopted from the TCG Tool. Since this + * is taking in an file stored in memory through http, this was changed from + * a file to a stream as the input. + * + * @param fileStream stream of the swidtag file. + * @return a {@link SoftwareIdentity} object + * @throws IOException Thrown by the unmarhsallSwidTag method. */ - public String getModel() { - return model; + private SoftwareIdentity validateSwidTag(final InputStream fileStream) throws IOException { + JAXBElement jaxbe = unmarshallSwidTag(fileStream); + SoftwareIdentity swidTag = (SoftwareIdentity) jaxbe.getValue(); + + LOGGER.info(String.format("SWID Tag found: %nname: %s;%ntagId: %s%n%s", + swidTag.getName(), swidTag.getTagId(), SCHEMA_STATEMENT)); + return swidTag; } /** - * Setter for the Model info. - * @param model passed in model + * Helper method that is used to parse a specific element of the SwidTag + * based on an already established and stored byte array. + * + * @param elementName string of an xml tag in the file. + * @return the object value of the element, if it exists */ - public void setModel(final String model) { - this.model = model; + private BaseElement getBaseElementFromBytes(final String elementName) { + BaseElement baseElement = null; + + if (rimBytes != null && elementName != null) { + try { + SoftwareIdentity si = validateSwidTag(new ByteArrayInputStream(this.rimBytes)); + for (Object object : si.getEntityOrEvidenceOrLink()) { + if (object instanceof JAXBElement) { + JAXBElement element = (JAXBElement) object; + if (element.getName().getLocalPart().equals(elementName)) { + // found the element + baseElement = (BaseElement) element.getValue(); + } + } + } + + } catch (IOException ioEx) { + LOGGER.error("Failed to parse Swid Tag bytes.", ioEx); + } + } + + return baseElement; + } + + /** + * This is a helper method that parses the SoftwareMeta tag and stores the + * information in the class fields. + * + * @param softwareMeta The object to parse. + */ + private void parseSoftwareMeta(final SoftwareMeta softwareMeta) { + if (softwareMeta != null) { + for (Map.Entry entry + : softwareMeta.getOtherAttributes().entrySet()) { + switch (entry.getKey().getLocalPart()) { + case "colloquialVersion": + this.colloquialVersion = entry.getValue(); + break; + case "product": + this.product = entry.getValue(); + break; + case "revision": + this.revision = entry.getValue(); + break; + case "edition": + this.edition = entry.getValue(); + break; + case "rimLinkHash": + this.rimLinkHash = entry.getValue(); + break; + case "bindingSpec": + this.bindingSpec = entry.getValue(); + break; + case "bindingSpecVersion": + this.bindingSpecVersion = entry.getValue(); + break; + case "platformManufacturerId": + this.platformManufacturerId = entry.getValue(); + break; + case "platformModel": + this.platformModel = entry.getValue(); + break; + case "platformManufacturerStr": + this.platformManufacturer = entry.getValue(); + break; + case "platformVersion": + this.platformVersion = entry.getValue(); + break; + case "payloadType": + this.payloadType = entry.getValue(); + break; + case "pcURIGlobal": + this.pcURIGlobal = entry.getValue(); + break; + case "pcURILocal": + this.pcURILocal = entry.getValue(); + break; + default: + } + } + } + } + + /** + * Default method for parsing the payload element. + * + * @return a collection of payload objects. + */ + public final List parseResource() { + return parseResource((ResourceCollection) this.getBaseElementFromBytes("Payload")); + } + + /** + * This method parses the payload method of a {@link ResourceCollection}. + * + * @param rc Resource Collection object. + * @return a collection of payload objects. + */ + public final List parseResource(final ResourceCollection rc) { + List resources = new ArrayList<>(); + + try { + if (rc != null) { + for (Meta meta : rc.getDirectoryOrFileOrProcess()) { + if (meta != null) { + if (meta instanceof Directory) { + Directory directory = (Directory) meta; + for (FilesystemItem fsi : directory.getDirectoryOrFile()) { + if (fsi != null) { + resources.add(new SwidResource( + (hirs.utils.xjc.File) fsi)); + } + } + } else if (meta instanceof hirs.utils.xjc.File) { + resources.add(new SwidResource((hirs.utils.xjc.File) meta)); + } + } + } + } + } catch (ClassCastException ccEx) { + LOGGER.error(ccEx); + LOGGER.error("At this time, the code does not support the " + + "particular formatting of this SwidTag's Payload."); + } + + return resources; + } + + /** + * 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(final InputStream stream) throws IOException { + JAXBElement jaxbe = null; + Schema schema = null; + + try { + schema = DBReferenceManifestManager.getSchemaObject(); + if (jaxbContext == null) { + jaxbContext = JAXBContext.newInstance(SCHEMA_PACKAGE); + } + Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); + unmarshaller.setSchema(schema); + jaxbe = (JAXBElement) unmarshaller.unmarshal(stream); + } catch (UnmarshalException umEx) { + LOGGER.error(String.format("Error validating swidtag file!%n%s%n%s", + umEx.getMessage(), umEx.toString())); + for (StackTraceElement ste : umEx.getStackTrace()) { + LOGGER.error(ste.toString()); + } + } catch (IllegalArgumentException iaEx) { + LOGGER.error("Input file empty."); + } catch (JAXBException jaxEx) { + for (StackTraceElement ste : jaxEx.getStackTrace()) { + LOGGER.error(ste.toString()); + } + } + + if (jaxbe != null) { + return jaxbe; + } else { + throw new IOException("Invalid swidtag file!"); + } + } + + /** + * Getter for the SWID name parameter. + * + * @return string representation of the SWID name + */ + public String getSwidName() { + return swidName; + } + + /** + * Setter for the SWID name parameter. + * + * @param swidName string of the name + */ + public void setSwidName(final String swidName) { + this.swidName = swidName; + } + + /** + * Getter for the SWID version. + * + * @return string of the version number + */ + public String getSwidVersion() { + return swidVersion; + } + + /** + * Setter for the SWID version. + * + * @param swidVersion string of the version + */ + public void setSwidVersion(final String swidVersion) { + this.swidVersion = swidVersion; + } + + /** + * Getter for the corpus flag. + * + * @return boolean flag for corpus + */ + public boolean isSwidCorpus() { + return swidCorpus; + } + + /** + * Setter for the corpus flag. + * + * @param swidCorpus boolean value + */ + public void setSwidCorpus(final boolean swidCorpus) { + this.swidCorpus = swidCorpus; + } + + /** + * Getter for the patch flag. + * + * @return boolean flag for the patch flag + */ + public boolean isSwidPatch() { + return swidPatch; + } + + /** + * Setter for the patch flag. + * + * @param swidPatch boolean value + */ + public void setSwidPatch(final boolean swidPatch) { + this.swidPatch = swidPatch; + } + + /** + * Getter for the supplemental flag. + * + * @return boolean flag for the supplemental flag + */ + public boolean isSwidSupplemental() { + return swidSupplemental; + } + + /** + * Setter for the supplemental flag. + * + * @param swidSupplemental boolean value + */ + public void setSwidSupplemental(final boolean swidSupplemental) { + this.swidSupplemental = swidSupplemental; + } + + /** + * Getter for the platformManufacturer info. + * + * @return string for the platformManufacturer + */ + public String getPlatformManufacturer() { + return platformManufacturer; + } + + /** + * Setter for the platformManufacturer info. + * + * @param platformManufacturer passed in info. + */ + public void setPlatformManufacturer(final String platformManufacturer) { + this.platformManufacturer = platformManufacturer; + } + + /** + * Getter for the platform manufacturer ID. + * + * @return string for the platform manufacturer id. + */ + public String getPlatformManufacturerId() { + return platformManufacturerId; + } + + /** + * Setter for the platform manufacturer ID. + * + * @param platformManufacturerId passed in info + */ + public void setPlatformManufacturerId(final String platformManufacturerId) { + this.platformManufacturerId = platformManufacturerId; + } + + /** + * Getter for the platformModel info. + * + * @return string for the platformModel + */ + public String getPlatformModel() { + return platformModel; + } + + /** + * Setter for the platformModel info. + * + * @param platformModel passed in platformModel + */ + public void setPlatformModel(final String platformModel) { + this.platformModel = platformModel; } /** * Getter for the firmware version info. + * * @return string for the firmware version */ public String getFirmwareVersion() { @@ -135,6 +621,7 @@ public class ReferenceManifest extends ArchivableEntity { /** * Setter for the firmware version info. + * * @param firmwareVersion passed in firmware version */ public void setFirmwareVersion(final String firmwareVersion) { @@ -143,6 +630,7 @@ public class ReferenceManifest extends ArchivableEntity { /** * Getter for the RIM Tag ID. + * * @return string for the RIM tag id */ public String getTagId() { @@ -151,6 +639,7 @@ public class ReferenceManifest extends ArchivableEntity { /** * Setter for the RIM Tag ID. + * * @param tagId passed in RIM Tag ID */ public void setTagId(final String tagId) { @@ -159,6 +648,7 @@ public class ReferenceManifest extends ArchivableEntity { /** * Getter for the RIM Type (Primary, Supplemental, Patch). + * * @return string for the RIM Type */ public String getRimType() { @@ -167,9 +657,344 @@ public class ReferenceManifest extends ArchivableEntity { /** * Setter for the RIM Type. - * @param type passed in RIM Type + * + * @param timType passed in RIM Type */ - public void setRimType(final String type) { - this.rimType = type; + public void setRimType(final String timType) { + this.rimType = timType; + } + + /** + * Getter for the Reference Integrity Manifest as a byte array. + * + * @return array of bytes + */ + public byte[] getRimBytes() { + return rimBytes.clone(); + } + + /** + * Getter for the Reference Integrity Manifest hash value. + * + * @return int representation of the hash value + */ + public int getRimHash() { + return rimHash; + } + + /** + * Getter for the Entity Name. + * + * @return string of the entity name. + */ + public String getEntityName() { + return entityName; + } + + /** + * Setter for the Entity Name. + * + * @param entityName string of the entity name. + */ + public void setEntityName(final String entityName) { + this.entityName = entityName; + } + + /** + * Getter for the Entity Reg ID. + * + * @return string of the entity reg id. + */ + public String getEntityRegId() { + return entityRegId; + } + + /** + * Setter for the Entity Reg ID. + * + * @param entityRegId string of the entity reg id. + */ + public void setEntityRegId(final String entityRegId) { + this.entityRegId = entityRegId; + } + + /** + * Getter for the Entity Role. + * + * @return string of the entity role. + */ + public String getEntityRole() { + return entityRole; + } + + /** + * Setter for the Entity Role. + * + * @param entityRole string of the entity role . + */ + public void setEntityRole(final String entityRole) { + this.entityRole = entityRole; + } + + /** + * Getter for the Entity thumbprint. + * + * @return string of the entity thumbprint. + */ + public String getEntityThumbprint() { + return entityThumbprint; + } + + /** + * Setter for the Entity Thumbprint. + * + * @param entityThumbprint string of the entity thumbprint. + */ + public void setEntityThumbprint(final String entityThumbprint) { + this.entityThumbprint = entityThumbprint; + } + + /** + * Getter for the Link Href. + * + * @return string of the link href. + */ + public String getLinkHref() { + return linkHref; + } + + /** + * Setter for the Link href. + * + * @param linkHref in string representation. + */ + public void setLinkHref(final String linkHref) { + this.linkHref = linkHref; + } + + /** + * Getter for the Link Rel. + * + * @return string of the link rel + */ + public String getLinkRel() { + return linkRel; + } + + /** + * Setter for the Link Rel. + * + * @param linkRel in string representation. + */ + public void setLinkRel(final String linkRel) { + this.linkRel = linkRel; + } + + /** + * Getter for Colloquial Version. + * + * @return string of the colloquial version. + */ + public String getColloquialVersion() { + return colloquialVersion; + } + + /** + * Setter for Colloquial Version. + * + * @param colloquialVersion in string representation. + */ + public void setColloquialVersion(final String colloquialVersion) { + this.colloquialVersion = colloquialVersion; + } + + /** + * Getter for Product. + * + * @return string of the product information + */ + public String getProduct() { + return product; + } + + /** + * Setter for the Product. + * + * @param product in string representation. + */ + public void setProduct(final String product) { + this.product = product; + } + + /** + * Getter for the Revision string. + * + * @return string of revision information. + */ + public String getRevision() { + return revision; + } + + /** + * Setter for the Revision. + * + * @param revision in string representation. + */ + public void setRevision(final String revision) { + this.revision = revision; + } + + /** + * Getter for the Edition. + * + * @return string of edition information. + */ + public String getEdition() { + return edition; + } + + /** + * Setter for the Edition string. + * + * @param edition in string representation. + */ + public void setEdition(final String edition) { + this.edition = edition; + } + + /** + * Getter for the RIM Link Hash. + * + * @return string of the RIM link hash. + */ + public String getRimLinkHash() { + return rimLinkHash; + } + + /** + * Setter for the RIM link hash. + * + * @param rimLinkHash in string representation. + */ + public void setRimLinkHash(final String rimLinkHash) { + this.rimLinkHash = rimLinkHash; + } + + /** + * Getter for the Binding Spec. + * + * @return string of Binding spec. + */ + public String getBindingSpec() { + return bindingSpec; + } + + /** + * Setter for the Binding Spec. + * + * @param bindingSpec in string representation. + */ + public void setBindingSpec(final String bindingSpec) { + this.bindingSpec = bindingSpec; + } + + /** + * Getter for the Binding Spec Version. + * + * @return string of binding spec version. + */ + public String getBindingSpecVersion() { + return bindingSpecVersion; + } + + /** + * Setter for the binding spec version. + * + * @param bindingSpecVersion in string representation. + */ + public void setBindingSpecVersion(final String bindingSpecVersion) { + this.bindingSpecVersion = bindingSpecVersion; + } + + /** + * Getter for the Platform Version. + * + * @return string of platform version. + */ + public String getPlatformVersion() { + return platformVersion; + } + + /** + * Setter for the Platform Version. + * + * @param platformVersion in string representation. + */ + public void setPlatformVersion(final String platformVersion) { + this.platformVersion = platformVersion; + } + + /** + * Getter for the Payload Type. + * + * @return string of payload type. + */ + public String getPayloadType() { + return payloadType; + } + + /** + * Setter for the Payload type. + * + * @param payloadType in string representation. + */ + public void setPayloadType(final String payloadType) { + this.payloadType = payloadType; + } + + /** + * Getter for the PC URI Global. + * + * @return string of Pc URI Global. + */ + public String getPcURIGlobal() { + return pcURIGlobal; + } + + /** + * Setter for the PC URI Global. + * + * @param pcURIGlobal in string representation. + */ + public void setPcURIGlobal(final String pcURIGlobal) { + this.pcURIGlobal = pcURIGlobal; + } + + /** + * Getter for the PC URI Local. + * + * @return string of PC URI Local. + */ + public String getPcURILocal() { + return pcURILocal; + } + + /** + * Setter for the PC URI Local. + * + * @param pcURILocal in string representation. + */ + public void setPcURILocal(final String pcURILocal) { + this.pcURILocal = pcURILocal; + } + + @Override + public String toString() { + return String.format("ReferenceManifest{swidName=%s," + + "platformManufacturer=%s," + + " platformModel=%s," + + "firmwareVersion=%s, firmwareVersion=%s, rimHash=%d}", + swidName, platformManufacturer, + platformModel, firmwareVersion, tagId, rimHash); } } diff --git a/HIRS_Utils/src/main/java/hirs/data/persist/SwidResource.java b/HIRS_Utils/src/main/java/hirs/data/persist/SwidResource.java new file mode 100644 index 00000000..531622cd --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/data/persist/SwidResource.java @@ -0,0 +1,115 @@ +package hirs.data.persist; + +import com.google.common.base.Preconditions; +import hirs.utils.xjc.File; +import java.util.Map; +import java.math.BigInteger; +import javax.xml.namespace.QName; + +/** + * This object is used to represent the content of a Swid Tags Directory + * section. + */ +public class SwidResource { + + private String name, size; + + private String rimFormat, rimType, rimUriGlobal, hashValue; + + /** + * Default constructor. + */ + public SwidResource() { + name = null; + size = null; + rimFormat = null; + rimType = null; + rimUriGlobal = null; + hashValue = null; + } + + /** + * The main constructor that processes a {@code hirs.utils.xjc.File}. + * @param file {@link hirs.utils.xjc.File} + */ + public SwidResource(final File file) { + Preconditions.checkArgument(file != null, + "Cannot construct a RIM Resource from a null File object"); + + this.name = file.getName(); + // at this time, there is a possibility to get an object with + // not size even though it is required. + if (file.getSize() != null) { + this.size = file.getSize().toString(); + } else { + this.size = BigInteger.ZERO.toString(); + } + + for (Map.Entry entry + : file.getOtherAttributes().entrySet()) { + switch (entry.getKey().getLocalPart()) { + case "supportRIMFormat": + this.rimFormat = entry.getValue(); + break; + case "supportRIMType": + this.rimType = entry.getValue(); + break; + case "supportRIMURIGlobal": + this.rimUriGlobal = entry.getValue(); + break; + case "hash": + this.hashValue = entry.getValue(); + break; + default: + } + } + } + + /** + * Getter for the file name. + * @return string of the file name + */ + public String getName() { + return name; + } + + /** + * Getter for the file size. + * @return string of the file size. + */ + public String getSize() { + return size; + } + + /** + * Getter for the RIM format for the resource. + * @return string of the format + */ + public String getRimFormat() { + return rimFormat; + } + + /** + * Getter for the RIM resource type. + * @return string of the resource type. + */ + public String getRimType() { + return rimType; + } + + /** + * Getter for the RIM Global URI. + * @return string of the URI + */ + public String getRimUriGlobal() { + return rimUriGlobal; + } + + /** + * Getter for the associated Hash. + * @return string of the hash + */ + public String getHashValue() { + return hashValue; + } +} diff --git a/HIRS_Utils/src/main/java/hirs/persist/DBReferenceManifestManager.java b/HIRS_Utils/src/main/java/hirs/persist/DBReferenceManifestManager.java index 0bb0e8e1..01903dcf 100644 --- a/HIRS_Utils/src/main/java/hirs/persist/DBReferenceManifestManager.java +++ b/HIRS_Utils/src/main/java/hirs/persist/DBReferenceManifestManager.java @@ -3,6 +3,19 @@ package hirs.persist; import hirs.data.persist.ReferenceManifest; import org.hibernate.SessionFactory; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.io.InputStream; +import java.io.IOException; +import javax.xml.transform.stream.StreamSource; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.xml.sax.SAXException; + /** * This class is used to persist and retrieve {@link ReferenceManifest}s into * and from the database. @@ -10,12 +23,87 @@ import org.hibernate.SessionFactory; public class DBReferenceManifestManager extends DBManager implements ReferenceManifestManager { + private static final Logger LOGGER = LogManager.getLogger(DBReferenceManifestManager.class); + /** + * The variable that establishes a schema factory for xml processing. + */ + public static final SchemaFactory SCHEMA_FACTORY + = SchemaFactory.newInstance(ReferenceManifest.SCHEMA_LANGUAGE); + + private static Schema schema; + /** * Default Constructor. + * * @param sessionFactory session factory used to access database connections */ public DBReferenceManifestManager(final SessionFactory sessionFactory) { super(ReferenceManifest.class, sessionFactory); + getSchemaObject(); } + /** + * This method sets the xml schema for processing RIMs. + * + * @return the schema + */ + public static final Schema getSchemaObject() { + if (schema == null) { + InputStream is = null; + try { + is = ReferenceManifest.class + .getClassLoader() + .getResourceAsStream(ReferenceManifest.SCHEMA_URL); + schema = SCHEMA_FACTORY.newSchema(new StreamSource(is)); + } catch (SAXException saxEx) { + LOGGER.error(String.format("Error setting schema for validation!%n%s", + saxEx.getMessage())); + } finally { + if (is != null) { + try { + is.close(); + } catch (IOException ioEx) { + LOGGER.error(String.format("Error closing input stream%n%s", + ioEx.getMessage())); + } + } else { + LOGGER.error("Input stream variable is null"); + } + } + } + return schema; + } + + /** + * This method does not need to be used directly as it is used by + * {@link ReferenceManifestSelector}'s get* methods. Regardless, it may be + * used to retrieve ReferenceManifest by other code in this package, given a + * configured ReferenceManifestSelector. + * + * @param referenceManifestSelector a configured + * {@link ReferenceManifestSelector} to use for querying + * @return the resulting set of ReferenceManifest, possibly empty + */ + @Override + @SuppressWarnings("unchecked") + public Set get(final ReferenceManifestSelector referenceManifestSelector) { + LOGGER.info("Getting the full set of Reference Manifest files."); + return new HashSet<>( + (List) getWithCriteria( + referenceManifestSelector.getReferenceManifestClass(), + Collections.singleton(referenceManifestSelector.getCriterion()) + ) + ); + } + + /** + * Remove a ReferenceManifest from the database. + * + * @param referenceManifest the referenceManifest to delete + * @return true if deletion was successful, false otherwise + */ + public boolean deleteReferenceManifest(final ReferenceManifest referenceManifest) { + LOGGER.info(String.format("Deleting reference to %s", referenceManifest.getTagId())); + return delete(referenceManifest); + } } diff --git a/HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestManager.java b/HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestManager.java index fb3b9514..2e3db7ac 100644 --- a/HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestManager.java +++ b/HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestManager.java @@ -3,11 +3,13 @@ package hirs.persist; import hirs.data.persist.ReferenceManifest; +import java.util.Set; + /** * This class facilitates the persistence of {@link ReferenceManifest}s * including storage, retrieval, and deletion. */ -public interface ReferenceManifestManager { +public interface ReferenceManifestManager extends OrderedListQuerier { /** * Persists a new Reference Manifest. @@ -23,6 +25,14 @@ public interface ReferenceManifestManager { */ void update(ReferenceManifest referenceManifest); + /** + * Retrieve RIMs according to the given {@link ReferenceManifestSelector}. + * + * @param referenceManifestSelector a {@link ReferenceManifestSelector} to use for querying + * @return a Set of matching RIMs, which may be empty + */ + Set get(ReferenceManifestSelector referenceManifestSelector); + /** * Delete the given RIM. * diff --git a/HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestSelector.java b/HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestSelector.java new file mode 100644 index 00000000..8d73c8de --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/persist/ReferenceManifestSelector.java @@ -0,0 +1,190 @@ +package hirs.persist; + +import com.google.common.base.Preconditions; +import hirs.data.persist.certificate.Certificate; +import org.apache.commons.lang3.ArrayUtils; +import org.apache.commons.lang3.StringUtils; +import org.hibernate.criterion.Conjunction; +import org.hibernate.criterion.Criterion; +import org.hibernate.criterion.Restrictions; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.UUID; + +/** + * This class is used to select one or many RIMs in conjunction + * with a {@link ReferenceManifestManager}. To make use of this object, + * use (some ReferenceManifest).select(ReferenceManifestManager). + * + * @param the type of referenceManifest that will be retrieved + */ +public abstract class ReferenceManifestSelector { + + private final ReferenceManifestManager referenceManifestManager; + + private final Map fieldValueSelections; + private boolean excludeArchivedRims; + + /** + * Default Constructor. + * + * @param referenceManifestManager the RIM manager to be used to retrieve RIMs + */ + public ReferenceManifestSelector(final ReferenceManifestManager referenceManifestManager) { + this(referenceManifestManager, true); + } + + /** + * Standard Constructor for the Selector. + * + * @param referenceManifestManager the RIM manager to be used to retrieve RIMs + * @param excludeArchivedRims true if excluding archived RIMs + */ + public ReferenceManifestSelector(final ReferenceManifestManager referenceManifestManager, + final boolean excludeArchivedRims) { + Preconditions.checkArgument( + referenceManifestManager != null, + "reference manifest manager cannot be null" + ); + + this.referenceManifestManager = referenceManifestManager; + this.excludeArchivedRims = excludeArchivedRims; + this.fieldValueSelections = new HashMap<>(); + } + + /** + * Specify the entity id that rims must have to be considered as matching. + * + * @param uuid the UUID to query + * @return this instance (for chaining further calls) + */ + public ReferenceManifestSelector byEntityId(final UUID uuid) { + setFieldValue(Certificate.ID_FIELD, uuid); + return this; + } + + /** + * Specify the hash code of the bytes that rim must match. + * + * @param rimHash the hash code of the bytes to query for + * @return this instance (for chaining further calls) + */ + public ReferenceManifestSelector byHashCode(final int rimHash) { + setFieldValue(hirs.data.persist.ReferenceManifest.RIM_HASH_FIELD, rimHash); + return this; + } + + /** + * Set a field name and value to match. + * + * @param name the field name to query + * @param value the value to query + */ + protected void setFieldValue(final String name, final Object value) { + Object valueToAssign = value; + + Preconditions.checkArgument( + value != null, + String.format("field value (%s) cannot be null.", name) + ); + + if (value instanceof String) { + Preconditions.checkArgument( + StringUtils.isNotEmpty((String) value), + "field value cannot be empty." + ); + } + + if (value instanceof byte[]) { + byte[] valueBytes = (byte[]) value; + + Preconditions.checkArgument( + ArrayUtils.isNotEmpty(valueBytes), + String.format("field value (%s) cannot be empty.", name) + ); + + valueToAssign = Arrays.copyOf(valueBytes, valueBytes.length); + } + + fieldValueSelections.put(name, valueToAssign); + } + + /** + * Retrieve the result set as a single + * {@link hirs.data.persist.ReferenceManifest}. This method is best used + * when selecting on a unique attribute. If the result set contains more + * than one RIM, one is chosen arbitrarily and returned. If no matching RIMs + * are found, this method returns null. + * + * @return a matching RIM or null if none is found + */ + public hirs.data.persist.ReferenceManifest getRIM() { + Set certs = execute(); + if (certs.isEmpty()) { + return null; + } + return certs.iterator().next(); + } + + /** + * Retrieve the result set as a set of + * {@link hirs.data.persist.ReferenceManifest}s. This method is best used + * when selecting on non-unique attributes. ReferenceManifests are populated + * into the set in no specific order. If no matching certificates are found, + * the returned Set will be empty. + * + * @return a Set of matching RIMs, possibly empty + */ + public Set getRIMs() { + return Collections.unmodifiableSet(new HashSet<>(execute())); + } + + /** + * Construct the criterion that can be used to query for rims matching the + * configuration of this {@link ReferenceManifestSelector}. + * + * @return a Criterion that can be used to query for rims matching the + * configuration of this instance + */ + Criterion getCriterion() { + Conjunction conj = new Conjunction(); + + for (Map.Entry fieldValueEntry : fieldValueSelections.entrySet()) { + conj.add(Restrictions.eq(fieldValueEntry.getKey(), fieldValueEntry.getValue())); + } + + if (this.excludeArchivedRims) { + conj.add(Restrictions.isNull(Certificate.ARCHIVE_FIELD)); + } + + return conj; + } + + /** + * @return the rim class that this instance will query + */ + public Class getReferenceManifestClass() { + return hirs.data.persist.ReferenceManifest.class; + } + + // construct and execute query + private Set execute() { + Set results = this.referenceManifestManager.get(this); + return results; + } + + /** + * Configures the selector to query for archived and unarchived rims. + * + * @return the selector + */ + public ReferenceManifestSelector includeArchived() { + this.excludeArchivedRims = false; + return this; + } +} diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/BaseElement.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/BaseElement.java new file mode 100644 index 00000000..94f64e27 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/CanonicalizationMethodType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/CanonicalizationMethodType.java new file mode 100644 index 00000000..6d9dfe1e --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/DSAKeyValueType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/DSAKeyValueType.java new file mode 100644 index 00000000..d29d0319 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/DigestMethodType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/DigestMethodType.java new file mode 100644 index 00000000..895f6036 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Directory.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Directory.java new file mode 100644 index 00000000..1140963d --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Entity.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Entity.java new file mode 100644 index 00000000..a6eba3f5 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Evidence.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Evidence.java new file mode 100644 index 00000000..cf3fa9a5 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/File.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/File.java new file mode 100644 index 00000000..3418b256 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/FilesystemItem.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/FilesystemItem.java new file mode 100644 index 00000000..e1a0b2cd --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyInfoType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyInfoType.java new file mode 100644 index 00000000..093d3dd7 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyValueType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyValueType.java new file mode 100644 index 00000000..c529fca1 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Link.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Link.java new file mode 100644 index 00000000..9ed59e21 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/ManifestType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/ManifestType.java new file mode 100644 index 00000000..cacc3643 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Meta.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Meta.java new file mode 100644 index 00000000..d7f5c75f --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectFactory.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectFactory.java new file mode 100644 index 00000000..99c05c55 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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 java.lang.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/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectType.java new file mode 100644 index 00000000..4221081c --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Ownership.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Ownership.java new file mode 100644 index 00000000..256725f5 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/PGPDataType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/PGPDataType.java new file mode 100644 index 00000000..2fd5d24b --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Process.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Process.java new file mode 100644 index 00000000..1dece4a2 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/RSAKeyValueType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/RSAKeyValueType.java new file mode 100644 index 00000000..793fa155 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/ReferenceType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/ReferenceType.java new file mode 100644 index 00000000..69e189cb --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Resource.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Resource.java new file mode 100644 index 00000000..704fdea8 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/ResourceCollection.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/ResourceCollection.java new file mode 100644 index 00000000..30e39361 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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 = java.lang.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 java.lang.Process } {@link Resource } + * + * + */ + public List getDirectoryOrFileOrProcess() { + if (directoryOrFileOrProcess == null) { + directoryOrFileOrProcess = new ArrayList(); + } + return this.directoryOrFileOrProcess; + } + +} diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/RetrievalMethodType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/RetrievalMethodType.java new file mode 100644 index 00000000..da835701 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SPKIDataType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SPKIDataType.java new file mode 100644 index 00000000..9873ad5a --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureMethodType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureMethodType.java new file mode 100644 index 00000000..3f04ab75 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertiesType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertiesType.java new file mode 100644 index 00000000..cce84acb --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertyType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertyType.java new file mode 100644 index 00000000..30a6bf73 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureType.java new file mode 100644 index 00000000..e50624bf --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureValueType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureValueType.java new file mode 100644 index 00000000..31ebc049 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SignedInfoType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignedInfoType.java new file mode 100644 index 00000000..e5a6e29f --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareIdentity.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareIdentity.java new file mode 100644 index 00000000..982c1e9f --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareIdentity.java @@ -0,0 +1,344 @@ +// +// 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.utils.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 } + * + */ + @SuppressWarnings("PMD") + 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/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareMeta.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareMeta.java new file mode 100644 index 00000000..bb605c78 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/TransformType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/TransformType.java new file mode 100644 index 00000000..c901645a --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/TransformsType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/TransformsType.java new file mode 100644 index 00000000..a811645c --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/Use.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Use.java new file mode 100644 index 00000000..e11024cc --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/X509DataType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/X509DataType.java new file mode 100644 index 00000000..0f1a0f64 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/X509IssuerSerialType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/X509IssuerSerialType.java new file mode 100644 index 00000000..5efe2c90 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.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/HIRS_Utils/src/main/java/hirs/utils/xjc/package-info.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/package-info.java new file mode 100644 index 00000000..c7c62799 --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/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.utils.xjc; + diff --git a/HIRS_Utils/src/main/resources/swid_schema.xsd b/HIRS_Utils/src/main/resources/swid_schema.xsd new file mode 100644 index 00000000..e3d3d202 --- /dev/null +++ b/HIRS_Utils/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