Add in the untracked files and configs

This commit is contained in:
Cyrus 2023-02-16 12:05:36 -05:00
parent d1b60c8c87
commit c23e4a4a07
94 changed files with 14505 additions and 0 deletions

View File

@ -25,6 +25,9 @@ repositories {
}
dependencies {
jaxb "org.glassfish.jaxb:jaxb-xjc:4.0.1"
jaxb "org.glassfish.jaxb:jaxb-runtime:4.0.1"
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
@ -34,8 +37,15 @@ dependencies {
implementation 'org.glassfish.web:jakarta.servlet.jsp.jstl:3.0.0'
implementation 'org.apache.httpcomponents.client5:httpclient5:5.2.1'
implementation 'commons-codec:commons-codec:1.15'
implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
implementation 'org.apache.logging.log4j:log4j-api:2.19.0'
implementation 'com.eclipsesource.minimal-json:minimal-json:0.9.5'
implementation 'com.fasterxml.jackson.core:jackson-core:2.14.2'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.14.2'
implementation "org.glassfish.jaxb:jaxb-runtime:4.0.1"
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'
implementation 'com.sun.xml.bind:jaxb-impl:4.0.2'
compileOnly 'org.projectlombok:lombok'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
annotationProcessor 'org.projectlombok:lombok'
@ -52,6 +62,13 @@ war {
archiveFileName = 'HIRS_AttestationCAPortal.war'
}
task generateXjcLibrary(type:Exec) {
workingDir 'config'
commandLine './genXjcLibrary.sh'
}
compileJava.dependsOn generateXjcLibrary
//ospackage {
// packageName = 'HIRS_AttestationCA'
// os = LINUX

View File

@ -0,0 +1,16 @@
#!/bin/bash
# Script to generate protobuf Java code. Called by gradle to compile the
# protobuf spec file to Java source. Generates the file
# hirs/attestationca/configuration/provisionerTpm2/ProvisionerTpm2.java.
dir=$(pwd)
# Relative paths are different when building locally versus on CI
if [[ "$dir" == *"package"* ]]; then
SRC_DIR=$dir/../../../../../../HIRS_ProvisionerTPM2/src
DEST_DIR=$dir/../src/main/java
else
SRC_DIR=../../HIRS_ProvisionerTPM2/src
DEST_DIR=../src/main/java
fi
protoc -I=$SRC_DIR --java_out=$DEST_DIR $SRC_DIR/ProvisionerTpm2.proto

View File

@ -0,0 +1,17 @@
#!/bin/bash
dir=$(pwd)
# Relative paths are different when building locally versus on CI
#if [[ "$dir" == *"package"* ]]; then
# SRC_DIR=$dir/../../../../../../src
# DEST_DIR=$dir/../src/main/java/
#else
SRC_DIR=/hirs/HIRS/src/
DEST_DIR=/hirs/HIRS/src/main/java #/hirs/attestationca/portal
#fi
XSD_FILE=$SRC_DIR/main/resources/swid_schema.xsd
if [ ! -d "$DEST_DIR/hirs/attestationca/portal/utils/xjc" ]; then
xjc -p hirs.attestationca.portal.utils.xjc $XSD_FILE -d $DEST_DIR -quiet
fi

View File

@ -0,0 +1,9 @@
package hirs.attestationca.portal.entity.manager;
import hirs.attestationca.portal.entity.userdefined.ReferenceManifest;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.UUID;
public interface ReferenceManifestRepository extends JpaRepository<ReferenceManifest, UUID> {
}

View File

@ -0,0 +1,72 @@
package hirs.attestationca.portal.entity.userdefined;
import hirs.attestationca.portal.entity.ArchivableEntity;
import jakarta.persistence.Access;
import jakarta.persistence.AccessType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.JdbcTypeCode;
import java.util.UUID;
/**
* This class represents that actual entry in the Support RIM.
* Digest Value, Event Type, index, RIM Tagid
*/
@ToString @EqualsAndHashCode(callSuper = false)
@Setter @Getter
@Entity
@Table(name = "ReferenceDigestValue")
@Access(AccessType.FIELD)
public class ReferenceDigestValue extends ArchivableEntity {
// @Type(type = "uuid-char")
@JdbcTypeCode(java.sql.Types.VARCHAR)
@Column
private UUID baseRimId;
// @Type(type = "uuid-char")
@JdbcTypeCode(java.sql.Types.VARCHAR)
@Column
private UUID supportRimId;
@Column(nullable = false)
private String manufacturer;
@Column(nullable = false)
private String model;
@Column(nullable = false)
private int pcrIndex;
@Column(nullable = false)
private String digestValue;
@Column(nullable = false)
private String eventType;
@Column(columnDefinition = "blob", nullable = true)
private byte[] contentBlob;
@Column(nullable = false)
private boolean matchFail;
@Column(nullable = false)
private boolean patched = false;
@Column(nullable = false)
private boolean updated = false;
/**
* Default constructor necessary for Hibernate.
*/
protected ReferenceDigestValue() {
super();
this.baseRimId = null;
this.supportRimId = null;
this.manufacturer = "";
this.model = "";
this.pcrIndex = -1;
this.digestValue = "";
this.eventType = "";
this.matchFail = false;
this.patched = false;
this.updated = false;
this.contentBlob = null;
}
}

View File

@ -0,0 +1,157 @@
package hirs.attestationca.portal.entity.userdefined;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.google.common.base.Preconditions;
import hirs.attestationca.portal.entity.ArchivableEntity;
import jakarta.persistence.Access;
import jakarta.persistence.AccessType;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.apache.commons.codec.binary.Hex;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.hibernate.annotations.JdbcTypeCode;
import javax.xml.XMLConstants;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.UUID;
/**
* This class represents the Reference Integrity Manifest object that will be
* loaded into the DB and displayed in the ACA.
*/
@Getter @Setter @ToString
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = false)
@Entity
@Table(name = "ReferenceManifest")
@Access(AccessType.FIELD)
public class ReferenceManifest extends ArchivableEntity {
private static final Logger LOGGER = LogManager.getLogger(ReferenceManifest.class);
/**
* Holds the name of the 'hexDecHash' field.
*/
public static final String HEX_DEC_HASH_FIELD = "hexDecHash";
/**
* String for display of a Base RIM.
*/
public static final String BASE_RIM = "Base";
/**
* String for display of a Support RIM.
*/
public static final String SUPPORT_RIM = "Support";
/**
* String for display of a Support RIM.
*/
public static final String MEASUREMENT_RIM = "Measurement";
/**
* 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";
@EqualsAndHashCode.Include
@Column(columnDefinition = "mediumblob", nullable = false)
private byte[] rimBytes;
@EqualsAndHashCode.Include
@Column(nullable = false)
private String rimType = "Base";
@Column
private String tagId = null;
@Column
private boolean swidPatch = false;
@Column
private boolean swidSupplemental = false;
@Column
private String platformManufacturer = null;
@Column
private String platformManufacturerId = null;
@Column
private String swidTagVersion = null;
@Column
private String swidVersion = null;
@Column
private String platformModel = null;
@Column(nullable = false)
private String fileName = null;
// @Type(type="uuid-char")
@JdbcTypeCode(java.sql.Types.VARCHAR)
@Column
private UUID associatedRim;
@Column
private String deviceName;
@Column
private String hexDecHash = "";
@Column
private String eventLogHash = "";
/**
* Default constructor necessary for Hibernate.
*/
protected ReferenceManifest() {
super();
this.rimBytes = null;
this.rimType = null;
this.platformManufacturer = null;
this.platformManufacturerId = null;
this.platformModel = null;
this.fileName = BASE_RIM;
this.tagId = null;
this.associatedRim = null;
}
/**
* Default constructor for ingesting the bytes of the file content.
* @param rimBytes - file contents.
*/
public ReferenceManifest(final byte[] rimBytes) {
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();
MessageDigest digest = null;
this.hexDecHash = "";
try {
digest = MessageDigest.getInstance("SHA-256");
this.hexDecHash = Hex.encodeHexString(
digest.digest(rimBytes));
} catch (NoSuchAlgorithmException noSaEx) {
LOGGER.error(noSaEx);
}
}
/**
* Getter for the Reference Integrity Manifest as a byte array.
*
* @return array of bytes
*/
@JsonIgnore
public byte[] getRimBytes() {
if (this.rimBytes != null) {
return this.rimBytes.clone();
}
return null;
}
}

View File

@ -0,0 +1,390 @@
package hirs.attestationca.portal.entity.userdefined.rim;
import com.fasterxml.jackson.annotation.JsonIgnore;
import hirs.attestationca.portal.entity.userdefined.ReferenceManifest;
import hirs.attestationca.portal.service.ReferenceManifestServiceImpl;
import hirs.attestationca.portal.utils.SwidResource;
import hirs.attestationca.portal.utils.xjc.BaseElement;
import hirs.attestationca.portal.utils.xjc.Directory;
import hirs.attestationca.portal.utils.xjc.File;
import hirs.attestationca.portal.utils.xjc.FilesystemItem;
import hirs.attestationca.portal.utils.xjc.Link;
import hirs.attestationca.portal.utils.xjc.Meta;
import hirs.attestationca.portal.utils.xjc.ResourceCollection;
import hirs.attestationca.portal.utils.xjc.SoftwareIdentity;
import hirs.attestationca.portal.utils.xjc.SoftwareMeta;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.xml.bind.JAXBContext;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.JAXBException;
import jakarta.xml.bind.UnmarshalException;
import jakarta.xml.bind.Unmarshaller;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.xml.namespace.QName;
import javax.xml.validation.Schema;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Base64;
import java.util.List;
import java.util.Map;
/**
*
*/
@Getter
@Setter
@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Entity
public class BaseReferenceManifest extends ReferenceManifest {
private static final Logger LOGGER = LogManager.getLogger(BaseReferenceManifest.class);
/**
* Holds the name of the 'base64Hash' field.
*/
public static final String BASE_64_HASH_FIELD = "base64Hash";
private static JAXBContext jaxbContext;
@Column
@JsonIgnore
private String base64Hash = "";
@Column
private String swidName = null;
@Column
private int swidCorpus = 0;
@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;
private String entityName = null;
private String entityRegId = null;
private String entityRole = null;
private String entityThumbprint = null;
private String linkHref = null;
private String linkRel = null;
/**
* Support constructor for the RIM object.
*
* @param fileName - string representation of the uploaded file.
* @param rimBytes - the file content of the uploaded file.
* @throws IOException - thrown if the file is invalid.
*/
public BaseReferenceManifest(final String fileName, final byte[] rimBytes) throws IOException {
this(rimBytes);
this.setFileName(fileName);
}
/**
* 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
*/
@SuppressWarnings("checkstyle:AvoidInlineConditionals")
public BaseReferenceManifest(final byte[] rimBytes) throws IOException {
super(rimBytes);
this.setRimType(BASE_RIM);
this.setFileName("");
SoftwareIdentity si = validateSwidTag(new ByteArrayInputStream(rimBytes));
MessageDigest digest = null;
this.base64Hash = "";
try {
digest = MessageDigest.getInstance("SHA-256");
this.base64Hash = Base64.getEncoder().encodeToString(
digest.digest(rimBytes));
} catch (NoSuchAlgorithmException noSaEx) {
LOGGER.error(noSaEx);
}
// begin parsing valid swid tag
if (si != null) {
setTagId(si.getTagId());
this.swidName = si.getName();
this.swidCorpus = si.isCorpus() ? 1 : 0;
this.setSwidPatch(si.isPatch());
this.setSwidSupplemental(si.isSupplemental());
this.setSwidVersion(si.getVersion());
if (si.getTagVersion() != null) {
this.setSwidTagVersion(si.getTagVersion().toString());
}
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.attestationca.portal.utils.xjc.Entity entity
= (hirs.attestationca.portal.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":
Link link
= (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 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<QName, String> 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.setPlatformManufacturerId(entry.getValue());
break;
case "platformModel":
this.setPlatformModel(entry.getValue());
break;
case "platformManufacturerStr":
this.setPlatformManufacturer(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:
}
}
}
}
/**
* 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.
*/
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;
}
/**
* 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
*/
private BaseElement getBaseElementFromBytes(final String elementName) {
BaseElement baseElement = null;
if (getRimBytes() != null && elementName != null) {
try {
SoftwareIdentity si = validateSwidTag(new ByteArrayInputStream(getRimBytes()));
JAXBElement element;
for (Object object : si.getEntityOrEvidenceOrLink()) {
if (object instanceof 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 method unmarshalls the swidtag found at [path] and validates it
* according to the schema.
*
* @param stream 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;
try {
schema = ReferenceManifestServiceImpl.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 Base RIM, swidtag format expected.");
}
}
/**
* Default method for parsing the payload element.
*
* @return a collection of payload objects.
*/
public final List<SwidResource> 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<SwidResource> parseResource(final ResourceCollection rc) {
List<SwidResource> 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(
(File) fsi, null));
}
}
} else if (meta instanceof File) {
resources.add(new SwidResource((File) meta, null));
}
}
}
}
} 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;
}
@Override
public String toString() {
return String.format("ReferenceManifest{swidName=%s,"
+ "platformManufacturer=%s,"
+ " platformModel=%s,"
+ "tagId=%s, rimHash=%s}",
swidName, this.getPlatformManufacturer(),
this.getPlatformModel(), getTagId(), this.getBase64Hash());
}
}

View File

@ -0,0 +1,67 @@
package hirs.attestationca.portal.entity.userdefined.rim;
import com.fasterxml.jackson.annotation.JsonIgnore;
import hirs.attestationca.portal.entity.userdefined.ReferenceManifest;
import hirs.attestationca.portal.enums.AppraisalStatus;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import lombok.Getter;
import lombok.Setter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
/**
* Sub class that will just focus on PCR Values and Events.
* Similar to {@link hirs.attestationca.portal.entity.userdefined.rim.SupportReferenceManifest}
* however this is the live log from the client.
*/
@Entity
public class EventLogMeasurements extends ReferenceManifest {
private static final Logger LOGGER = LogManager.getLogger(EventLogMeasurements.class);
@Column
@JsonIgnore
@Getter @Setter
private int pcrHash = 0;
@Enumerated(EnumType.STRING)
@Getter @Setter
private AppraisalStatus.Status overallValidationResult = AppraisalStatus.Status.FAIL;
/**
* Support constructor for the RIM object.
*
* @param rimBytes byte array representation of the RIM
* @throws java.io.IOException if unable to unmarshal the string
*/
public EventLogMeasurements(final byte[] rimBytes) throws IOException {
this("blank.measurement", rimBytes);
}
/**
* Support constructor for the RIM object.
*
* @param fileName - string representation of the uploaded file.
* @param rimBytes byte array representation of the RIM
* @throws java.io.IOException if unable to unmarshal the string
*/
public EventLogMeasurements(final String fileName,
final byte[] rimBytes) throws IOException {
super(rimBytes);
this.setFileName(fileName);
this.archive("Event Log Measurement");
this.setRimType(MEASUREMENT_RIM);
this.pcrHash = 0;
}
/**
* Default constructor necessary for Hibernate.
*/
protected EventLogMeasurements() {
super();
this.pcrHash = 0;
}
}

View File

@ -0,0 +1,115 @@
package hirs.attestationca.portal.entity.userdefined.rim;
import com.fasterxml.jackson.annotation.JsonIgnore;
import hirs.attestationca.portal.entity.userdefined.ReferenceManifest;
import hirs.attestationca.portal.utils.tpm.eventlog.TCGEventLog;
import hirs.attestationca.portal.utils.tpm.eventlog.TpmPcrEvent;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import lombok.Getter;
import lombok.Setter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
/**
* Sub class that will just focus on PCR Values and Events.
*/
@Getter
@Setter
@Entity
public class SupportReferenceManifest extends ReferenceManifest {
private static final Logger LOGGER = LogManager.getLogger(SupportReferenceManifest.class);
@Column
@JsonIgnore
private int pcrHash = 0;
@Column
private boolean updated = false;
@Column
private boolean processed = false;
/**
* Main constructor for the RIM object. This takes in a byte array of a
* valid swidtag file and parses the information.
*
* @param fileName - string representation of the uploaded file.
* @param rimBytes byte array representation of the RIM
* @throws IOException if unable to unmarshal the string
*/
public SupportReferenceManifest(final String fileName,
final byte[] rimBytes) throws IOException {
super(rimBytes);
this.setFileName(fileName);
this.setRimType(SUPPORT_RIM);
this.pcrHash = 0;
}
/**
* 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 SupportReferenceManifest(final byte[] rimBytes) throws IOException {
this("blank.rimel", rimBytes);
}
/**
* Default constructor necessary for Hibernate.
*/
protected SupportReferenceManifest() {
super();
this.pcrHash = 0;
}
/**
* Getter method for the expected PCR values contained within the support
* RIM.
* @return a string array of the pcr values.
*/
public String[] getExpectedPCRList() {
try {
TCGEventLog logProcessor = new TCGEventLog(this.getRimBytes());
this.pcrHash = Arrays.hashCode(logProcessor.getExpectedPCRValues());
return logProcessor.getExpectedPCRValues();
} catch (CertificateException cEx) {
LOGGER.error(cEx);
} catch (NoSuchAlgorithmException noSaEx) {
LOGGER.error(noSaEx);
} catch (IOException ioEx) {
LOGGER.error(ioEx);
}
return new String[0];
}
/**
* Getter method for the event log that should be present in the support RIM.
*
* @return list of TPM PCR Events for display
*/
public Collection<TpmPcrEvent> getEventLog() {
TCGEventLog logProcessor = null;
try {
logProcessor = new TCGEventLog(this.getRimBytes());
return logProcessor.getEventList();
} catch (CertificateException cEx) {
LOGGER.error(cEx);
} catch (NoSuchAlgorithmException noSaEx) {
LOGGER.error(noSaEx);
} catch (IOException ioEx) {
LOGGER.error(ioEx);
}
return new ArrayList<>();
}
}

View File

@ -0,0 +1,71 @@
package hirs.attestationca.portal.service;
import hirs.attestationca.portal.entity.manager.ReferenceManifestRepository;
import hirs.attestationca.portal.entity.userdefined.ReferenceManifest;
import jakarta.persistence.EntityManager;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.xml.sax.SAXException;
import javax.xml.transform.stream.StreamSource;
import javax.xml.validation.Schema;
import javax.xml.validation.SchemaFactory;
import java.io.IOException;
import java.io.InputStream;
@Service
public class ReferenceManifestServiceImpl {
private static final Logger LOGGER = LogManager.getLogger(ReferenceManifestServiceImpl.class);
/**
* The variable that establishes a schema factory for xml processing.
*/
public static final SchemaFactory SCHEMA_FACTORY
= SchemaFactory.newInstance(ReferenceManifest.SCHEMA_LANGUAGE);
@Autowired(required = false)
private EntityManager entityManager;
@Autowired
private ReferenceManifestRepository repository;
private static Schema schema;
public ReferenceManifestServiceImpl() {
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;
}
}

View File

@ -0,0 +1,115 @@
package hirs.attestationca.portal.utils;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import java.math.BigInteger;
/**
* Utilities for working with hex strings and byte arrays.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class HexUtils {
/**
* The mathematical base for the hexadecimal representation.
*/
public static final int HEX_BASIS = 16;
/**
* An integer representation of the byte 0xff or 255.
*/
public static final int FF_BYTE = 0xff;
/**
* Converts a binary hex string to a byte array.
* @param s string to convert
* @return byte array representation of s
*/
public static byte[] hexStringToByteArray(final String s) {
int sizeInt = s.length() / 2;
byte[] returnArray = new byte[sizeInt];
String byteVal;
for (int i = 0; i < sizeInt; i++) {
int index = 2 * i;
byteVal = s.substring(index, index + 2);
returnArray[i] = (byte) (Integer.parseInt(byteVal, HEX_BASIS));
}
return returnArray;
}
/**
* Converts a byte array to a hex represented binary string.
* @param b byte array to convert
* @return hex string representation of array
*/
public static String byteArrayToHexString(final byte[] b) {
StringBuilder sb = new StringBuilder();
String returnStr = "";
for (int i = 0; i < b.length; i++) {
String singleByte = Integer.toHexString(b[i] & FF_BYTE);
if (singleByte.length() != 2) {
singleByte = "0" + singleByte;
}
returnStr = sb.append(singleByte).toString();
}
return returnStr;
}
/**
* Converts an individual hex string to an integer.
* @param s an individual hex string
* @return an integer representation of a hex string
*/
public static Integer hexToInt(final String s) {
Integer i = Integer.parseInt(s, HEX_BASIS);
return i;
}
/**
* Takes a byte array returns a subset of the array.
* @param b the array to take a subset of
* @param start the first index to copy
* @param end the last index to copy (inclusive)
* @return a new array of bytes from start to end
*/
public static byte[] subarray(final byte[] b, final int start, final int end) {
byte[] copy = new byte[end - start + 1];
System.arraycopy(b, start, copy, 0, end - start + 1);
return copy;
}
/**
* Takes in a byte array and reverses the order.
* @param in byte array to reverse
* @return reversed byte array
*/
public static byte[] leReverseByte(final byte[] in) {
byte[] finished = new byte[in.length];
for (int i = 0; i < finished.length; i++) {
finished[i] = in[(in.length - 1) - i];
}
return finished;
}
/**
* Takes in a byte array and reverses the order then converts to an int.
* @param in byte array to reverse
* @return integer that represents the reversed byte array
*/
public static int leReverseInt(final byte[] in) {
byte[] finished = leReverseByte(in);
return new BigInteger(finished).intValue();
}
/**
* Takes in a byte array of 4 bytes and returns a long.
* @param bytes byte array to convert
* @return long representation of the bytes
*/
public static long bytesToLong(final byte[] bytes) {
BigInteger lValue = new BigInteger(bytes);
return lValue.abs().longValue();
}
}

View File

@ -0,0 +1,102 @@
package hirs.attestationca.portal.utils;
import com.eclipsesource.json.Json;
import com.eclipsesource.json.JsonObject;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
/**
* A utility class for common JSON operations using the {@link com.eclipsesource}
* library.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class JsonUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(JsonUtils.class);
/**
* Getter for the JSON Object that is associated with the elementName value
* mapped in the associated JSON file.
* Default {@link java.nio.charset.Charset} is UTF 8
*
* @param jsonPath the object holding the location of the file to parse.
* @param elementName the specific object to pull from the file
* @return a JSON object
*/
public static JsonObject getSpecificJsonObject(final Path jsonPath, final String elementName) {
// find the file and load it
return getSpecificJsonObject(jsonPath, elementName, StandardCharsets.UTF_8);
}
/**
* Getter for the JSON Object that is associated with the elementName value
* mapped in the associated JSON file.
* Default {@link java.nio.charset.Charset} is UTF 8
*
* @param jsonPath the object holding the location of the file to parse.
* @param elementName the specific object to pull from the file
* @param charset the character set to use
* @return a JSON object
*/
public static JsonObject getSpecificJsonObject(final Path jsonPath,
final String elementName,
final Charset charset) {
// find the file and load it
JsonObject jsonObject = getJsonObject(jsonPath, charset);
if (jsonObject != null && jsonObject.get(elementName) != null) {
return jsonObject.get(elementName).asObject();
}
return new JsonObject();
}
/**
* Getter for the JSON Object that is mapped in the associated JSON file.
* Default {@link java.nio.charset.Charset} is UTF 8
*
* @param jsonPath the object holding the location of the file to parse.
* @return a JSON object
*/
public static JsonObject getJsonObject(final Path jsonPath) {
return getJsonObject(jsonPath, StandardCharsets.UTF_8);
}
/**
* Getter for the JSON Object that is mapped in the associated JSON file.
*
* @param jsonPath the object holding the location of the file to parse.
* @param charset the character set to use
* @return a JSON object
*/
public static JsonObject getJsonObject(final Path jsonPath, final Charset charset) {
// find the file and load it
JsonObject jsonObject = new JsonObject();
if (Files.notExists(jsonPath)) {
LOGGER.warn(String.format("No file found at %s.", jsonPath.toString()));
} else {
try {
InputStream inputStream = new FileInputStream(jsonPath.toString());
jsonObject = Json.parse(new InputStreamReader(inputStream,
charset)).asObject();
} catch (IOException ex) {
// add log file thing here indication issue with JSON File
jsonObject = new JsonObject();
}
}
return jsonObject;
}
}

View File

@ -0,0 +1,146 @@
package hirs.attestationca.portal.utils;
import com.google.common.base.Preconditions;
import hirs.attestationca.portal.utils.digest.DigestAlgorithm;
import lombok.Getter;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import hirs.attestationca.portal.utils.xjc.File;
import javax.xml.namespace.QName;
import java.math.BigInteger;
import java.util.Map;
/**
* This object is used to represent the content of a Swid Tags Directory
* section.
*/
public class SwidResource {
private static final Logger LOGGER = LogManager.getLogger(SwidResource.class);
@Getter
private String name, size;
@Getter
private String rimFormat, rimType, rimUriGlobal, hashValue;
// private TpmWhiteListBaseline tpmWhiteList;
private DigestAlgorithm digest = DigestAlgorithm.SHA1;
@Getter
private boolean validFileSize = false;
/**
* 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 File}
* @param digest algorithm associated with pcr values
*/
public SwidResource(final File file, final DigestAlgorithm digest) {
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
// no size even though it is required.
if (file.getSize() != null) {
this.size = file.getSize().toString();
} else {
this.size = BigInteger.ZERO.toString();
}
for (Map.Entry<QName, String> 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:
}
}
this.digest = digest;
// tpmWhiteList = new TpmWhiteListBaseline(this.name);
}
/**
* 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 of the file.
*
* @return string of the hash
*/
public String getHashValue() {
return hashValue;
}
/**
* flag for if the file sizes match with the swidtag.
* @return true if they match
*/
public boolean isValidFileSize() {
return validFileSize;
}
}

View File

@ -0,0 +1,247 @@
package hirs.attestationca.portal.utils.digest;
import jakarta.xml.bind.DatatypeConverter;
import org.apache.commons.codec.binary.Hex;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.util.ArrayUtils;
import java.util.Arrays;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* This abstract class represents a message digest. Extending classes include
* {@link hirs.attestationca.portal.utils.digest.Digest} and {@link hirs.attestationca.portal.utils.digest.OptionalDigest}.
* <p>
* Two classes were made to facilitate persisting them with Hibernate in different ways.
* To persist non-nullable entries in an embedded collection, use {@link hirs.attestationca.portal.utils.digest.Digest} (see
* {@link TPMBaseline} for reference.) To persist nullable entries, use {@link hirs.attestationca.portal.utils.digest.OptionalDigest}
* (see {@link ImaBlacklistRecord} for reference.)
*/
public abstract class AbstractDigest {
private static final org.apache.logging.log4j.Logger LOGGER =
LogManager.getLogger(AbstractDigest.class);
/**
* Length of MD2 digest.
*/
public static final int MD2_DIGEST_LENGTH = 16;
/**
* Length of MD5 digest.
*/
public static final int MD5_DIGEST_LENGTH = 16;
/**
* Length of SHA1 digest.
*/
public static final int SHA1_DIGEST_LENGTH = 20;
/**
* Length of SHA256 digest.
*/
public static final int SHA256_DIGEST_LENGTH = 32;
/**
* Length of SHA384 digest.
*/
public static final int SHA384_DIGEST_LENGTH = 48;
/**
* Length of SHA512 digest.
*/
public static final int SHA512_DIGEST_LENGTH = 64;
/**
* Ensures the given algorithm type and digest byte array represent a valid digest.
* This includes ensuring they are both not null or empty and ensuring that the length of the
* digest matches the expected amount of data for the given algorithm.
*
* @param algorithm a digest algorithm
* @param digest the digest computed by this algorithm
* @throws IllegalArgumentException if the provided input does not represent a valid digest
*/
void validateInput(final DigestAlgorithm algorithm, final byte[] digest)
throws IllegalArgumentException {
if (algorithm == null) {
throw new IllegalArgumentException("Algorithm must not be null");
}
if (ArrayUtils.isEmpty(digest)) {
throw new IllegalArgumentException("Digest must have at least one byte");
}
if (digest.length != algorithm.getLengthInBytes()) {
throw new AbstractDigest.IllegalDigestLength(algorithm, digest);
}
}
/**
* This method will help class determine the algorithm associated with the
* pcr values given.
*
* @param digest list of pcr values.
* @return the associated algorithm.
*/
public static final DigestAlgorithm getDigestAlgorithm(final byte[] digest) {
if (digest == null || ArrayUtils.isEmpty(digest)) {
return DigestAlgorithm.UNSPECIFIED;
}
switch (digest.length) {
case MD2_DIGEST_LENGTH:
return DigestAlgorithm.MD5;
case SHA1_DIGEST_LENGTH:
return DigestAlgorithm.SHA1;
case SHA256_DIGEST_LENGTH:
return DigestAlgorithm.SHA256;
case SHA384_DIGEST_LENGTH:
return DigestAlgorithm.SHA384;
case SHA512_DIGEST_LENGTH:
return DigestAlgorithm.SHA512;
default:
return DigestAlgorithm.UNSPECIFIED;
}
}
/**
* This method will help class determine the algorithm associated with the
* pcr values given.
*
* @param digest list of pcr values.
* @return the associated algorithm.
*/
public static final DigestAlgorithm getDigestAlgorithm(final String digest) {
try {
return getDigestAlgorithm(Hex.decodeHex(digest.toCharArray()));
} catch (Exception deEx) {
LOGGER.error(deEx);
}
return DigestAlgorithm.UNSPECIFIED;
}
/**
* Retrieves the <code>DigestAlgorithm</code> that identifies which hash
* function generated the digest.
*
* @return digest algorithm
*/
public abstract DigestAlgorithm getAlgorithm();
/**
* Retrieves the digest.
*
* @return digest
*/
public abstract byte[] getDigest();
/**
* Returns a hex <code>String</code> representing the binary digest.
*
* @return hex representation of digest
*/
public String getDigestString() {
return Hex.encodeHexString(getDigest());
}
/**
* Compares this digest's hash with another digest's hash.
* @param otherDigest a Digest to compare to.
* @return the comparison result type.
*/
public DigestComparisonResultType compare(final Digest otherDigest) {
if (null == otherDigest) {
return DigestComparisonResultType.UNKNOWN;
}
if (this.equals(otherDigest)) {
return DigestComparisonResultType.MATCH;
}
return DigestComparisonResultType.MISMATCH;
}
/**
* Parses a {@link DigestAlgorithm} from a String returned by {@link AbstractDigest#toString()}.
*
* @param digest the digest string as computed above
* @return the DigestAlgorithm component of the String
*/
static DigestAlgorithm algorithmFromString(final String digest) {
return DigestAlgorithm.findByString(matchString(digest).group(1));
}
/**
* Parses a digest from a String returned by {@link AbstractDigest#toString()}.
*
* @param digest the digest string as computed above
* @return the byte array representing the actual digest
*/
static byte[] digestFromString(final String digest) {
return DatatypeConverter.parseHexBinary(matchString(digest).group(2));
}
private static Matcher matchString(final String digest) {
Pattern digestPattern = Pattern.compile("(.*) - 0x(.*)");
Matcher matcher = digestPattern.matcher(digest);
if (!matcher.matches()) {
String message = String.format("String \"%s\" did not match pattern \"%s\"", digest,
digestPattern.toString());
throw new IllegalArgumentException(message);
}
return matcher;
}
@Override
public final int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + getAlgorithm().hashCode();
result = prime * result + Arrays.hashCode(getDigest());
return result;
}
@Override
public final boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj == null || !(obj instanceof AbstractDigest)) {
return false;
}
AbstractDigest other = (AbstractDigest) obj;
if (getAlgorithm() != other.getAlgorithm()) {
return false;
}
if (!Arrays.equals(getDigest(), other.getDigest())) {
return false;
}
return true;
}
/**
* Returns the standard algorithm name and a hexadecimal representation of
* the bytes.
*
* @return string representation
*/
@Override
public String toString() {
//NOTE: Any updates here should also be reflected in fromString()
return String.format("%s - 0x%s", getAlgorithm().getStandardAlgorithmName(),
Hex.encodeHexString(getDigest()));
}
private static final class IllegalDigestLength extends
IllegalArgumentException {
private static final long serialVersionUID = 8782184397041237374L;
private IllegalDigestLength(final DigestAlgorithm algorithm,
final byte[] digest) {
super(String.format(
"digest length (%d) does not match that of algorithm (%s)",
digest.length, algorithm.toString()));
}
}
}

View File

@ -0,0 +1,136 @@
package hirs.attestationca.portal.utils.digest;
import jakarta.persistence.Access;
import jakarta.persistence.AccessType;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.xml.bind.annotation.XmlElement;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import java.util.Arrays;
/**
* This class represents a message digest. This stores the bytes of a message
* digest as computed by a hash function.
* <p>
* This class differs from Java's provided <code>MessageDigest</code> class by the
* fact that it does not compute a digest. This class simply stores the result
* of a digest. This is useful for scenarios where the digest is already known.
* This is the case for IMA reports that already have the digest computed. The
* <code>MessageDigest</code> class does not provide a means to store that value.
* The value must be computed.
*/
@Embeddable
@Access(AccessType.FIELD)
public final class Digest extends AbstractDigest {
/**
* A SHA1 digest whose content is all zeros.
*/
public static final Digest SHA1_ZERO = new Digest(
DigestAlgorithm.SHA1,
new byte[SHA1_DIGEST_LENGTH]
);
private static final String SHA1_EMPTY_HEX =
"da39a3ee5e6b4b0d3255bfef95601890afd80709";
/**
* A SHA1 digest whose content is the hash of an empty buffer.
*/
public static final Digest SHA1_OF_NO_DATA;
static {
try {
SHA1_OF_NO_DATA = new Digest(
DigestAlgorithm.SHA1,
Hex.decodeHex(SHA1_EMPTY_HEX.toCharArray())
);
} catch (DecoderException e) {
throw new RuntimeException("Could not decode hex value", e);
}
}
@XmlElement
@Column(nullable = false, name = "digest", length = SHA512_DIGEST_LENGTH,
columnDefinition = "varbinary(64)")
private final byte[] digest;
@XmlElement
@Column(nullable = false)
@Enumerated(EnumType.ORDINAL)
private final DigestAlgorithm algorithm;
/**
* Creates a new <code>Digest</code>.
*
* @param algorithm algorithm used to generate the digest
* @param digest digest value
* @throws IllegalArgumentException if digest length does not match that of the algorithm
*/
public Digest(final DigestAlgorithm algorithm, final byte[] digest)
throws IllegalArgumentException {
validateInput(algorithm, digest);
this.algorithm = algorithm;
this.digest = Arrays.copyOf(digest, digest.length);
}
/**
* Creates a new <code>Digest</code> when an algorithm isn't specified.
* @param digest byte array value
*/
public Digest(final byte[] digest) {
this(AbstractDigest.getDigestAlgorithm(digest), digest);
}
/**
* Default constructor necessary for Hibernate.
*/
protected Digest() {
this.algorithm = null;
this.digest = null;
}
/**
* Retrieves the <code>DigestAlgorithm</code> that identifies which hash
* function generated the digest.
*
* @return digest algorithm
*/
@Override
public DigestAlgorithm getAlgorithm() {
return this.algorithm;
}
/**
* Retrieves the digest.
*
* @return digest
*/
@Override
public byte[] getDigest() {
return Arrays.copyOf(this.digest, this.digest.length);
}
/**
* Returns a new Digest with the same attributes as this instance.
*
* @return a new equivalent Digest
*/
public OptionalDigest asOptionalDigest() {
return new OptionalDigest(algorithm, digest);
}
/**
* Helper method to reverse the toString method. Returns a Digest given a String
* that was created using an AbstractDigest's toString method.
*
* @param digest String representation of an AbstractDigest
* @return Digest object recreated from the String passed in
*/
public static Digest fromString(final String digest) {
return new Digest(algorithmFromString(digest), digestFromString(digest));
}
}

View File

@ -0,0 +1,66 @@
package hirs.attestationca.portal.utils.digest;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* Enum of digest algorithms. The enum values also provide a standardized
* algorithm name. The standardized algorithm name is a String of the algorithm
* name as defined by Java.
*/
@Getter
@AllArgsConstructor
public enum DigestAlgorithm {
/**
* MD2 digest algorithm.
*/
MD2("MD2", AbstractDigest.MD2_DIGEST_LENGTH),
/**
* MD5 digest algorithm.
*/
MD5("MD5", AbstractDigest.MD5_DIGEST_LENGTH),
/**
* SHA-1 digest algorithm.
*/
SHA1("SHA-1", AbstractDigest.SHA1_DIGEST_LENGTH),
/**
* SHA-256 digest algorithm.
*/
SHA256("SHA-256", AbstractDigest.SHA256_DIGEST_LENGTH),
/**
* SHA-384 digest algorithm.
*/
SHA384("SHA-384", AbstractDigest.SHA384_DIGEST_LENGTH),
/**
* SHA-512 digest algorithm.
*/
SHA512("SHA-512", AbstractDigest.SHA512_DIGEST_LENGTH),
/**
* Condition used when an algorithm is not specified and
* the size doesn't match known digests.
*/
UNSPECIFIED("NOT SPECIFIED", Integer.BYTES);
private final String standardAlgorithmName;
private final int lengthInBytes;
/**
* Returns a DigestAlgorithm object given a String. The String is expected to be one of the
* options for standardAlgorithmName. Throws an IllegalArgumentException if no Enum exists with
* that value.
*
* @param standardAlgorithmName
* String value of the Enum
* @return DigestAlgorithm object
*/
public static DigestAlgorithm findByString(final String standardAlgorithmName) {
for (DigestAlgorithm algorithm: DigestAlgorithm.values()) {
if (algorithm.getStandardAlgorithmName().equals(standardAlgorithmName)) {
return algorithm;
}
}
throw new IllegalArgumentException(String.format("No constant with text \"%s\" found",
standardAlgorithmName));
}
}

View File

@ -0,0 +1,24 @@
package hirs.attestationca.portal.utils.digest;
/**
* Enumeration identifying the different outcomes of a comparison between
* two {@link Digest} objects.
*
*/
public enum DigestComparisonResultType {
/**
* When one of the Digests compared has a hash that is uninitialized, defaulted, or
* is a byte array equal to zero.
*/
UNKNOWN,
/**
* When the two digest hashes are equal, and are not zeroized / defaulted hash arrays.
*/
MATCH,
/**
* When the two digest hashes are not equal, and are not zeroized / defaulted hash arrays.
*/
MISMATCH,
}

View File

@ -0,0 +1,96 @@
package hirs.attestationca.portal.utils.digest;
import jakarta.persistence.Access;
import jakarta.persistence.AccessType;
import jakarta.persistence.Column;
import jakarta.persistence.Embeddable;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.xml.bind.annotation.XmlElement;
import java.util.Arrays;
/**
* This class is identical to {@link Digest} except its fields are nullable. However, in practice,
* an instance of this class cannot have null values assigned to its fields. The fields are marked
* as nullable to allow Hibernate to set a reference an embedded instance of this class to null
* (as there is no way for Hibernate to distinguish between a null reference and completely
* null fields on an embedded entity.) Otherwise, there is no operational difference between
* this class and {@link Digest}.
*/
@Embeddable
@Access(AccessType.FIELD)
public final class OptionalDigest extends AbstractDigest {
@XmlElement
@Column(nullable = true, name = "digest", length = SHA512_DIGEST_LENGTH,
columnDefinition = "varbinary(64)")
private final byte[] digest;
@XmlElement
@Column(nullable = true)
@Enumerated(EnumType.ORDINAL)
private final DigestAlgorithm algorithm;
/**
* Creates a new <code>OptionalDigest</code>.
*
* @param algorithm algorithm used to generate the digest
* @param digest digest value
* @throws IllegalArgumentException if digest length does not match that of the algorithm
*/
public OptionalDigest(final DigestAlgorithm algorithm, final byte[] digest)
throws IllegalArgumentException {
validateInput(algorithm, digest);
this.algorithm = algorithm;
this.digest = Arrays.copyOf(digest, digest.length);
}
/**
* Default constructor necessary for Hibernate.
*/
protected OptionalDigest() {
this.algorithm = null;
this.digest = null;
}
/**
* Returns the <code>DigestAlgorithm</code> that identifies which hash
* function generated the digest.
*
* @return digest algorithm
*/
@Override
public DigestAlgorithm getAlgorithm() {
return algorithm;
}
/**
* Returns the digest.
*
* @return digest
*/
@Override
public byte[] getDigest() {
return Arrays.copyOf(this.digest, this.digest.length);
}
/**
* Returns a new Digest with the same attributes as this instance.
*
* @return a new equivalent Digest
*/
public Digest asDigest() {
return new Digest(algorithm, digest);
}
/**
* Helper method to reverse the toString method. Returns an OptionalDigest given a String
* that was created using an AbstractDigest's toString method.
*
* @param digest String representation of an AbstractDigest
* @return OptionalDigest object recreated from the String passed in
*/
public static OptionalDigest fromString(final String digest) {
return new OptionalDigest(algorithmFromString(digest), digestFromString(digest));
}
}

View File

@ -0,0 +1,46 @@
package hirs.attestationca.portal.utils.tpm;
/**
* This class represents an <code>Exception</code> generated by
* <code>CreateTPMBaseline</code>.
*/
public class TPMBaselineGeneratorException extends Exception {
private static final long serialVersionUID = 8850867303391694668L;
/**
* Creates a new <code>CreateTPMBaselineException</code> that has the
* message <code>msg</code>.
*
* @param msg
* exception message
*/
TPMBaselineGeneratorException(final String msg) {
super(msg);
}
/**
* Creates a new <code>CreateTPMBaselineException</code> that wraps the
* given <code>Throwable</code>.
*
* @param t
* root cause
*/
TPMBaselineGeneratorException(final Throwable t) {
super(t);
}
/**
* Creates a new <code>CreateTPMBaselineException</code> that has the
* message <code>msg</code> and wraps the root cause.
*
* @param msg
* exception message
* @param t
* root cause
*/
TPMBaselineGeneratorException(final String msg, final Throwable t) {
super(msg, t);
}
}

View File

@ -0,0 +1,350 @@
package hirs.attestationca.portal.utils.tpm.eventlog;
import hirs.attestationca.portal.utils.digest.AbstractDigest;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import lombok.Getter;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.Collection;
import java.util.LinkedHashMap;
/**
* Class for handling different formats of TCG Event logs.
*/
public final class TCGEventLog {
/** Logger. */
private static final Logger LOGGER = LogManager.getLogger(TCGEventLog.class);
/** Name of the hash algorithm used to process the Event Log, default is SHA256. */
@Getter
private String algorithm = "TPM_ALG_SHA256";
/** Parsed event log array. */
private static final int SIG_OFFSET = 32;
/** TEV_NO_ACTION signature size. */
private static final int SIG_SIZE = 16;
/** Initial value for SHA 256 values.*/
public static final String INIT_SHA256_LIST = "00000000000000000000000000"
+ "00000000000000000000000000000000000000";
/** Initial value for SHA 256 values.*/
public static final String LOCALITY4_SHA256_LIST = "ffffffffffffffffffffffffff"
+ "ffffffffffffffffffffffffffffffffffffff";
/** Initial value for SHA 1 values. */
public static final String INIT_SHA1_LIST = "0000000000000000000000000000000000000000";
/** Initial value for SHA 1 values. */
public static final String LOCALITY4_SHA1_LIST = "ffffffffffffffffffffffffffffffffffffffff";
/** PFP defined EV_NO_ACTION identifier. */
public static final int NO_ACTION_EVENT = 0x00000003;
/** String value of SHA1 hash.*/
public static final String HASH_STRING = "SHA1";
/** String value of SHA256 hash. */
public static final String HASH256_STRING = "SHA-256";
/** Each PCR bank holds 24 registers. */
public static final int PCR_COUNT = 24;
/** Locality 4 starts at PCR 17. */
public static final int PCR_LOCALITY4_MIN = 17;
/** Locality 4 Ends at PCR 23. */
public static final int PCR_LOCALITY4_MAX = 23;
/** 2 dimensional array holding the PCR values. */
private byte[][] pcrList;
/** List of parsed events within the log. */
private LinkedHashMap<Integer, TpmPcrEvent> eventList = new LinkedHashMap<>();
/** Length of PCR. Indicates which hash algorithm is used. */
private int pcrLength;
/** Name of hash algorithm. */
private String hashType;
/** Initial PCR Value to use. */
private String initValue;
/** Initial PcR Value to use for locality 4. */
private String initLocalityFourValue;
/** Content Output Flag use. */
private boolean bContent = false;
/** Event Output Flag use. */
private boolean bHexEvent = false;
/** Event Output Flag use. */
private boolean bEvent = false;
/** Event Output Flag use. */
@Getter
private boolean bCryptoAgile = false;
/**
* Default blank object constructor.
*/
public TCGEventLog() {
this.pcrList = new byte[PCR_COUNT][EvConstants.SHA1_LENGTH];
initValue = INIT_SHA1_LIST;
initLocalityFourValue = LOCALITY4_SHA1_LIST;
pcrLength = EvConstants.SHA1_LENGTH;
hashType = HASH_STRING;
algorithm = "TPM_ALG_SHA1";
initPcrList();
}
/**
* Simple constructor for Event Log.
* @param rawlog data for the event log file.
* @throws java.security.NoSuchAlgorithmException if an unknown algorithm is encountered.
* @throws java.security.cert.CertificateException if a certificate in the log cannot be parsed.
* @throws java.io.IOException IO Stream if event cannot be parsed.
*/
public TCGEventLog(final byte[] rawlog)
throws CertificateException, NoSuchAlgorithmException, IOException {
this(rawlog, false, false, false);
}
/**
* Default constructor for just the rawlog that'll set up SHA1 Log.
* @param rawlog data for the event log file.
* @param bEventFlag if true provides human readable event descriptions.
* @param bContentFlag if true provides hex output for Content in the description.
* @param bHexEventFlag if true provides hex event structure in the description.
* @throws java.security.NoSuchAlgorithmException if an unknown algorithm is encountered.
* @throws java.security.cert.CertificateException if a certificate in the log cannot be parsed.
* @throws java.io.IOException IO Stream if event cannot be parsed.
*/
public TCGEventLog(final byte[] rawlog, final boolean bEventFlag,
final boolean bContentFlag, final boolean bHexEventFlag)
throws CertificateException, NoSuchAlgorithmException, IOException {
bCryptoAgile = isLogCrytoAgile(rawlog);
if (bCryptoAgile) {
initValue = INIT_SHA256_LIST;
initLocalityFourValue = LOCALITY4_SHA256_LIST;
algorithm = "TPM_ALG_SHA256";
hashType = HASH256_STRING;
pcrLength = EvConstants.SHA256_LENGTH;
} else {
initValue = INIT_SHA1_LIST;
initLocalityFourValue = LOCALITY4_SHA1_LIST;
hashType = HASH_STRING;
algorithm = "TPM_ALG_SHA1";
pcrLength = EvConstants.SHA1_LENGTH;
}
this.pcrList = new byte[PCR_COUNT][pcrLength];
int eventNumber = 0;
bContent = bContentFlag;
bEvent = bEventFlag;
bHexEvent = bHexEventFlag;
ByteArrayInputStream is = new ByteArrayInputStream(rawlog);
// Process the 1st entry as a SHA1 format (per the spec)
eventList.put(eventNumber, new TpmPcrEvent1(is, eventNumber++));
// put all events into an event list for further processing
while (is.available() > 0) {
if (bCryptoAgile) {
eventList.put(eventNumber, new TpmPcrEvent2(is, eventNumber++));
} else {
eventList.put(eventNumber, new TpmPcrEvent1(is, eventNumber++));
}
}
calculatePcrValues();
}
/**
* This method puts blank values in the pcrList.
*/
private void initPcrList() {
try {
for (int i = 0; i < PCR_COUNT; i++) {
System.arraycopy(Hex.decodeHex(initValue.toCharArray()),
0, pcrList[i], 0, pcrLength);
}
for (int i = PCR_LOCALITY4_MIN; i < PCR_LOCALITY4_MAX; i++) {
System.arraycopy(Hex.decodeHex(initLocalityFourValue.toCharArray()),
0, pcrList[i], 0, pcrLength);
}
} catch (DecoderException deEx) {
LOGGER.error(deEx);
}
}
/**
* Creates a TPM baseline using the expected PCR Values.
* Expected PCR Values were Calculated from the EventLog (RIM Support file).
*
* @param name name to call the TPM Baseline
* @return whitelist baseline
*/
// public TpmWhiteListBaseline createTPMBaseline(final String name) {
// TpmWhiteListBaseline baseline = new TpmWhiteListBaseline(name);
// TPMMeasurementRecord record;
// String pcrValue;
// for (int i = 0; i < PCR_COUNT; i++) {
// if (algorithm.compareToIgnoreCase("TPM_ALG_SHA1") == 0) { // Log Was SHA1 Format
// pcrValue = getExpectedPCRValue(i);
// byte[] hexValue = HexUtils.hexStringToByteArray(pcrValue);
// final Digest hash = new Digest(DigestAlgorithm.SHA1, hexValue);
// record = new TPMMeasurementRecord(i, hash);
// } else { // Log was Crypto Agile, currently assumes SHA256
// pcrValue = getExpectedPCRValue(i);
// byte[] hexValue = HexUtils.hexStringToByteArray(pcrValue);
// final Digest hash = new Digest(DigestAlgorithm.SHA256, hexValue);
// record = new TPMMeasurementRecord(i, hash);
// }
// baseline.addToBaseline(record);
// }
// return baseline;
// }
/**
* Calculates the "Expected Values for TPM PCRs based upon Event digests in the Event Log.
* Uses the algorithm and eventList passed into the constructor,
*/
private void calculatePcrValues() {
byte[] extendedPCR;
initPcrList();
for (TpmPcrEvent currentEvent : eventList.values()) {
if (currentEvent.getPcrIndex() >= 0) { // Ignore NO_EVENTS which can have a PCR=-1
try {
if (currentEvent.getEventType() != NO_ACTION_EVENT) {
// Don't include EV_NO_ACTION event
extendedPCR = extendPCR(pcrList[currentEvent.getPcrIndex()],
currentEvent.getEventDigest());
System.arraycopy(extendedPCR, 0, pcrList[currentEvent.getPcrIndex()],
0, currentEvent.getDigestLength());
}
} catch (NoSuchAlgorithmException e) {
LOGGER.error(e);
}
}
}
}
/**
* Extends a hash with a hash of new data.
*
* @param currentValue value to extend
* @param newEvent value to extend with
* @return new hash resultant hash
* @throws java.security.NoSuchAlgorithmException if hash algorithm not supported
*/
private byte[] extendPCR(final byte[] currentValue, final byte[] newEvent)
throws NoSuchAlgorithmException {
MessageDigest md = MessageDigest.getInstance(hashType);
StringBuilder sb = new StringBuilder(AbstractDigest.SHA512_DIGEST_LENGTH);
sb.append(Hex.encodeHexString(currentValue).toCharArray());
sb.append(Hex.encodeHexString(newEvent).toCharArray());
try {
md.update(Hex.decodeHex(sb.toString().toCharArray()));
} catch (DecoderException deEx) {
LOGGER.error(deEx);
}
return md.digest();
}
/**
* Returns all 24 PCR values for display purposes.
*
* @return Returns an array of strings representing the expected hash values for all 24 PCRs
*/
public String[] getExpectedPCRValues() {
String[] pcrs = new String[PCR_COUNT];
for (int i = 0; i < PCR_COUNT; i++) {
pcrs[i] = Hex.encodeHexString(pcrList[i]);
}
return pcrs;
}
/**
* Returns a list of event found in the Event Log.
* @return an arraylist of event.
*/
public Collection<TpmPcrEvent> getEventList() {
return eventList.values();
}
/**
* Returns a specific element of the Event Log that corresponds to the requested
* event number.
* @param eventNumber specific event to find in the list.
* @return TPM Event in the position of the list
*/
public TpmPcrEvent getEventByNumber(final int eventNumber) {
return eventList.get(eventNumber);
}
/**
* Returns a single PCR value given an index (PCR Number).
*
* @param index pcr index
* @return String representing the PCR contents
*/
public String getExpectedPCRValue(final int index) {
return HexUtils.byteArrayToHexString(pcrList[index]);
}
/**
* Human readable string representing the contents of the Event Log.
* @return Description of the log.
*/
public String toString() {
StringBuilder sb = new StringBuilder();
for (TpmPcrEvent event : eventList.values()) {
sb.append(event.toString(bEvent, bHexEvent, bContent));
}
sb.append("Event Log processing completed.\n");
return sb.toString();
}
/**
* Human readable string representing the contents of the Event Log.
* @param bEvent flag to set
* @param bHexEvent flag to set
* @param bContent flag to set
* @return Description of the log.
*/
public String toString(final boolean bEvent,
final boolean bHexEvent,
final boolean bContent) {
this.bEvent = bEvent;
this.bHexEvent = bHexEvent;
this.bContent = bContent;
return this.toString();
}
/**
* Returns the TCG Algorithm Registry defined ID for the Digest Algorithm
* used in the event log.
* @return TCG Defined Algorithm name
*/
public int getEventLogHashAlgorithmID() {
return TcgTpmtHa.tcgAlgStringToId(algorithm);
}
/**
* Determines if an event is an EfiSpecIdEvent indicating that the log format is crypto agile.
* The EfiSpecIdEvent should be the first event in the TCG TPM Event Log.
*
* @param log The Event Log
* @return true if EfiSpecIDEvent is found and indicates that the format is crypto agile
*/
private boolean isLogCrytoAgile(final byte[] log) {
byte[] eType = new byte[UefiConstants.SIZE_4];
System.arraycopy(log, UefiConstants.SIZE_4, eType, 0, UefiConstants.SIZE_4);
byte[] eventType = HexUtils.leReverseByte(eType);
int eventID = new BigInteger(eventType).intValue();
if (eventID != TCGEventLog.NO_ACTION_EVENT) {
return false;
} // Event Type should be EV_NO_ACTION
byte[] signature = new byte[SIG_SIZE];
// should be "Spec ID Event03"
System.arraycopy(log, SIG_OFFSET, signature, 0, SIG_SIZE);
// remove null char
String sig = new String(signature, StandardCharsets.UTF_8).substring(0, SIG_SIZE - 1);
return sig.equals("Spec ID Event03");
}
}

View File

@ -0,0 +1,215 @@
package hirs.attestationca.portal.utils.tpm.eventlog;
import hirs.attestationca.portal.utils.HexUtils;
import lombok.AccessLevel;
import lombok.Getter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.math.BigInteger;
/**
* Class to for the TCG defined TPMT_HA structure used to support the Crypto Agile Log format.
* <p>
* typedef struct {
* TPMI_ALG_HASH hashAlg;
* TPMU_HA digest;
* } TPMT_HA;
*/
public class TcgTpmtHa {
/**
* TCG Defined Algorithm Identifiers.
*/
@Getter
private int hashAlgId = 0;
/**
* Length of the hash.
*/
@Getter
private int hashLength = 0;
/**
* Human readable name of the hash algorithm.
*/
@Getter
private String hashName = "";
/**
* Hash data.
*/
@Getter(value = AccessLevel.PROTECTED)
private byte[] digest = null;
/**
* TCG ID for SHA1.
*/
public static final int TPM_ALG_SHA1 = 0x04;
/**
* TCG ID for SHA1.
*/
public static final int TPM_ALG_SHA256 = 0x0B;
/**
* TCG ID for SHA 384.
*/
public static final int TPM_ALG_SHA384 = 0x0C;
/**
* TCG ID for SHA512.
*/
public static final int TPM_ALG_SHA_512 = 0x0D;
/**
* TCG ID for Null algorithm.
*/
public static final int TPM_ALG_NULL = 0x10;
/**
* TCG ID for SHA1.
*/
public static final int TPM_ALG_SHA1_LENGTH = 20;
/**
* TCG ID for SHA1.
*/
public static final int TPM_ALG_SHA256_LENGTH = 32;
/**
* TCG ID for SHA 384.
*/
public static final int TPM_ALG_SHA384_LENGTH = 48;
/**
* TCG ID for SHA512.
*/
public static final int TPM_ALG_SHA512_LENGTH = 64;
/**
* TCG ID for Null algorithm.
*/
public static final int TPM_ALG_NULL_LENGTH = 0;
/**
* buffer to hold the structure.
*/
private byte[] buffer = null;
/**
* Constructor.
*
* @param is ByteArrayInputStream holding the TcgTPMT_HA structured data
* @throws java.io.IOException if TPMT_HA structure cannot be parsed
*/
public TcgTpmtHa(final ByteArrayInputStream is) throws IOException {
byte[] algID = new byte[2];
is.read(algID);
byte[] rAlgID = HexUtils.leReverseByte(algID);
hashAlgId = new BigInteger(rAlgID).intValue();
hashName = tcgAlgIdToString(algID[0]);
hashLength = tcgAlgLength(algID[0]);
digest = new byte[hashLength];
is.read(digest);
buffer = new byte[algID.length + digest.length];
System.arraycopy(algID, 0, buffer, 0, algID.length);
System.arraycopy(digest, 0, buffer, algID.length, digest.length);
}
/**
* Returns the contents of the TPMT_HA structure buffer.
*
* @return contents of the TPMT_HA structure.
*/
public byte[] getBuffer() {
return java.util.Arrays.copyOf(buffer, buffer.length);
}
/**
* Readable description of the Algorithm.
*
* @return Readable Algorithm name
*/
@Override
public String toString() {
return String.format("%s hash = %s", hashName, HexUtils.byteArrayToHexString(digest));
}
/**
* Returns the hash name via a lookup.
* Lookup based upon section 6.3 for the TPM-Rev-2.0-Part-2-Structures.pdf document.
* Only hash algorithms found in Table 7 are used.
*
* @param algId int to convert to string
* @return name of the algorithm
*/
public static String tcgAlgIdToString(final int algId) {
String alg;
switch (algId) {
case TPM_ALG_SHA1:
alg = "TPM_ALG_SHA1";
break;
case TPM_ALG_SHA256:
alg = "TPM_ALG_SHA256";
break;
case TPM_ALG_SHA384:
alg = "TPM_ALG_SHA384";
break;
case TPM_ALG_SHA_512:
alg = "TPM_ALG_SHA512";
break;
case TPM_ALG_NULL:
alg = "TPM_ALG_NULL";
break;
default:
alg = "Unknown or invalid Hash";
}
return alg;
}
/**
* Returns the TCG defined ID via a lookup o the TCG Defined Algorithm String.
* Lookup based upon section 6.3 for the TPM-Rev-2.0-Part-2-Structures.pdf document.
* Only hash algorithms found in Table 7 are used.
*
* @param algorithm String to convert to an id
* @return id of hash algorithm
*/
public static int tcgAlgStringToId(final String algorithm) {
int alg;
switch (algorithm) {
case "TPM_ALG_SHA1":
alg = TPM_ALG_SHA1;
break;
case "TPM_ALG_SHA256":
alg = TPM_ALG_SHA256;
break;
case "TPM_ALG_SHA384":
alg = TPM_ALG_SHA384;
break;
case "TPM_ALG_SHA512":
alg = TPM_ALG_SHA_512;
break;
case "TPM_ALG_NULL":
default:
alg = TPM_ALG_NULL;
}
return alg;
}
/**
* Sets the length of a given TPM ALG Identifier.
* (lookup based upon section 6.3 for the TPM-Rev-2.0-Part-2-Structures.pdf document)
* Only hash algorithms found in Table 7 are used.
*
* @param algId TCG defined Algorithm identifier
* @return length of hash data in bytes
*/
public static int tcgAlgLength(final int algId) {
int length;
switch (algId) {
case TPM_ALG_SHA1:
length = TPM_ALG_SHA1_LENGTH;
break;
case TPM_ALG_SHA256:
length = TPM_ALG_SHA256_LENGTH;
break;
case TPM_ALG_SHA384:
length = TPM_ALG_SHA384_LENGTH;
break;
case TPM_ALG_SHA_512:
length = TPM_ALG_SHA512_LENGTH;
break;
case TPM_ALG_NULL:
default:
length = TPM_ALG_NULL_LENGTH;
}
return length;
}
}

View File

@ -0,0 +1,731 @@
package hirs.attestationca.portal.utils.tpm.eventlog;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvCompactHash;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvEfiBootServicesApp;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvEfiGptPartition;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvEfiHandoffTable;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvEfiSpecIdEvent;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvEventTag;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvIPL;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvNoAction;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvPostCode;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvSCrtmContents;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvSCrtmVersion;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiFirmware;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiVariable;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.codec.binary.Hex;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.Arrays;
/**
* Class to process a TCG_PCR_EVENT.
* TCG_PCR_EVENT is used when the Event log uses the SHA1 Format as described in the
* TCG Platform Firmware Profile (PFP) specification.
* typedef struct {
* TCG_PCRINDEX PCRIndex; //PCR Index value that either
* //matches the PCRIndex of a
* //previous extend operation or
* //indicates that this Event Log
* //entry is not associated with
* //an extend operation
* TCG_EVENTTYPE EventType; //See Log event types defined in toStrng()
* TCG_DIGEST digest; //The hash of the event data
* UINT32 EventSize; //Size of the event data
* UINT8 Event[EventSize]; //The event data
* } TCG_PCR_EVENT;
*/
public class TpmPcrEvent {
private static final Logger LOGGER = LogManager.getLogger(TpmPcrEvent.class);
/**
* Indent Offset.
*/
private static final int INDENT_3 = 3;
/**
* Log format. SHA1=1, Crytpo agile=2.
* this can be refactored out
*/
@Getter @Setter(value = AccessLevel.PROTECTED)
private int logFormat = -1;
/**
* PCR index.
*/
@Getter
private int pcrIndex = -1;
/**
* Event Type (long).
*/
@Getter
private long eventType = 0;
/**
* Event digest.
*/
private byte[] digest = null;
/**
* Event data (no content).
*/
private byte[] event;
/**
* Event content data.
*/
private byte[] eventContent;
/**
* TCG Event Log spec version.
*/
@Getter
private String specVersion = "Unknown";
/**
* TCG Event Log errata version.
*/
@Getter
private String specErrataVersion = "Unknown";
/**
* Description for toString support.
*/
private String description = "";
/**
* Length (in bytes) of a pcr.
*/
@Setter @Getter
private int digestLength = 0;
/**
* Event hash for SHA1 event logs.
*/
private byte[] eventDataSha1hash;
/**
* Event hash for Crypto Agile events.
*/
private byte[] eventDataSha256hash;
private EvPostCode evPostCode;
@Setter @Getter
private int eventNumber;
@Setter @Getter
private boolean error = false;
/**
* Constructor.
*
* @param is ByteArrayInputStream holding the event
* @throws java.io.IOException when event can't be parsed
*/
public TpmPcrEvent(final ByteArrayInputStream is) throws IOException {
}
/**
* Sets the digest from a TCG_PCR_EVENT digest field.
* This can be SHA1 for older event structures or any algorithm for newer structure.
*
* @param digestData cryptographic hash
* @param digestLength length of the cryptographic hash
*/
protected void setEventDigest(final byte[] digestData, final int digestLength) {
digest = new byte[digestLength];
System.arraycopy(digestData, 0, digest, 0, digestLength);
}
/**
* Retrieves the digest from a TCG Event.
* This can be SHA1 for older event structures or any algorithm for newer structure.
*
* @return the digest data for the event
*/
public byte[] getEventDigest() {
byte[] digestCopy = new byte[digestLength];
System.arraycopy(digest, 0, digestCopy, 0, this.digestLength);
return digestCopy;
}
/**
* Returns a hex representation of the event digest.
* @return hex string
*/
public String getEventDigestStr() {
return Hex.encodeHexString(this.digest);
}
/**
* Sets the event PCR index value from a TCG Event.
*
* @param eventIndex TCG Event PCR Index as defined in the PFP
*/
protected void setPcrIndex(final byte[] eventIndex) {
pcrIndex = HexUtils.leReverseInt(eventIndex);
}
/**
* Sets the EventType.
*
* @param type byte array holding the PFP defined log event type
*/
protected void setEventType(final byte[] type) {
eventType = new BigInteger(1, HexUtils.leReverseByte(type)).longValue();
}
/**
* Returns a formatted string of the type for the event.
* @return a string formatted to be human readable
*/
public String getEventTypeStr() {
return String.format("0x%s %s", Long.toHexString(eventType), eventString((int) eventType));
}
/**
* Returns a formatted string of the type for the event minus the byte code.
* @return a string formatted to be human readable
*/
public String getEventTypeString() {
return eventString((int) eventType);
}
/**
* Sets the event data after processing.
*
* @param eventData The PFP defined event content
*/
protected void setEventData(final byte[] eventData) {
event = new byte[eventData.length];
System.arraycopy(eventData, 0, event, 0, eventData.length);
}
/**
* Gets the Event Data (no event content) for the event.
* event log format.
*
* @return byte array holding the event structure.
*/
public byte[] getEvent() {
return Arrays.copyOf(event, event.length);
}
/**
* Sets the event content after processing.
*
* @param eventData The PFP defined event content
*/
protected void setEventContent(final byte[] eventData) {
eventContent = new byte[eventData.length];
evPostCode = new EvPostCode(eventContent);
System.arraycopy(eventData, 0, eventContent, 0, eventData.length);
}
/**
* Gets the event Content Data (not the entire event structure).
*
* @return byte array holding the events content field
*/
public byte[] getEventContent() {
return Arrays.copyOf(eventContent, eventContent.length);
}
/**
* A getter that parses the content based on the type and returns the proper string
* value for the content.
* @return an appended string of human readable data
*/
public String getEventContentStr() {
StringBuilder sb = new StringBuilder();
switch ((int) this.eventType) {
case EvConstants.EV_PREBOOT_CERT:
sb.append(" EV_PREBOOT_CERT");
break;
case EvConstants.EV_POST_CODE:
sb.append(new EvPostCode(eventContent).toString());
break;
case EvConstants.EV_UNUSED:
break;
case EvConstants.EV_NO_ACTION:
EvNoAction noAction = null;
try {
noAction = new EvNoAction(eventContent);
sb.append(noAction.toString());
if (noAction.isSpecIDEvent()) {
// this should be in the constructor
EvEfiSpecIdEvent specID = noAction.getSpecIDEvent();
specVersion = String.format("%s.%s",
specID.getVersionMajor(),
specID.getVersionMinor());
specErrataVersion = specID.getErrata();
}
} catch (UnsupportedEncodingException ueEx) {
LOGGER.error(ueEx);
sb.append(ueEx.toString());
}
break;
case EvConstants.EV_SEPARATOR:
if (EvPostCode.isAscii(eventContent)
&& !this.isBlank(eventContent)) {
sb.append(String.format("Separator event content = %s",
new String(eventContent, StandardCharsets.UTF_8)));
}
break;
case EvConstants.EV_EVENT_TAG:
sb.append(new EvEventTag(eventContent).toString());
break;
case EvConstants.EV_S_CRTM_CONTENTS:
sb.append(new EvSCrtmContents(eventContent).toString());
break;
case EvConstants.EV_S_CRTM_VERSION:
try {
sb.append(new EvSCrtmVersion(eventContent).toString());
} catch (UnsupportedEncodingException ueEx) {
LOGGER.error(ueEx);
sb.append(ueEx.toString());
}
break;
case EvConstants.EV_CPU_MICROCODE:
case EvConstants.EV_PLATFORM_CONFIG_FLAGS:
case EvConstants.EV_TABLE_OF_DEVICES:
break;
case EvConstants.EV_COMPACT_HASH:
try {
sb.append(new EvCompactHash(eventContent).toString());
} catch (UnsupportedEncodingException ueEx) {
LOGGER.error(ueEx);
sb.append(ueEx.toString());
}
break;
case EvConstants.EV_IPL:
sb.append(new EvIPL(eventContent).toString());
break;
case EvConstants.EV_IPL_PARTITION_DATA:
case EvConstants.EV_NONHOST_CODE:
case EvConstants.EV_NONHOST_CONFIG:
case EvConstants.EV_NONHOST_INFO:
case EvConstants.EV_EV_OMIT_BOOT_DEVICES_EVENTS:
case EvConstants.EV_EFI_EVENT_BASE:
break;
case EvConstants.EV_EFI_VARIABLE_DRIVER_CONFIG:
UefiVariable efiVar = null;
try {
efiVar = new UefiVariable(eventContent);
String efiVarDescription = efiVar.toString().replace("\n", "\n ");
sb.append(efiVarDescription.substring(0,
efiVarDescription.length() - INDENT_3));
} catch (CertificateException cEx) {
LOGGER.error(cEx);
sb.append(cEx.toString());
} catch (NoSuchAlgorithmException noSaEx) {
LOGGER.error(noSaEx);
sb.append(noSaEx.toString());
} catch (IOException ioEx) {
LOGGER.error(ioEx);
sb.append(ioEx.toString());
}
break;
case EvConstants.EV_EFI_VARIABLE_BOOT:
case EvConstants.EV_EFI_VARIABLE_AUTHORITY:
try {
sb.append(new UefiVariable(eventContent).toString());
} catch (CertificateException cEx) {
LOGGER.error(cEx);
sb.append(cEx.toString());
} catch (NoSuchAlgorithmException noSaEx) {
LOGGER.error(noSaEx);
sb.append(noSaEx.toString());
} catch (IOException ioEx) {
LOGGER.error(ioEx);
sb.append(ioEx.toString());
}
break;
case EvConstants.EV_EFI_BOOT_SERVICES_APPLICATION:
case EvConstants.EV_EFI_BOOT_SERVICES_DRIVER: // same as EV_EFI_BOOT_SERVICES_APP
try {
sb.append(new EvEfiBootServicesApp(eventContent).toString());
} catch (UnsupportedEncodingException ueEx) {
LOGGER.error(ueEx);
sb.append(ueEx.toString());
}
break;
case EvConstants.EV_EFI_RUNTIME_SERVICES_DRIVER:
break;
case EvConstants.EV_EFI_GPT_EVENT:
try {
sb.append(new EvEfiGptPartition(eventContent).toString());
} catch (UnsupportedEncodingException ueEx) {
LOGGER.error(ueEx);
sb.append(ueEx.toString());
}
break;
case EvConstants.EV_EFI_ACTION:
case EvConstants.EV_ACTION:
sb.append(new String(eventContent, StandardCharsets.UTF_8));
break;
case EvConstants.EV_EFI_PLATFORM_FIRMWARE_BLOB:
sb.append(new UefiFirmware(eventContent).toString());
break;
case EvConstants.EV_EFI_HANDOFF_TABLES:
sb.append(new EvEfiHandoffTable(eventContent).toString());
break;
case EvConstants.EV_EFI_HCRTM_EVENT:
break;
default:
sb.append("Unknown Event found\n");
}
return cleanTextContent(sb.toString());
}
/**
* Parses the event content and creates a human readable description of each event.
*
* @param event the byte array holding the event data.
* @param eventContent the byte array holding the event content.
* @param eventNumber event position within the event log.
* @param hashName name of the hash algorithm used by the event log
* @return String description of the event.
* @throws java.security.cert.CertificateException if the event contains an event that cannot be processed.
* @throws java.security.NoSuchAlgorithmException if an event contains an unsupported algorithm.
* @throws java.io.IOException if the event cannot be parsed.
*/
public String processEvent(final byte[] event, final byte[] eventContent, final int eventNumber,
final String hashName)
throws CertificateException, NoSuchAlgorithmException, IOException {
int eventID = (int) eventType;
this.eventNumber = eventNumber;
description += "Event# " + eventNumber + ": ";
description += "Index PCR[" + getPcrIndex() + "]\n";
description += "Event Type: 0x" + Long.toHexString(eventType) + " " + eventString(eventID);
description += "\n";
if (hashName.compareToIgnoreCase("TPM_ALG_SHA1") == 0) { // Digest
description += "digest (SHA-1): " + Hex.encodeHexString(this.digest);
} else if (hashName.compareToIgnoreCase("TPM_ALG_SHA256") == 0) { // Digest
description += "digest (SHA256): " + Hex.encodeHexString(this.digest);
} else if (hashName.compareToIgnoreCase("TPM_ALG_SHA384") == 0) { // Digest
description += "digest (SHA384): " + Hex.encodeHexString(this.digest);
} else if (hashName.compareToIgnoreCase("TPM_ALG_SHA512") == 0) { // Digest
description += "digest (SHA512): " + Hex.encodeHexString(this.digest);
} else {
description += "Unsupported Hash Algorithm encoutered";
}
if (eventID != UefiConstants.SIZE_4) {
description += "\n";
}
// Calculate both the SHA1 and SHA256 on the event since this will equal the digest
// field of about half the log messages.
MessageDigest md1 = MessageDigest.getInstance("SHA-1");
md1.update(event);
eventDataSha1hash = md1.digest();
MessageDigest md2 = MessageDigest.getInstance("SHA-256");
md2.update(event);
eventDataSha256hash = md2.digest();
switch (eventID) {
case EvConstants.EV_PREBOOT_CERT:
description += " EV_PREBOOT_CERT" + "\n";
break;
case EvConstants.EV_POST_CODE:
EvPostCode postCode = new EvPostCode(eventContent);
description += "Event Content:\n" + postCode.toString();
break;
case EvConstants.EV_UNUSED:
break;
case EvConstants.EV_NO_ACTION:
EvNoAction noAction = new EvNoAction(eventContent);
description += "Event Content:\n" + noAction.toString();
if (noAction.isSpecIDEvent()) {
EvEfiSpecIdEvent specID = noAction.getSpecIDEvent();
specVersion = specID.getVersionMajor() + "." + specID.getVersionMinor();
specErrataVersion = specID.getErrata();
}
break;
case EvConstants.EV_SEPARATOR:
if (EvPostCode.isAscii(eventContent)) {
String separatorEventData = new String(eventContent, StandardCharsets.UTF_8);
if (!this.isBlank(eventContent)) {
description += "Separator event content = " + separatorEventData;
}
}
break;
case EvConstants.EV_ACTION:
description += "Event Content:\n"
+ new String(eventContent, StandardCharsets.UTF_8);
break;
case EvConstants.EV_EVENT_TAG:
EvEventTag eventTag = new EvEventTag(eventContent);
description += eventTag.toString();
break;
case EvConstants.EV_S_CRTM_CONTENTS:
EvSCrtmContents sCrtmContents = new EvSCrtmContents(eventContent);
description += "Event Content:\n " + sCrtmContents.toString();
break;
case EvConstants.EV_S_CRTM_VERSION:
EvSCrtmVersion sCrtmVersion = new EvSCrtmVersion(eventContent);
description += "Event Content:\n" + sCrtmVersion.toString();
break;
case EvConstants.EV_CPU_MICROCODE:
break;
case EvConstants.EV_PLATFORM_CONFIG_FLAGS:
break;
case EvConstants.EV_TABLE_OF_DEVICES:
break;
case EvConstants.EV_COMPACT_HASH:
EvCompactHash compactHash = new EvCompactHash(eventContent);
description += "Event Content:\n" + compactHash.toString();
break;
case EvConstants.EV_IPL:
EvIPL ipl = new EvIPL(eventContent);
description += "Event Content:\n" + ipl.toString();
break;
case EvConstants.EV_IPL_PARTITION_DATA:
break;
case EvConstants.EV_NONHOST_CODE:
break;
case EvConstants.EV_NONHOST_CONFIG:
break;
case EvConstants.EV_NONHOST_INFO:
break;
case EvConstants.EV_EV_OMIT_BOOT_DEVICES_EVENTS:
break;
case EvConstants.EV_EFI_EVENT_BASE:
break;
case EvConstants.EV_EFI_VARIABLE_DRIVER_CONFIG:
UefiVariable efiVar = new UefiVariable(eventContent);
String efiVarDescription = efiVar.toString().replace("\n", "\n ");
description += "Event Content:\n " + efiVarDescription.substring(0,
efiVarDescription.length() - INDENT_3);
break;
case EvConstants.EV_EFI_VARIABLE_BOOT:
description += "Event Content:\n" + new UefiVariable(eventContent).toString();
break;
case EvConstants.EV_EFI_BOOT_SERVICES_APPLICATION:
EvEfiBootServicesApp bootServices = new EvEfiBootServicesApp(eventContent);
description += "Event Content:\n" + bootServices.toString();
break;
case EvConstants.EV_EFI_BOOT_SERVICES_DRIVER: // same as EV_EFI_BOOT_SERVICES_APP
EvEfiBootServicesApp bootDriver = new EvEfiBootServicesApp(eventContent);
description += "Event Content:\n" + bootDriver.toString();
break;
case EvConstants.EV_EFI_RUNTIME_SERVICES_DRIVER:
break;
case EvConstants.EV_EFI_GPT_EVENT:
description += "Event Content:\n" + new EvEfiGptPartition(eventContent).toString();
break;
case EvConstants.EV_EFI_ACTION:
description += new String(eventContent, StandardCharsets.UTF_8);
break;
case EvConstants.EV_EFI_PLATFORM_FIRMWARE_BLOB:
description += "Event Content:\n"
+ new UefiFirmware(eventContent).toString();
break;
case EvConstants.EV_EFI_HANDOFF_TABLES:
EvEfiHandoffTable efiTable = new EvEfiHandoffTable(eventContent);
description += "Event Content:\n" + efiTable.toString();
break;
case EvConstants.EV_EFI_HCRTM_EVENT:
break;
case EvConstants.EV_EFI_VARIABLE_AUTHORITY:
description += "Event Content:\n" + new UefiVariable(eventContent).toString();
break;
default:
description += " Unknown Event found" + "\n";
}
return description;
}
/**
* Converts the Event ID into a String As defined in the TCG PC Client FW Profile.
* Event IDs have values larger than an integer,so a Long is used hold the value.
*
* @param event the event id.
* @return TCG defined String that represents the event id
*/
private static String eventString(final long event) {
if (event == EvConstants.EV_PREBOOT_CERT) {
return "EV_PREBOOT_CERT";
} else if (event == EvConstants.EV_POST_CODE) {
return "EV_POST_CODE";
} else if (event == EvConstants.EV_UNUSED) {
return "EV_Unused";
} else if (event == EvConstants.EV_NO_ACTION) {
return "EV_NO_ACTION";
} else if (event == EvConstants.EV_SEPARATOR) {
return "EV_SEPARATOR";
} else if (event == EvConstants.EV_ACTION) {
return "EV_ACTION";
} else if (event == EvConstants.EV_EVENT_TAG) {
return "EV_EVENT_TAG";
} else if (event == EvConstants.EV_S_CRTM_CONTENTS) {
return "EV_S_CRTM_CONTENTS";
} else if (event == EvConstants.EV_S_CRTM_VERSION) {
return "EV_S_CRTM_VERSION";
} else if (event == EvConstants.EV_CPU_MICROCODE) {
return "EV_CPU_MICROCODE";
} else if (event == EvConstants.EV_PLATFORM_CONFIG_FLAGS) {
return "EV_PLATFORM_CONFIG_FLAGS ";
} else if (event == EvConstants.EV_TABLE_OF_DEVICES) {
return "EV_TABLE_OF_DEVICES";
} else if (event == EvConstants.EV_COMPACT_HASH) {
return "EV_COMPACT_HASH";
} else if (event == EvConstants.EV_IPL) {
return "EV_IPL";
} else if (event == EvConstants.EV_IPL_PARTITION_DATA) {
return "EV_IPL_PARTITION_DATA";
} else if (event == EvConstants.EV_NONHOST_CODE) {
return "EV_NONHOST_CODE";
} else if (event == EvConstants.EV_NONHOST_CONFIG) {
return "EV_NONHOST_CONFIG";
} else if (event == EvConstants.EV_NONHOST_INFO) {
return "EV_NONHOST_INFO";
} else if (event == EvConstants.EV_EV_OMIT_BOOT_DEVICES_EVENTS) {
return "EV_EV_OMIT_BOOT_DEVICES_EVENTS";
} else if (event == EvConstants.EV_EFI_EVENT_BASE) {
return "EV_EFI_EVENT_BASE";
} else if (event == EvConstants.EV_EFI_VARIABLE_DRIVER_CONFIG) {
return "EV_EFI_VARIABLE_DRIVER_CONFIG";
} else if (event == EvConstants.EV_EFI_VARIABLE_BOOT) {
return "EV_EFI_VARIABLE_BOOT";
} else if (event == EvConstants.EV_EFI_BOOT_SERVICES_APPLICATION) {
return "EV_EFI_BOOT_SERVICES_APPLICATION";
} else if (event == EvConstants.EV_EFI_BOOT_SERVICES_DRIVER) {
return "EV_EFI_BOOT_SERVICES_DRIVER";
} else if (event == EvConstants.EV_EFI_RUNTIME_SERVICES_DRIVER) {
return "EV_EFI_RUNTIME_SERVICES_DRIVER";
} else if (event == EvConstants.EV_EFI_GPT_EVENT) {
return "EV_EFI_GPT_EVENT";
} else if (event == EvConstants.EV_EFI_ACTION) {
return "EV_EFI_ACTION";
} else if (event == EvConstants.EV_EFI_PLATFORM_FIRMWARE_BLOB) {
return "EV_EFI_PLATFORM_FIRMWARE_BLOB";
} else if (event == EvConstants.EV_EFI_HANDOFF_TABLES) {
return "EV_EFI_HANDOFF_TABLES";
} else if (event == EvConstants.EV_EFI_HCRTM_EVENT) {
return "EV_EFI_HCRTM_EVENT";
} else if (event == EvConstants.EV_EFI_VARIABLE_AUTHORITY) {
return "EV_EFI_VARIABLE_AUTHORITY";
} else {
return "Unknown Event ID " + event + " encountered";
}
}
/**
* Human readable output of a check of input against the current event hash.
*
* @return human readable string.
*/
private String eventHashCheck() {
String result = "";
if (logFormat == 1) {
if (Arrays.equals(this.digest, eventDataSha1hash)) {
result
+= "Event digest matched hash of the event data " + "\n";
} else {
result += "Event digest DID NOT match the hash of the event data :"
+ Hex.encodeHexString(getEventDigest()) + "\n";
}
} else {
if (Arrays.equals(this.digest, eventDataSha256hash)) {
result += "Event digest matched hash of the event data " + "\n";
} else {
result += "Event digest DID NOT match the hash of the event data :"
+ Hex.encodeHexString(getEventDigest()) + "\n";
}
}
return result;
}
/**
* This method takes in an event and compares the hashes to verify that they match.
* @param tpmPcrEvent an event to match.
* @return true if the event # matches and the hash is correct.
*/
public boolean eventCompare(final TpmPcrEvent tpmPcrEvent) {
if (tpmPcrEvent.getPcrIndex() != this.getPcrIndex()) {
return false;
}
return Arrays.equals(this.digest, tpmPcrEvent.getEventDigest());
}
/**
* Checks a byte array for all zeros.
*
* @param array holds data to check.
* @return true of all zeros are found.
*/
public boolean isBlank(final byte[] array) {
for (int i = 0; i < array.length; i++) {
if (array[i] != 0) {
return false;
}
}
return true;
}
/**
* Human readable string representing the contents of the Event Log.
*
* @return Description of the log.
*/
public String toString() {
return description + "\n";
}
/**
* Human readable string representing the contents of the Event Log.
*
* @param bEvent event Flag.
* @param bContent content flag.
* @param bHexEvent hex event flag.
* @return Description of the log.
*/
public String toString(final boolean bEvent, final boolean bContent, final boolean bHexEvent) {
StringBuilder sb = new StringBuilder();
if (bEvent) {
sb.append(description);
}
if (bHexEvent) {
if (bEvent || bContent) {
sb.append("\n");
}
byte[] eventData = getEvent();
sb.append("Event (Hex no Content) (" + eventData.length + " bytes): "
+ Hex.encodeHexString(eventData));
}
if (bContent) {
byte[] evContent = getEventContent();
if (bEvent) {
sb.append("\n");
}
sb.append("Event content (Hex) (" + evContent.length + " bytes): "
+ Hex.encodeHexString(evContent));
}
return sb.toString() + "\n";
}
/**
* Remove bad visual value text.
* @param text content to operate over.
* @return cleared string
*/
public String cleanTextContent(final String text) {
String result;
// strips off all non-ASCII characters
result = text.replaceAll("[^\\x00-\\x7F]", "");
// erases all the ASCII control characters
result = result.replaceAll("[\\p{Cntrl}&&[^\r\n\t]]", "");
// removes non-printable characters from Unicode
result = result.replaceAll("\\p{C}", "");
return result.trim();
}
}

View File

@ -0,0 +1,85 @@
package hirs.attestationca.portal.utils.tpm.eventlog;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
/**
* Class to process a TCG_PCR_EVENT.
* TCG_PCR_EVENT is used when the Event log uses the SHA1 Format as described in the
* TCG Platform Firmware Profile specification.
* typedef struct {
* UINT32 PCRIndex; //PCR Index value that either
* //matches the PCRIndex of a
* //previous extend operation or
* //indicates that this Event Log
* //entry is not associated with
* //an extend operation
* UINT32 EventType; //See Log event types
* BYTE digest[20]; //The SHA1 hash of the event data
* UINT32 EventSize; //Size of the event data
* UINT8 Event[1]; //
* } TCG_PCR_EVENT; //The event data structure to be added
*/
public class TpmPcrEvent1 extends TpmPcrEvent {
/**
* Constructor.
*
* @param is ByteArrayInputStream holding the TCG Log event.
* @param eventNumber event position within the event log.
* @throws java.io.IOException if an error occurs in parsing the event.
* @throws java.security.NoSuchAlgorithmException if an undefined algorithm is encountered.
* @throws java.security.cert.CertificateException If a certificate within an event can't be processed.
*/
public TpmPcrEvent1(final ByteArrayInputStream is, final int eventNumber)
throws IOException, CertificateException, NoSuchAlgorithmException {
super(is);
setDigestLength(EvConstants.SHA1_LENGTH);
setLogFormat(1);
/** Event data. */
byte[] event = null;
byte[] rawIndex = new byte[UefiConstants.SIZE_4];
byte[] rawType = new byte[UefiConstants.SIZE_4];
byte[] rawEventSize = new byte[UefiConstants.SIZE_4];
byte[] eventDigest = new byte[EvConstants.SHA1_LENGTH];
byte[] eventContent = null;
int digestSize = EvConstants.SHA1_LENGTH;
int eventSize = 0;
String hashName = "TPM_ALG_SHA1";
if (is.available() > UefiConstants.SIZE_32) {
is.read(rawIndex);
setPcrIndex(rawIndex);
is.read(rawType);
setEventType(rawType);
is.read(eventDigest);
setEventDigest(eventDigest, digestSize);
is.read(rawEventSize);
eventSize = HexUtils.leReverseInt(rawEventSize);
eventContent = new byte[eventSize];
is.read(eventContent);
setEventContent(eventContent);
// copy entire event into a byte array for processing
int eventLength = rawIndex.length + rawType.length + eventDigest.length
+ rawEventSize.length;
int offset = 0;
event = new byte[eventLength];
System.arraycopy(rawIndex, 0, event, offset, rawIndex.length);
offset += rawIndex.length;
System.arraycopy(rawType, 0, event, offset, rawType.length);
offset += rawType.length;
System.arraycopy(eventDigest, 0, event, offset, eventDigest.length);
offset += eventDigest.length;
System.arraycopy(rawEventSize, 0, event, offset, rawEventSize.length);
offset += rawEventSize.length;
setEventData(event);
//System.arraycopy(eventContent, 0, event, offset, eventContent.length);
this.processEvent(event, eventContent, eventNumber, hashName);
}
}
}

View File

@ -0,0 +1,135 @@
package hirs.attestationca.portal.utils.tpm.eventlog;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.events.EvConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
/**
* Class to process a TCG_PCR_EVENT2 which is used
* when the Event log uses the Crypto Agile (SHA256) format as described in the
* TCG Platform Firmware Profile specification.
* This class will only process SHA-256 digests.
* typedef struct {
* UINT32 PCRIndex; //PCR Index value that either
* //matches the PCRIndex of a
* //previous extend operation or
* //indicates that this Event Log
* //entry is not associated with
* //an extend operation
* UINT32 EventType; //See Log event types
* TPML_DIGEST_VALUES digest; //The hash of the event data
* UINT32 EventSize; //Size of the event data
* BYTE Event[1]; //The event data
* } TCG_PCR_EVENT2; //The event data structure to be added
* typedef struct {
* UINT32 count;
* TPMT_HA digests[HASH_COUNT];
* } TPML_DIGEST_VALUES;
* typedef struct {
* TPMI_ALG_HASH hashAlg;
* TPMU_HA digest;
* } TPMT_HA;
* typedef union {
* BYTE sha1[SHA1_DIGEST_SIZE];
* BYTE sha256[SHA256_DIGEST_SIZE];
* BYTE sha384[SHA384_DIGEST_SIZE];
* BYTE sha512[SHA512_DIGEST_SIZE];
* } TPMU_HA;
* define SHA1_DIGEST_SIZE 20
* define SHA256_DIGEST_SIZE 32
* define SHA384_DIGEST_SIZE 48
* define SHA512_DIGEST_SIZE 64
* typedef TPM_ALG_ID TPMI_ALG_HASH;
* typedef UINT16 TPM_ALG_ID;
* define TPM_ALG_SHA1 (TPM_ALG_ID)(0x0004)
* define TPM_ALG_SHA256 (TPM_ALG_ID)(0x000B)
* define TPM_ALG_SHA384 (TPM_ALG_ID)(0x000C)
* define TPM_ALG_SHA512 (TPM_ALG_ID)(0x000D)
*/
public class TpmPcrEvent2 extends TpmPcrEvent {
/**
* algorithms found.
*/
private int algCount = 0;
/**
* list of digests.
*/
private ArrayList<TcgTpmtHa> hashList = new ArrayList<>();
/**
* Constructor.
*
* @param is ByteArrayInputStream holding the TCG Log event
* @param eventNumber event position within the event log.
* @throws java.io.IOException if an error occurs in parsing the event
* @throws java.security.NoSuchAlgorithmException if an undefined algorithm is encountered.
* @throws java.security.cert.CertificateException If a certificate within an event can't be processed.
*/
public TpmPcrEvent2(final ByteArrayInputStream is, final int eventNumber)
throws IOException, CertificateException, NoSuchAlgorithmException {
super(is);
setDigestLength(EvConstants.SHA256_LENGTH);
setLogFormat(2);
/** Event data. */
int eventDigestLength = 0;
String hashName = "";
byte[] event;
byte[] rawIndex = new byte[UefiConstants.SIZE_4];
byte[] algCountBytes = new byte[UefiConstants.SIZE_4];
byte[] rawType = new byte[UefiConstants.SIZE_4];
byte[] rawEventSize = new byte[UefiConstants.SIZE_4];
byte[] eventDigest = null;
byte[] eventContent = null;
TcgTpmtHa hashAlg = null;
int eventSize = 0;
//TCG_PCR_EVENT2
if (is.available() > UefiConstants.SIZE_32) {
is.read(rawIndex);
setPcrIndex(rawIndex);
is.read(rawType);
setEventType(rawType);
// TPML_DIGEST_VALUES
is.read(algCountBytes);
algCount = HexUtils.leReverseInt(algCountBytes);
// Process TPMT_HA,
for (int i = 0; i < algCount; i++) {
hashAlg = new TcgTpmtHa(is);
hashName = hashAlg.getHashName();
hashList.add(hashAlg);
eventDigest = new byte[hashAlg.getHashLength()];
setEventDigest(hashAlg.getDigest(), hashAlg.getHashLength());
}
is.read(rawEventSize);
eventSize = HexUtils.leReverseInt(rawEventSize);
eventContent = new byte[eventSize];
is.read(eventContent);
setEventContent(eventContent);
int eventLength = rawIndex.length + rawType.length + eventDigest.length
+ rawEventSize.length;
int offset = 0;
for (TcgTpmtHa hash : hashList) {
eventLength += hash.getBuffer().length;
}
event = new byte[eventLength];
System.arraycopy(rawIndex, 0, event, offset, rawIndex.length);
offset += rawIndex.length;
System.arraycopy(rawType, 0, event, offset, rawType.length);
offset += rawType.length;
System.arraycopy(eventDigest, 0, event, offset, eventDigest.length);
offset += eventDigest.length;
System.arraycopy(rawEventSize, 0, event, offset, rawEventSize.length);
offset += rawEventSize.length;
//System.arraycopy(eventContent, 0, event, offset, eventContent.length);
setEventData(event);
//setDigestLength(eventDigestLength);
this.processEvent(event, eventContent, eventNumber, hashName);
}
}
}

View File

@ -0,0 +1,59 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
/**
* Class to process the EV_COMPACT_HASH event.
* The Old 2005 PFP description of EV_COMPACT_HASH which provides 4 byte ESI field (a pointer).
* The 2019 PFP description allow the vendor to create event data that is "specified by the caller"
* however the for PCR 6 there is a constraint that it contain
* "The Event Data field SHALL be a unique string".
*/
public class EvCompactHash {
/**
* Holds the Compact Hash description.
*/
private String eventInfo = "";
/**
* Constructor that takes in the event data (hex string) and passes to function below.
*
* @param event byte array of the Event Compact Hash.
* @throws java.io.UnsupportedEncodingException if compact hash has non utf-8 characters.
*/
public EvCompactHash(final byte[] event) throws UnsupportedEncodingException {
hashEvent(event);
}
/**
* Takes the event data (hex string) converts to readable output.
* This may be somewhat limited due to the unpublished nature of vendor specific data.
*
* @param event data to process.
* @return a human readable description.
* @throws java.io.UnsupportedEncodingException if compact hash has non utf-8 characters.
*/
public String hashEvent(final byte[] event) throws UnsupportedEncodingException {
// determine if old format is used
if (event.length == UefiConstants.SIZE_4) { // older PFP defines as 4 byte ESI pointer.
eventInfo = " ESI = " + HexUtils.byteArrayToHexString(event);
} else { // otherwise assume the event content is a string
eventInfo = " " + new String(event, StandardCharsets.UTF_8);
}
return eventInfo;
}
/**
* Readable description of the Event Content, however limiting that may be.
*
* @return Event description.
*/
public String toString() {
return eventInfo;
}
}

View File

@ -0,0 +1,166 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* Class for defining constants referenced in the PC Client
* Platform Firmware Profile specification.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class EvConstants {
/**
* Type length = 4 bytes.
*/
public static final int EV_TYPE_SIZE = 4;
/**
* Event Log spec version.
*/
public static final int MIN_SIZE = 32;
/**
* Event Type (byte array).
*/
public static final int INT_LENGTH = 4;
/**
* Event Type (byte array).
*/
public static final int SHA1_LENGTH = 20;
/**
* Event Type (byte array).
*/
public static final int SHA256_LENGTH = 32;
/**
* Event Type (byte array).
*/
public static final int SHA384_LENGTH = 48;
/**
* Each PCR bank holds 24 registers.
*/
public static final int PCR_COUNT = 24;
// Event IDs
/**
* Pre boot cert Event ID.
*/
public static final int EV_PREBOOT_CERT = 0x00000000;
/**
* POST Code Event ID.
*/
public static final int EV_POST_CODE = 0x00000001;
/**
* Unused Event ID.
*/
public static final int EV_UNUSED = 0x00000002;
/**
* NoAction Event ID.
*/
public static final int EV_NO_ACTION = 0x00000003;
/**
* NoAction Event ID.
*/
public static final int EV_SEPARATOR = 0x00000004;
/**
* Action Event ID.
*/
public static final int EV_ACTION = 0x00000005;
/**
* Event ID.
*/
public static final int EV_EVENT_TAG = 0x00000006;
/**
* SCRTM Contents Event ID.
*/
public static final int EV_S_CRTM_CONTENTS = 0x00000007;
/**
* SCRTM Version Event ID.
*/
public static final int EV_S_CRTM_VERSION = 0x00000008;
/**
* CPU Microcode Event ID.
*/
public static final int EV_CPU_MICROCODE = 0x00000009;
/**
* Platform Config Flags Event ID.
*/
public static final int EV_PLATFORM_CONFIG_FLAGS = 0x0000000A;
/**
* Table of Devices Event ID.
*/
public static final int EV_TABLE_OF_DEVICES = 0x0000000B;
/**
* Compact Hash Event ID.
*/
public static final int EV_COMPACT_HASH = 0x0000000C;
/**
* IPL Event ID.
*/
public static final int EV_IPL = 0x0000000D;
/**
* Partition Data Event ID.
*/
public static final int EV_IPL_PARTITION_DATA = 0x0000000E;
/**
* Non Host Event ID.
*/
public static final int EV_NONHOST_CODE = 0x0000000F;
/**
* Non Host Config Event ID.
*/
public static final int EV_NONHOST_CONFIG = 0x00000010;
/**
* Non Host Info Event ID.
*/
public static final int EV_NONHOST_INFO = 0x00000011;
/**
* Omit Boot Device Event ID.
*/
public static final int EV_EV_OMIT_BOOT_DEVICES_EVENTS = 0x00000012;
/**
* EFI Event ID.
*/
public static final int EV_EFI_EVENT_BASE = 0x80000000;
/**
* EFI Variable Driver Event ID.
*/
public static final int EV_EFI_VARIABLE_DRIVER_CONFIG = 0x80000001;
/**
* EFI Variable Boot Driver Event ID.
*/
public static final int EV_EFI_VARIABLE_BOOT = 0x80000002;
/**
* EFI Boot Services Application Event ID.
*/
public static final int EV_EFI_BOOT_SERVICES_APPLICATION = 0x80000003;
/**
* EFI Boot Services Application Event ID.
*/
public static final int EV_EFI_BOOT_SERVICES_DRIVER = 0x80000004;
/**
* EFI Runtime Services Driver Event ID.
*/
public static final int EV_EFI_RUNTIME_SERVICES_DRIVER = 0x80000005;
/**
* EFI GPT Event ID.
*/
public static final int EV_EFI_GPT_EVENT = 0x80000006;
/**
* EFI GPT Event ID.
*/
public static final int EV_EFI_ACTION = 0x80000007;
/**
* Platform Firmware Blob Event ID.
*/
public static final int EV_EFI_PLATFORM_FIRMWARE_BLOB = 0x80000008;
/**
* EFI Handoff Tables Event ID.
*/
public static final int EV_EFI_HANDOFF_TABLES = 0x80000009;
/**
* HRCTM Event ID.
*/
public static final int EV_EFI_HCRTM_EVENT = 0x80000010;
/**
* EFI Variable Authority Event ID.
*/
public static final int EV_EFI_VARIABLE_AUTHORITY = 0x800000E0;
}

View File

@ -0,0 +1,132 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiDevicePath;
import lombok.Getter;
import java.io.UnsupportedEncodingException;
import java.util.Arrays;
/**
* Class to process the PC Client Firmware profile defined EV_EFI_BOOT_SERVICES_APPLICATION event.
* The EV_EFI_BOOT_SERVICES_APPLICATION event data contains the UEFI_IMAGE_LOAD_EVENT structure:
* struct tdUEFI_IMAGE_LOAD_EVENT {
* UEFI_PHYSICAL_ADDRESS ImageLocationInMemory; // PE/COFF image same as UINT64
* UINT64 ImageLengthInMemory;
* UINT64 ImageLinkTimeAddress;
* UINT64 LengthOfDevicePath;
* UEFI_DEVICE_PATH DevicePath[LengthOfDevicePath]; // See UEFI spec for the encodings.
* } UEFI_IMAGE_LOAD_EVENT;
* <p>
* DEVICE_PATH_PROTOCOL from the UEFI spec Section 10.1 page 284 of v2.8
* <p>
* #define EFI_DEVICE_PATH_PROTOCOL_GUID \09576e91-6d3f-11d2-8e39-00a0c969723b
* typedef struct _EFI_DEVICE_PATH_PROTOCOL {
* UINT8 Type;
* UINT8 SubType;
* UINT8 Length[2];
* } EFI_DEVICE_PATH_PROTOCOL; // ref page of the UEFI spec
* <p>
* Where Type and Subtype are defined the UEFI spec section 10.3.1
* Type 0x01 Hardware Device Path
* Type 0x02 ACPI Device Path
* Type 0x03 Messaging Device Path
* Type 0x04 Media Device Path
* Type 0x05 BIOS Boot Specification Device Path
* Type 0x7F End of Hardware Device Path
*/
public class EvEfiBootServicesApp {
/**
* UEFI Address.
*/
private byte[] physicalAddress = null;
/**
* UEFI Image Length.
*/
@Getter
private int imageLength = 0;
/**
* UEFI Link Time image address.
*/
private byte[] linkTimeAddress = null;
/**
* UEFI Device Path Length.
*/
@Getter
private int devicePathLength = 0;
/**
* UEFI Device path.
*/
@Getter
private UefiDevicePath devicePath = null;
/**
* Is the Device Path Valid.
*/
private boolean devicePathValid = false;
/**
* EvEFIBootServicesApp constructor.
*
* @param bootServices byte array holding the event data.
* @throws java.io.UnsupportedEncodingException if parsing issues exists.
*/
public EvEfiBootServicesApp(final byte[] bootServices) throws UnsupportedEncodingException {
physicalAddress = new byte[UefiConstants.SIZE_8];
System.arraycopy(bootServices, 0, physicalAddress, 0, UefiConstants.SIZE_8);
byte[] lengthBytes = new byte[UefiConstants.SIZE_8];
System.arraycopy(bootServices, UefiConstants.OFFSET_8, lengthBytes, 0, UefiConstants.SIZE_8);
imageLength = HexUtils.leReverseInt(lengthBytes);
linkTimeAddress = new byte[UefiConstants.SIZE_8];
System.arraycopy(bootServices, UefiConstants.OFFSET_16, linkTimeAddress, 0,
UefiConstants.SIZE_8);
System.arraycopy(bootServices, UefiConstants.SIZE_24, lengthBytes, 0, UefiConstants.SIZE_8);
// if (imageLength != 0) {
devicePathLength = HexUtils.leReverseInt(lengthBytes);
if (devicePathLength != 0) {
byte[] devPathBytes = new byte[devicePathLength];
System.arraycopy(bootServices, UefiConstants.SIZE_32, devPathBytes,
0, devicePathLength);
devicePath = new UefiDevicePath(devPathBytes);
devicePathValid = true;
}
}
/**
* Returns the address of the physical image of the boot services application.
*
* @return address of the physical image.
*/
public byte[] getImagePhysicalAddress() {
return Arrays.copyOf(physicalAddress, physicalAddress.length);
}
/**
* Returns the length of a link time image referenced by this event.
*
* @return length of the link time image.
*/
public byte[] getImageLinkTimeAddress() {
return Arrays.copyOf(linkTimeAddress, linkTimeAddress.length);
}
/**
* Returns a human readable string of the Boot Service info.
*
* @return a human readable string.
*/
public String toString() {
String info = "Image info: ";
info += " Image physical address: " + HexUtils.byteArrayToHexString(physicalAddress);
info += " Image length = " + imageLength;
info += " Image link time address: " + HexUtils.byteArrayToHexString(physicalAddress);
info += " Device path length = " + devicePathLength;
if (devicePathValid) {
info += "\n" + devicePath.toString();
} else {
info += "\n No uefi device paths were specified";
}
return info;
}
}

View File

@ -0,0 +1,148 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiPartition;
import lombok.Getter;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.util.ArrayList;
/**
* Class to process the PC Client Firmware profile defined EV_EFI_GPT_EVENT event.
* The EV_EFI_GPT_EVENT event data contains the UEFI_GPT_DATA structure as defined in the PFP
* line 2860:
* <p>
* typedef struct {
* UEFI_PARTITION_TABLE_HEADER UEFIPartitionHeader; // same as UINT64 for current x86 devices
* UINT64 NumberOfPartitions;
* UEFI_PARTITION_ENTRY Partitions [NumberOfPartitions];
* }UEFI_GPT_DATA;
* <p>
* The UEFI spec defines the EFI_TABLE_HEADER and EFI_PARTITION_ENTRY
* <p>
* * typedef struct {
* UINT64 Signature; // A 64-bit signature that identifies the type of table that follows.
* UINT32 Revision;
* UINT32 HeaderSize;
* UINT32 CRC32;
* UINT32 Reserved;
* } EFI_TABLE_HEADER;
* <p>
* typedef struct {
* EFI_GUID PartitionTypeGUID;
* EFI_GUID UniquePartitionGUID;
* EFI_LBA StartingLBA; // Same as UINT64.
* EFI_LBA EndingLBA;
* UINT64 Attributes;
* CHAR16 PartitionName[36]; // 36 CHAR16 = 72 Bytes
* } EFI_PARTITION_ENTRY;
* <p>
* EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
* EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
* EFI_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552
* <p>
* UEFI Table 23. Defined GPT Partition Entry - Partition Type GUIDs
* Unused Entry 00000000-0000-0000-0000-000000000000
* EFI System Partition C12A7328-F81F-11D2-BA4B-00A0C93EC93B
* Partition containing a legacy MBR 024DEE41-33E7-11D3-9D69-0008C781F39F
*/
public class EvEfiGptPartition {
/**
* Header Size.
*/
private int headerSize = 0;
/**
* Header bytes.
*/
private byte[] header = new byte[UefiConstants.SIZE_8];
/**
* Number of partitions in this event.
*/
private int numberOfPartitions;
/**
* Partition Length.
*/
private int partitonEntryLength = UefiConstants.SIZE_128;
/**
* List of Partitions.
*/
@Getter
private ArrayList<UefiPartition> partitionList = new ArrayList<>();
/**
* GPT Partition Event Type constructor.
*
* @param eventDataBytes GPT Event to process
* @throws java.io.UnsupportedEncodingException if Event Data fails to parse
*/
public EvEfiGptPartition(final byte[] eventDataBytes) throws UnsupportedEncodingException {
//byte[] eventDataBytes = event.getEventContent();
// Process the partition header
System.arraycopy(eventDataBytes, 0, header, 0, UefiConstants.SIZE_8); // Signature
byte[] revision = new byte[UefiConstants.SIZE_4];
System.arraycopy(eventDataBytes, UefiConstants.SIZE_8, revision, 0, UefiConstants.SIZE_4);
byte[] hsize = new byte[UefiConstants.SIZE_4];
System.arraycopy(eventDataBytes, UefiConstants.SIZE_12, hsize, 0, UefiConstants.SIZE_4);
headerSize = getIntFromBytes(hsize);
byte[] partitions = new byte[UefiConstants.SIZE_8];
System.arraycopy(eventDataBytes, headerSize, partitions, 0, UefiConstants.SIZE_8);
numberOfPartitions = getIntFromBytes(partitions);
int partitionLength = numberOfPartitions * partitonEntryLength;
byte[] partitionEntries = new byte[partitionLength];
System.arraycopy(eventDataBytes, headerSize + UefiConstants.SIZE_8, partitionEntries,
0, partitionLength);
processesPartitions(partitionEntries, numberOfPartitions);
// Mystery Structure get processed here (skipped for now), still part of the header
}
/**
* Processes an individual GPT partition entry.
*
* @param partitions byte array holding partition data.
* @param numberOfPartitions number of partitions included in the data.
* @throws java.io.UnsupportedEncodingException if partition data fails to parse.
*/
private void processesPartitions(final byte[] partitions, final int numberOfPartitions)
throws UnsupportedEncodingException {
byte[] partitionData = new byte[UefiConstants.SIZE_128];
for (int i = 0; i < numberOfPartitions; i++) {
System.arraycopy(partitions, i * partitonEntryLength, partitionData, 0,
partitonEntryLength);
partitionList.add(new UefiPartition(partitionData));
}
}
/**
* Provides a human readable string describing the GPT Partition information.
*
* @return a human readable string holding the partition information.
*/
public String toString() {
String headerStr = HexUtils.byteArrayToHexString(header);
StringBuilder partitionInfo = new StringBuilder();
partitionInfo.append("GPT Header Signature = " + headerStr + " : Number of Partitions = "
+ numberOfPartitions + "\n");
for (int i = 0; i < numberOfPartitions; i++) {
if (i > 0) {
partitionInfo.append("\n");
}
partitionInfo.append(" Partition " + i + " information\n");
partitionInfo.append(partitionList.get(i).toString());
}
return partitionInfo.toString();
}
/**
* Helper method for converting little Endian byte arrays into Big Endian integers.
*
* @param data data to convert.
* @return an integer.
*/
public int getIntFromBytes(final byte[] data) {
byte[] bigEndData = HexUtils.leReverseByte(data);
BigInteger bigInt = new BigInteger(bigEndData);
return bigInt.intValue();
}
}

View File

@ -0,0 +1,142 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiGuid;
import lombok.Getter;
import java.math.BigInteger;
import java.nio.file.Path;
import java.util.ArrayList;
/**
* Class to process the PC Client Firmware profile defined EV_EFI_HANDOFF_TABLES event.
* The Event data holds a structure called UEFI_HANDOFF_TABLE_POINTERS:
* <p>
* tdUEFI_HANDOFF_TABLE_POINTERS {
* UINT64 NumberOfTables;
* UEFI_CONFIGURATION_TABLE TableEntry[NumberOfTables];
* }UEFI_HANDOFF_TABLE_POINTERS;
* <p>
* The UEFI_CONFIGURATION_TABLE id defined in the UEFI spec as:
* <p>
* typedef struct{
* EFI_GUID VendorGuid;
* VOID *VendorTable;
* } EFI_CONFIGURATION_TABLE;
* Where the defines
* VendorGuid: The 128-bit GUID value that uniquely identifies the system configuration table.
* VendorTable: A pointer to the table associated with VendorGuid.
* Section 4.6 of the UEFI spec has a listing of some of the industry defined
* standard that define the particular table.
*/
public class EvEfiHandoffTable {
/**
* Number of Tables.
*/
@Getter
private int numberOfTables = 0;
/**
* List of Vendor GUIDs.
*/
private ArrayList<UefiGuid> vendorGuids = new ArrayList<>();
/**
* List of Vendors.
*/
private ArrayList<byte[]> vendorTables = new ArrayList<>();
private Path vendorPathString;
/**
* EvEFIHandoffTable constructor.
*
* @param tpmEventData byte array holding the Handoff table data.
*/
public EvEfiHandoffTable(final byte[] tpmEventData) {
// Get NumberOfTables from the EventData
byte[] count = new byte[UefiConstants.SIZE_8];
System.arraycopy(tpmEventData, 0, count, 0, UefiConstants.SIZE_8);
byte[] bigEndCount = HexUtils.leReverseByte(count);
BigInteger countInt = new BigInteger(bigEndCount);
numberOfTables = countInt.intValue();
// process each UEFI_CONFIGURATION_TABLE table
int offset = UefiConstants.OFFSET_8;
for (int tables = 0; tables < numberOfTables; tables++) {
vendorGuids.add(getNextGUID(tpmEventData, offset));
vendorTables.add(getNextTable(tpmEventData, offset + UefiConstants.OFFSET_16));
offset += UefiConstants.OFFSET_24;
}
}
/**
* EvEFIHandoffTable constructor.
*
* @param tpmEventData byte array holding the Handoff table data.
* @param vendorPathString the string for the vendor file
*/
public EvEfiHandoffTable(final byte[] tpmEventData, final Path vendorPathString) {
// Get NumberOfTables from the EventData
byte[] count = new byte[UefiConstants.SIZE_8];
System.arraycopy(tpmEventData, 0, count, 0, UefiConstants.SIZE_8);
byte[] bigEndCount = HexUtils.leReverseByte(count);
BigInteger countInt = new BigInteger(bigEndCount);
numberOfTables = countInt.intValue();
this.vendorPathString = vendorPathString;
// process each UEFI_CONFIGURATION_TABLE table
int offset = UefiConstants.OFFSET_8;
for (int tables = 0; tables < numberOfTables; tables++) {
vendorGuids.add(getNextGUID(tpmEventData, offset));
vendorTables.add(getNextTable(tpmEventData, offset + UefiConstants.OFFSET_16));
offset += UefiConstants.OFFSET_24;
}
}
/**
* Returns the next GUI in the table.
*
* @param eventData byte array holding the guids.
* @param offset offset to the guid.
* @return Vendor Guid
*/
private UefiGuid getNextGUID(final byte[] eventData, final int offset) {
byte[] guid = new byte[UefiConstants.SIZE_16];
System.arraycopy(eventData, offset, guid, 0, UefiConstants.SIZE_16);
if (vendorPathString == null || vendorPathString.toString().isEmpty()) {
return new UefiGuid(guid);
} else {
return new UefiGuid(guid, vendorPathString);
}
}
/**
* Copies the next table to a new array.
*
* @param eventData byte array holding the next table.
* @param offset offset within the table to fond the data.
* @return a byte array holding the new table.
*/
private byte[] getNextTable(final byte[] eventData, final int offset) {
byte[] table = new byte[UefiConstants.SIZE_8];
System.arraycopy(eventData, offset, table, 0, UefiConstants.SIZE_8);
return table;
}
/**
* Returns a human readable description of the hand off tables.
*
* @return a human readable description.
*/
public String toString() {
StringBuilder tableInfo = new StringBuilder();
tableInfo.append("Number of UEFI_CONFIGURATION_TABLEs = " + numberOfTables + "\n");
for (int i = 0; i < numberOfTables; i++) {
UefiGuid currentGuid = vendorGuids.get(i);
tableInfo.append(" Table " + i + ": " + currentGuid.toString());
tableInfo.append(" UEFI industry standard table type = "
+ currentGuid.getVendorTableReference() + "\n");
tableInfo.append(" VendorTable " + i + " address: "
+ HexUtils.byteArrayToHexString(vendorTables.get(i)));
}
return tableInfo.toString();
}
}

View File

@ -0,0 +1,150 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.TcgTpmtHa;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import lombok.Getter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
/**
* Class to process the TCG_EfiSpecIDEvent.
* The first 16 bytes of a Event Data MUST be String based identifier (Signature).
* The only currently defined Signature is "Spec ID Event03" which implies the data is
* a TCG_EfiSpecIDEvent. TCG_EfiSpecIDEvent is the first event in a TPM Event Log
* and is used to determine the format of the Log (SHA1 vs Crypt Agile).
* <p>
* typedef struct tdTCG_EfiSpecIdEvent {
* BYTE Signature[16];
* UINT32 platformClass;
* UINT8 specVersionMinor;
* UINT8 specVersionMajor;
* UINT8 specErrata;
* UINT8 uintnSize;
* UINT32 numberOfAlgorithms;
* TCG_EfiSpecIdEventAlgorithmSize digestSizes[numberOfAlgorithms];
* UINT8 vendorInfoSize;
* BYTE vendorInfo[VendorInfoSize];
* } TCG_EfiSpecIDEvent;
* <p>
* typedef struct tdTCG_EfiSpecIdEventAlgorithmSize {
* UINT16 algorithmId;
* UINT16 digestSize;
* } TCG_EfiSpecIdEventAlgorithmSize;
* <p>
* define TPM_ALG_SHA1 (TPM_ALG_ID)(0x0004)
* define TPM_ALG_SHA256 (TPM_ALG_ID)(0x000B)
* define TPM_ALG_SHA384 (TPM_ALG_ID)(0x000C)
* define TPM_ALG_SHA512 (TPM_ALG_ID)(0x000D)
* <p>
* Notes: Parses event data for an EfiSpecID per Table 5 TCG_EfiSpecIdEvent Example.
* 1. Should be the first Structure in the log
* 2. Has an EventType of EV_NO_ACTION (0x00000003)
* 3. Digest of 20 bytes of all 0's
* 4. Event content defined as TCG_EfiSpecIDEvent Struct.
* 5. First 16 bytes of the structure is an ASCII "Spec ID Event03"
* 6. The version of the log is used to determine which format the Log
* is to use (sha1 or Crypto Agile)
*/
@Getter
public class EvEfiSpecIdEvent {
/**
* Minor Version.
*/
private String versionMinor = "";
/**
* Major Version.
*/
private String versionMajor = "";
/**
* Specification errata version.
*/
private String errata = "";
/**
* Signature (text) data.
*/
private String signature = "";
/**
* Platform class.
*/
private String platformClass = "";
/**
* Algorithm count.
*/
private int numberOfAlg = 0;
/**
* True if event log uses Crypto Agile format.
*/
private boolean cryptoAgile = false;
/**
* Algorithm list.
*/
private ArrayList<String> algList = new ArrayList<String>();
/**
* EvEfiSpecIdEvent Constructor.
*
* @param efiSpecId byte array holding the spec ID Event.
*/
public EvEfiSpecIdEvent(final byte[] efiSpecId) {
byte[] signatureBytes = new byte[UefiConstants.SIZE_16];
System.arraycopy(efiSpecId, 0, signatureBytes, 0, UefiConstants.SIZE_16);
signature = HexUtils.byteArrayToHexString(signatureBytes);
signature = new String(signatureBytes, StandardCharsets.UTF_8)
.substring(0, UefiConstants.SIZE_15);
byte[] platformClassBytes = new byte[UefiConstants.SIZE_4];
System.arraycopy(efiSpecId, UefiConstants.OFFSET_16, platformClassBytes, 0,
UefiConstants.SIZE_4);
platformClass = HexUtils.byteArrayToHexString(platformClassBytes);
byte[] specVersionMinorBytes = new byte[1];
System.arraycopy(efiSpecId, UefiConstants.OFFSET_20, specVersionMinorBytes, 0, 1);
versionMinor = HexUtils.byteArrayToHexString(specVersionMinorBytes);
byte[] specVersionMajorBytes = new byte[1];
System.arraycopy(efiSpecId, UefiConstants.OFFSET_21, specVersionMajorBytes, 0, 1);
versionMajor = HexUtils.byteArrayToHexString(specVersionMajorBytes);
byte[] specErrataBytes = new byte[1];
System.arraycopy(efiSpecId, UefiConstants.OFFSET_22, specErrataBytes, 0, 1);
errata = HexUtils.byteArrayToHexString(specErrataBytes);
byte[] numberOfAlgBytes = new byte[UefiConstants.SIZE_4];
System.arraycopy(efiSpecId, UefiConstants.OFFSET_24, numberOfAlgBytes, 0,
UefiConstants.SIZE_4);
numberOfAlg = HexUtils.leReverseInt(numberOfAlgBytes);
byte[] algorithmIDBytes = new byte[UefiConstants.SIZE_2];
int algLocation = UefiConstants.SIZE_28;
for (int i = 0; i < numberOfAlg; i++) {
System.arraycopy(efiSpecId, algLocation + UefiConstants.OFFSET_4 * i, algorithmIDBytes,
0, UefiConstants.SIZE_2);
String alg = TcgTpmtHa.tcgAlgIdToString(HexUtils.leReverseInt(algorithmIDBytes));
algList.add(alg);
}
if ((algList.size() == 1) && (algList.get(0).compareTo("SHA1") == 0)) {
cryptoAgile = false;
} else {
cryptoAgile = true;
}
}
/**
* Returns a human readable description of the data within this event.
*
* @return a description of this event..
*/
public String toString() {
String specInfo = "";
if (signature.equals("Spec ID Event#")) {
specInfo += "Platform Profile Specification version = " + versionMajor + "." + versionMinor
+ " using errata version" + errata;
} else {
specInfo = "EV_NO_ACTION event named " + signature
+ " encountered but support for processing it has not been added to this application";
}
return specInfo;
}
}

View File

@ -0,0 +1,68 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import lombok.Getter;
/**
* Class for processing the EV_EVENT_TAG.
* The structure for the Event Data is defined as:
* structure tdTCG_PCClientTaggedEvent{
* UINT32 taggedEventID;
* UINT32 taggedEventDataSize;
* BYTE taggedEventData[taggedEventDataSize];
* } TCG_PCClientTaggedEvent;
* ToDo: Find lookup of taggedEventID and figure out how to process.
*/
public class EvEventTag {
/**
* Event Tag Information.
*/
private String eventTagInfo = "";
/**
* Event Tag ID.
*/
@Getter
private int tagEventID = 0;
/**
* Event ID.
*/
private int eventID = 0;
/**
* Data size.
*/
@Getter
private int dataSize = 0;
/**
* Processes event tag.
*
* @param eventTag byte array holding the eventTag data.
*/
public EvEventTag(final byte[] eventTag) {
if (eventTag.length < UefiConstants.SIZE_8) {
eventTagInfo = "Invalid EV Event Tag data";
} else {
byte[] tagEventIdBytes = new byte[UefiConstants.SIZE_4];
System.arraycopy(eventTag, 0, tagEventIdBytes, 0, UefiConstants.SIZE_4);
eventID = HexUtils.leReverseInt(tagEventIdBytes);
byte[] tagEventDataSize = new byte[UefiConstants.SIZE_4];
System.arraycopy(eventTag, UefiConstants.OFFSET_4, tagEventDataSize, 0,
UefiConstants.SIZE_4);
dataSize = HexUtils.leReverseInt(tagEventDataSize);
}
}
/**
* Returns a human readable string of the Event Tag.
*
* @return human readable string.
*/
public String toString() {
if (eventTagInfo.isEmpty()) {
eventTagInfo = " Tagged Event ID = " + eventID;
eventTagInfo += " Data Size = " + dataSize;
}
return eventTagInfo;
}
}

View File

@ -0,0 +1,43 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import java.nio.charset.StandardCharsets;
/**
* Processes event type EV_IPL which is deprecated in the current spec,
* but defined in older version of the specification(1.0.0) as contain
* "informative information about the IPL code" (ascii strings).
*/
public class EvIPL {
private String description = "";
/**
*IPL Event Constructor.
* @param event byte array holding the IPL Event data.
*/
public EvIPL(final byte[] event) {
event(event);
}
/**
* Processes IPL event.
* @param event byte array holding the IPL Event data.
* @return a description of the IPl event.
*/
public String event(final byte[] event) {
if (event == null) {
description = "Invalid IPL event data";
} else {
description = " \"" + new String(event, StandardCharsets.UTF_8) + "\"";
}
return description;
}
/**
* Returns a human readable description of the IPL Event.
* @return human readable description.
*/
public String toString() {
return description;
}
}

View File

@ -0,0 +1,86 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import lombok.Getter;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
/**
* Class to process the EV_NO_ACTION event using a structure of TCG_EfiSpecIDEvent.
* The first 16 bytes of the event data MUST be a String based identifier (Signature).
* The only currently defined Signature is "Spec ID Event03"
* which implies the data is a TCG_EfiSpecIDEvent.
* TCG_EfiSpecIDEvent is the first event in a TPM Event Log and is used to determine
* if the format of the Log (SHA1 vs Crypto Agile).
* <p>
* Notes:
* 1. First 16 bytes of the structure is an ASCII with a fixed Length of 16
* 2. Add processing of other NoEvent types when new ones get defined
*/
public class EvNoAction {
/**
* Signature (text) data.
*/
private String signature = "";
/**
* True of the event is a SpecIDEvent.
*/
private boolean bSpecIDEvent = false;
/**
* EvEfiSpecIdEvent Object.
*/
@Getter
private EvEfiSpecIdEvent specIDEvent = null;
/**
* EvNoAction constructor.
*
* @param eventData byte array holding the event to process.
* @throws java.io.UnsupportedEncodingException if input fails to parse.
*/
public EvNoAction(final byte[] eventData) throws UnsupportedEncodingException {
byte[] signatureBytes = new byte[UefiConstants.SIZE_15];
System.arraycopy(eventData, 0, signatureBytes, 0, UefiConstants.SIZE_15);
signature = new String(signatureBytes, StandardCharsets.UTF_8);
signature = signature.replaceAll("[^\\P{C}\t\r\n]", ""); // remove null characters
if (signature.contains("Spec ID Event03")) { // implies CryptAgileFormat
specIDEvent = new EvEfiSpecIdEvent(eventData);
bSpecIDEvent = true;
}
}
/**
* Determines if this event is a SpecIDEvent.
*
* @return true of the event is a SpecIDEvent.
*/
public boolean isSpecIDEvent() {
return bSpecIDEvent;
}
/**
* Returns a description of this event.
*
* @return Human readable description of this event.
*/
public String toString() {
String specInfo = "";
if (bSpecIDEvent) {
specInfo += " Signature = Spec ID Event03 : ";
if (specIDEvent.isCryptoAgile()) {
specInfo += "Log format is Crypto Agile\n";
} else {
specInfo += "Log format is SHA 1 (NOT Crypto Agile)\n";
}
specInfo += " Platform Profile Specification version = "
+ specIDEvent.getVersionMajor() + "." + specIDEvent.getVersionMinor()
+ " using errata version " + specIDEvent.getErrata();
} else {
specInfo = "EV_NO_ACTION event named " + signature
+ " encountered but support for processing it has not been added to this application.\n";
}
return specInfo;
}
}

View File

@ -0,0 +1,78 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiFirmware;
import lombok.Getter;
import java.nio.charset.StandardCharsets;
/**
* Class for processing EV_POST_CODE event types
*
* typedef struct tdUEFI_PLATFORM_FIRMWARE_BLOB {
* UEFI_PHYSICAL_ADDRESS BlobBase; // Same as UINT64 for most systems
* UINT64 BlobLength;
* } UEFI_PLATFORM_FIRMWARE_BLOB;
*
* However Table 9 of the PC Client Platform firmware profile states that even content is a string
* For POST code, the event data SHOULD be POST CODE.
* For embedded SMM code, the event data SHOULD be SMM CODE.
* For ACPI flash data, the event data SHOULD be ACPI DATA.
* For BIS code, the event data SHOULD be BIS CODE.
* For embedded option ROMs, the event data SHOULD be Embedded UEFI Driver.
*/
public class EvPostCode {
/** Event Description. */
private String codeInfo = "";
/** String type flag. */
private boolean bisString = false;
/** Firmware object. */
@Getter
private UefiFirmware firmwareBlob = null;
/**
* EcPostCode constructor.
* @param postCode byte array holding the post code content.
*/
public EvPostCode(final byte[] postCode) {
// 2 ways post code has been implemented, check for the ascii string first
if (isAscii(postCode)) {
codeInfo = new String(postCode, StandardCharsets.UTF_8);
bisString = true;
} else {
firmwareBlob = new UefiFirmware(postCode);
}
}
/**
* Flag set to true if Post Code is a string.
* @return true if Post Code is a string.
*/
public boolean isString() {
return bisString;
}
/**
* Returns a human readable string of the Post Code information.
* @return human readable string.
*/
public String toString() {
if (bisString) {
return codeInfo;
}
return firmwareBlob.toString();
}
/**
* Determines if the byte array is a string.
* @param postCode byte array input.
* @return true if byte array is a string.
*/
public static boolean isAscii(final byte[] postCode) {
for (byte b : postCode) {
if (!Character.isDefined(b)) {
return false;
}
}
return true;
}
}

View File

@ -0,0 +1,41 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import java.nio.charset.StandardCharsets;
/**
* Class to process the PC Client Firmware profile defined EV_S_CRTM_CONTENTS event.
*/
public class EvSCrtmContents {
private String description = "";
/**
* Constructor that takes in the event data and waits to be called.
* @param event byte array holding the event content data.
*/
public EvSCrtmContents(final byte[] event) {
scrtmContents(event);
}
/**
* Checks if event data is null and if not it converts to a String.
* @param event byte array holding the event data.
* @return String contents contained within the event.
*/
public String scrtmContents(final byte[] event) {
if (event == null) {
description = "invalid content event data";
} else {
description = new String(event, StandardCharsets.UTF_8);
}
return description;
}
/**
* Human readable string contained within the CRTM Contents event.
* @return Human readable string.
*/
public String toString() {
return description;
}
}

View File

@ -0,0 +1,63 @@
package hirs.attestationca.portal.utils.tpm.eventlog.events;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiConstants;
import hirs.attestationca.portal.utils.tpm.eventlog.uefi.UefiGuid;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
/**
* Class to process the PC Client Firmware profile defined EV_S_CRTM_VERSION event.
*/
public class EvSCrtmVersion {
private String description = "";
/**
* Constructor that takes in the event data and waits to be called.
*
* @param event byte array holding the event content data.
* @throws java.io.UnsupportedEncodingException if parsing issues exist.
*/
public EvSCrtmVersion(final byte[] event) throws UnsupportedEncodingException {
sCrtmVersion(event);
}
/**
* Checks if event data is null and if not it converts to a String.
*
* @param data byte array holding the vent content.
* @return String representation of the version.
*/
public String sCrtmVersion(final byte[] data) {
UefiGuid guid = null;
if (data == null) {
description = "invalid content event data";
} else {
if (data.length == UefiConstants.SIZE_16) {
if (UefiGuid.isValidUUID(data)) {
guid = new UefiGuid(data);
String guidInfo = guid.toStringNoLookup();
description = " SCRM Version = " + guidInfo;
}
} else if (data.length < UefiConstants.SIZE_4) {
description = HexUtils.byteArrayToHexString(data);
} else if (EvPostCode.isAscii(data)) {
description = new String(data, StandardCharsets.UTF_8);
} else {
description = "Unknown Version format";
}
}
return (description);
}
/**
* Return function to send data to the toString.
*
* @return String representation of the version.
*/
public String toString() {
return description;
}
}

View File

@ -0,0 +1,6 @@
/**
* Non-persistant classes related to TGC Event Logs.
*/
package hirs.attestationca.portal.utils.tpm.eventlog.events;

View File

@ -0,0 +1,6 @@
/**
* Non-persistant classes related to TGC Event Logs.
*/
package hirs.attestationca.portal.utils.tpm.eventlog;

View File

@ -0,0 +1,41 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
/**
* Class to process a UEFI BootOrder variable.
* UEFI spec version 2.8 section 3.3 on page 83 defines the Boot Order as:
* an array of UINT16s that make up an ordered list of the Boot#### options.
*/
public class UefiBootOrder {
/**
* list of UINT16 Boot#### numbers.
*/
private char[] bootOrder = null;
/**
* Process the BootOrder UEFI variable.
*
* @param order byte array holding the UEFI boot order variable.
*/
UefiBootOrder(final byte[] order) {
bootOrder = new char[order.length / UefiConstants.SIZE_2];
for (int i = 0; i < order.length; i += UefiConstants.SIZE_2) {
bootOrder[i / UefiConstants.SIZE_2] =
(char) (order[i + 1] * UefiConstants.SIZE_256 + order[i]);
}
}
/**
* Provides a human readable Boot Order list on single line.
*
* @return A human readable Boot Order
*/
public String toString() {
StringBuilder orderList = new StringBuilder();
orderList.append("BootOrder = ");
for (int i = 0; i < bootOrder.length; i++) {
orderList.append(String.format("Boot %04d", (int) bootOrder[i]));
}
//orderList.append("\n");
return orderList.toString();
}
}

View File

@ -0,0 +1,111 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import hirs.attestationca.portal.utils.HexUtils;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
/**
* Class to process a UEFI Boot#### variable.
* Data is defined using the EFI_LOAD_OptionStructure:
* typedef struct _EFI_LOAD_OPTION {
* UINT32 Attributes;
* UINT16 FilePathListLength;
* // CHAR16 Description[];
* // EFI_DEVICE_PATH_PROTOCOL FilePathList[];
* // UINT8 OptionalData[];
* } EFI_LOAD_OPTION;
* <p>
* No length field for the Description is given
* so we need to calculate it by search for a null termination on the Description field
* Data following the Description should be an EFI Device Path
*/
public class UefiBootVariable {
/**
* Human readable description of the variable.
*/
private String description = "";
/**
* Variable attributes.
*/
private byte[] attributes = null;
/**
* Firmware memory blob.
*/
private byte[] blob = null;
/**
* UEFI Device Path.
*/
private UefiDevicePath efiDevPath = null;
/**
* UefiBootVariable Constructor.
*
* @param bootVar byte array holding the boot variable.
* @throws java.io.UnsupportedEncodingException if the data fails to parse.
*/
public UefiBootVariable(final byte[] bootVar) throws UnsupportedEncodingException {
attributes = new byte[UefiConstants.SIZE_4];
System.arraycopy(bootVar, 0, attributes, 0, UefiConstants.SIZE_4);
byte[] blobLen = new byte[UefiConstants.SIZE_2];
System.arraycopy(bootVar, UefiConstants.OFFSET_4, blobLen, 0, UefiConstants.SIZE_2);
int blobLength = HexUtils.leReverseInt(blobLen);
if (blobLength % UefiConstants.SIZE_2 == 0) {
blob = new byte[blobLength];
} else {
blob = new byte[blobLength + 1];
}
System.arraycopy(bootVar, UefiConstants.OFFSET_6, blob, 0, blobLength);
int descLength = getChar16ArrayLength(blob);
byte[] desc = new byte[descLength * UefiConstants.SIZE_2];
System.arraycopy(bootVar, UefiConstants.OFFSET_6, desc, 0, descLength * UefiConstants.SIZE_2);
description = new String(UefiDevicePath.convertChar16tobyteArray(desc), StandardCharsets.UTF_8);
// Data following the Description should be EFI Partition Data (EFI_DEVICE_PATH_PROTOCOL)
int devPathLength = blobLength;
int devPathOffset = UefiConstants.OFFSET_6 + descLength; //attributes+bloblength+desc+length+2
byte[] devPath = new byte[devPathLength];
System.arraycopy(bootVar, devPathOffset, devPath, 0, devPathLength);
efiDevPath = new UefiDevicePath(devPath);
}
/**
* Returns a string that represents a UEFI boot variable.
* Some devices have not properly terminated the Description filed with null characters
* so garbage bytes are appended to the string that we must strip off.
* All non-alpha numeric is stripped from the string.
*
* @return string that represents a UEFI boot variable.
*/
public String toString() {
StringBuilder bootInfo = new StringBuilder("Description = ");
String bootVar = description.replaceAll("[^a-zA-Z_0-0\\s]", ""); // remove all non ascii chars
bootInfo.append(bootVar + "\n" + efiDevPath.toString());
return bootInfo.toString();
}
/**
* Searches for the first char16 based null character (2 bytes of zeros).
* Searches in a given byte array and returns the length of data up to that point in bytes.
*
* @param data a byte array to search for the data.
* @return the length of the data in bytes at the beginning of the byte array.
* which was terminated by a null character.
*/
public int getChar16ArrayLength(final byte[] data) {
int count = 0;
byte[] nullTerminator = new byte[UefiConstants.SIZE_2];
byte[] char16 = new byte[UefiConstants.SIZE_2];
nullTerminator[0] = 0;
nullTerminator[1] = 0;
for (int i = 0; i < data.length; i += UefiConstants.SIZE_2) {
char16[0] = data[i];
char16[1] = data[i + 1];
count++;
if (Arrays.equals(nullTerminator, char16)) {
return count * UefiConstants.SIZE_2;
}
}
return count * UefiConstants.SIZE_2 + 1;
}
}

View File

@ -0,0 +1,274 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
/**
* This class contains the String constants that are referenced by UEFI.
* It is expected that member properties of this class will expand as
* more functionality is added.
*/
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public final class UefiConstants {
/**
* 2 byte size.
*/
public static final int SIZE_2 = 2;
/**
* 4 byte size.
*/
public static final int SIZE_4 = 4;
/**
* 5 byte size.
*/
public static final int SIZE_5 = 5;
/**
* 8 byte size.
*/
public static final int SIZE_8 = 8;
/**
* 12 byte size.
*/
public static final int SIZE_12 = 12;
/**
* 15 byte size.
*/
public static final int SIZE_15 = 15;
/**
* 16 byte size.
*/
public static final int SIZE_16 = 16;
/**
* 20 byte size.
*/
public static final int SIZE_20 = 20;
/**
* 21 byte size.
*/
public static final int SIZE_21 = 21;
/**
* 22 byte size.
*/
public static final int SIZE_22 = 22;
/**
* 23 byte size.
*/
public static final int SIZE_23 = 23;
/**
* 24 byte size.
*/
public static final int SIZE_24 = 24;
/**
* 28 byte size.
*/
public static final int SIZE_28 = 28;
/**
* 32 byte size.
*/
public static final int SIZE_32 = 32;
/**
* 40 byte size.
*/
public static final int SIZE_40 = 40;
/**
* 128 byte size.
*/
public static final int SIZE_128 = 128;
/**
* 256 byte size.
*/
public static final int SIZE_256 = 256;
/**
* 1 byte offset.
*/
public static final int OFFSET_1 = 1;
/**
* 2 byte offset.
*/
public static final int OFFSET_2 = 2;
/**
* 3 byte offset.
*/
public static final int OFFSET_3 = 3;
/**
* 4 byte offset.
*/
public static final int OFFSET_4 = 4;
/**
* 5 byte offset.
*/
public static final int OFFSET_5 = 5;
/**
* 6 byte offset.
*/
public static final int OFFSET_6 = 4;
/**
* 8 byte offset.
*/
public static final int OFFSET_8 = 8;
/**
* 16 byte offset.
*/
public static final int OFFSET_16 = 16;
/**
* 20 byte offset.
*/
public static final int OFFSET_20 = 20;
/**
* 21 byte offset.
*/
public static final int OFFSET_21 = 21;
/**
* 22 byte offset.
*/
public static final int OFFSET_22 = 22;
/**
* 24 byte offset.
*/
public static final int OFFSET_24 = 24;
/**
* 28 byte offset.
*/
public static final int OFFSET_28 = 28;
/**
* 28 byte offset.
*/
public static final int OFFSET_32 = 32;
/**
* 40 byte offset.
*/
public static final int OFFSET_40 = 40;
/**
* 41 byte offset.
*/
public static final int OFFSET_41 = 41;
/**
* Device path terminator.
*/
public static final int TERMINATOR = 0x7f;
/**
* Device path end flag.
*/
public static final int END_FLAG = 0xff;
/**
* Device Type Hardware.
*/
public static final int DEV_HW = 0x01;
/**
* Device Type ACPI.
*/
public static final int DEV_ACPI = 0x02;
/**
* Device Type Messaging.
*/
public static final int DEV_MSG = 0x03;
/**
* Device Type Media.
*/
public static final int DEV_MEDIA = 0x04;
/**
* Device Type Hardware.
*/
public static final int DEV_BIOS = 0x05;
/**
* Device Sub-Type USV.
*/
public static final int DEV_SUB_USB = 0x05;
/**
* Device Sub-Type Sata.
*/
public static final int DEV_SUB_SATA = 0x12;
/**
* Device Sub-Type nvm.
*/
public static final int DEV_SUB_NVM = 0x17;
/**
* BIOS Device Path reserved.
*/
public static final int DEVPATH_BIOS_RESERVED = 0x0;
/**
* BIOS Device Path for Floppy disks.
*/
public static final int DEVPATH_BIOS_FLOPPY = 0x01;
/**
* BIOS Device Path Hard drives.
*/
public static final int DEVPATH_BIOS_HD = 0x02;
/**
* BIOS Device Path for CD Drives.
*/
public static final int DEVPATH_BIOS_CD = 0x03;
/**
* BIOS Device Path for PCM CIA drives.
*/
public static final int DEVPATH_BIOS_PCM = 0x04;
/**
* BIOS Device Path for USB Drives.
*/
public static final int DEVPATH_BIOS_USB = 0x05;
/**
* BIOS Device Path for embedded network.
*/
public static final int DEVPATH_BIOS_EN = 0x06;
/**
* BIOS Device Path for a Bootstrap Entry Vector (BEV) from an option ROM.
*/
public static final int DEVPATH_BIOS_BEV = 0x80;
/**
* Hardware Device Path.
*/
public static final int DEVPATH_HARWARE = 0x1;
/**
* 2 byte size.
*/
public static final int DEVPATH_VENDOR = 0x03;
/**
* 2 byte size.
*/
public static final int DEVPATH_FILE = 0x04;
/**
* PIWG File device path type.
*/
public static final int DEVPATH_PWIG_FILE = 0x06;
/**
* PIWG Volume device path type.
*/
public static final int DEVPATH_PWIG_VOL = 0x07;
/**
* PC-AT compatible legacy MBR.
*/
public static final int DRIVE_TYPE_PC_AT = 0x01;
/**
* GUID Partition Table type.
*/
public static final int DRIVE_TYPE_GPT = 0x02;
/**
* Drive Signature type.
*/
public static final int DRIVE_SIG_NONE = 0x00;
/**
* Drive Signature type.
*/
public static final int DRIVE_SIG_32BIT = 0x01;
/**
* Drive Signature type.
*/
public static final int DRIVE_SIG_GUID = 0x02;
/**
* standard byte length.
*/
public static final int BYTE_LENGTH = 8;
/**
* standard byte length.
*/
public static final int ATTRIBUTE_LENGTH = 48;
/**
* standard byte length.
*/
public static final int PART_NAME_LENGTH = 56;
/**
* standard UEFI partition table lengh.
*/
public static final int UEFI_PT_LENGTH = 72;
}

View File

@ -0,0 +1,488 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import hirs.attestationca.portal.utils.HexUtils;
import lombok.Getter;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
/**
* Class to process EFI_DEVICE_PATH_PROTOCOL which is referred to as the UEFI_DEVICE_PATH
* <p>
* #define EFI_DEVICE_PATH_PROTOCOL_GUID \09576e91-6d3f-11d2-8e39-00a0c969723b
* typedef struct _EFI_DEVICE_PATH_PROTOCOL {
* UINT8 Type;
* UINT8 SubType;
* UINT8 Length[2];
* } EFI_DEVICE_PATH_PROTOCOL;
* <p>
* Where Type is defined in the UEFI spec section 10:
* Type 0x01 Hardware Device Path
* Type 0x02 ACPI Device Path
* Type 0x03 Messaging Device Path
* Type 0x04 Media Device Path
* Type 0x05 BIOS Boot Specification Device Path
* Type 0x7F End of Hardware Device Path
* Each Type has a sub-type that may or may no be defined in the section
* <p>
* Only a few of the SubTypes have been implemented as there are many,
* but only those that were reported using the test devices at hand.
* Without test patterns, the processing may lead to an un-handled exception
*/
public class UefiDevicePath {
/**
* UEFI Device path type.
*/
@Getter
private String type = "";
/**
* UEFI Device path sub-type.
*/
private String subType = "";
/**
* UEFI Device path human readable description.
*/
private String devPathInfo = "";
/**
* UEFI Device path length.
*/
@Getter
private int length = 0;
/**
* UEFI Device path constructor.
*
* @param path byte array holding device path data
* @throws java.io.UnsupportedEncodingException if path byte array contains unexpected values
*/
public UefiDevicePath(final byte[] path) throws UnsupportedEncodingException {
devPathInfo = processDevPath(path);
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
System.arraycopy(path, UefiConstants.OFFSET_2, lengthBytes, 0, UefiConstants.OFFSET_2);
length = HexUtils.leReverseInt(lengthBytes);
}
/**
* Returns the UEFI device sub-type.
*
* @return uefi sub-type
*/
public String getSubType() {
return subType.trim();
}
/**
* Processes the UEFI device path.
* UEFI device path is a collection of EFI_DEVICE_PATH_PROTOCOL structures of variable length.
* length must be calculated for each device path and used as an offset.
* devPath is terminated by 07f and 0xff per the UEFi spec.
*
* @param path byte array holding the Device path
* @return Human readable string containing the device path description.
* @throws java.io.UnsupportedEncodingException
*/
private String processDevPath(final byte[] path) throws UnsupportedEncodingException {
StringBuilder pInfo = new StringBuilder();
int devLength = 0, pathOffset = 0, devCount = 0;
while (true) {
Byte devPath = Byte.valueOf(path[pathOffset]);
if ((devPath.intValue() == UefiConstants.TERMINATOR)
|| (devPath.intValue() == UefiConstants.END_FLAG)) {
break;
}
if (devCount++ > 0) {
pInfo.append("\n");
}
pInfo.append(processDev(path, pathOffset));
devLength = path[pathOffset + UefiConstants.OFFSET_3] * UefiConstants.SIZE_256
+ path[pathOffset + UefiConstants.OFFSET_2];
pathOffset = pathOffset + devLength;
if (pathOffset >= path.length) {
break;
}
}
return pInfo.toString();
}
/**
* Processes a specific UEFI device path, only limited set of types and subtypes are supported.
* Current types processed include Hardware Device Path, ACPI Device Path,
* Messaging Device Path, and Media Device Path.
*
* @param path
* @param offset
* @return human readable string representing the UEFI device path
* @throws java.io.UnsupportedEncodingException
*/
private String processDev(final byte[] path, final int offset)
throws UnsupportedEncodingException {
String devInfo = " ";
int devPath = path[offset];
byte unknownSubType = path[offset + UefiConstants.OFFSET_1];
switch (path[0 + offset]) {
case UefiConstants.DEV_HW:
type = "Hardware Device Path";
if (devPath == UefiConstants.DEVPATH_HARWARE) {
devInfo += type + ": " + pciSubType(path, offset);
}
break;
case UefiConstants.DEV_ACPI:
type = "ACPI Device Path";
devInfo += type + ": " + acpiSubType(path, offset);
break;
case UefiConstants.DEV_MSG:
type = "Messaging Device Path";
if (path[offset + UefiConstants.OFFSET_1] == UefiConstants.DEV_SUB_SATA) {
devInfo += type + ": " + sataSubType(path, offset);
} else if (path[offset + UefiConstants.OFFSET_1] == UefiConstants.DEV_SUB_NVM) {
devInfo += type + ": " + nvmSubType(path, offset);
} else if (path[offset + UefiConstants.OFFSET_1] == UefiConstants.DEV_SUB_USB) {
devInfo += type + ": " + usbSubType(path, offset);
} else {
devInfo += "UEFI Messaging Device Path Type " + Integer.valueOf(unknownSubType);
}
break;
case UefiConstants.DEV_MEDIA:
type = "Media Device Path";
if (path[offset + UefiConstants.OFFSET_1] == 0x01) {
devInfo += type + ": " + hardDriveSubType(path, offset);
} else if (path[offset + UefiConstants.OFFSET_1] == UefiConstants.DEVPATH_VENDOR) {
devInfo += type + ": " + vendorSubType(path, offset);
} else if (path[offset + UefiConstants.OFFSET_1] == UefiConstants.DEVPATH_FILE) {
devInfo += type + ": " + filePathSubType(path, offset);
} else if (path[offset + UefiConstants.OFFSET_1] == UefiConstants.DEVPATH_PWIG_FILE) {
devInfo += type + ": " + piwgFirmVolFile(path, offset);
} else if (path[offset + UefiConstants.OFFSET_1] == UefiConstants.DEVPATH_PWIG_VOL) {
devInfo += type + ": " + piwgFirmVolPath(path, offset);
} else {
devInfo += "UEFI Media Device Path Type " + Integer.valueOf(unknownSubType);
}
break;
case UefiConstants.DEV_BIOS:
type = "BIOS Device Path";
devInfo += type + ": " + biosDevicePath(path, offset);
break;
case UefiConstants.TERMINATOR:
devInfo += "End of Hardware Device Path";
break;
default:
devInfo += "UEFI Device Path Type " + Integer.valueOf(unknownSubType);
}
return devInfo;
}
/**
* processes the ACPI UEFI device subtype.
*
* @param path
* @param offset
* @return acpi device info
*/
private String acpiSubType(final byte[] path, final int offset) {
subType = "";
switch (path[offset + UefiConstants.OFFSET_1]) {
case 0x01:
subType = "(Short): ";
subType += acpiShortSubType(path, offset);
break;
case 0x02:
subType = "Expanded ACPI Device Path";
break;
default:
subType = "Invalid ACPI Device Path sub type";
}
return subType;
}
/**
* Processes the ACPI short subtype.
*
* @param path
* @param offset
* @return short acpi info.
*/
private String acpiShortSubType(final byte[] path, final int offset) {
subType = "";
byte[] hid = new byte[UefiConstants.SIZE_4];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, hid, 0, UefiConstants.SIZE_4);
subType += "_HID = " + HexUtils.byteArrayToHexString(hid);
System.arraycopy(path, 2 * UefiConstants.SIZE_4 + offset, hid, 0, UefiConstants.SIZE_4);
subType += "_UID = " + HexUtils.byteArrayToHexString(hid);
return subType;
}
/**
* Processes the PCI subType.
*
* @param path
* @param offset
* @return pci device info.
*/
private String pciSubType(final byte[] path, final int offset) {
subType = "PCI: PCI Function Number = ";
subType += String.format("0x%x", path[offset + UefiConstants.SIZE_4]);
subType += " PCI Device Number = ";
subType += String.format("0x%x", path[offset + UefiConstants.SIZE_5]);
return subType;
}
/**
* processes the SATA sub type.
*
* @param path
* @param offset
* @return SATA drive info.
*/
private String sataSubType(final byte[] path, final int offset) {
subType = "SATA: HBA Port Number = ";
byte[] data = new byte[UefiConstants.SIZE_2];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, data, 0, UefiConstants.SIZE_2);
subType += HexUtils.byteArrayToHexString(data);
System.arraycopy(path, UefiConstants.OFFSET_6 + offset, data, 0, UefiConstants.SIZE_2);
subType += " Port Multiplier = " + HexUtils.byteArrayToHexString(data);
System.arraycopy(path, UefiConstants.OFFSET_8 + offset, data, 0, UefiConstants.SIZE_2);
subType += " Logical Unit Number = " + HexUtils.byteArrayToHexString(data);
return subType;
}
/**
* Processes the hard drive sub type.
*
* @param path
* @param offset
* @return hard drive info.
*/
private String hardDriveSubType(final byte[] path, final int offset) {
subType = "Partition Number = ";
byte[] partnumber = new byte[UefiConstants.SIZE_4];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, partnumber, 0, UefiConstants.SIZE_4);
subType += HexUtils.byteArrayToHexString(partnumber);
byte[] data = new byte[UefiConstants.SIZE_8];
System.arraycopy(path, UefiConstants.OFFSET_8 + offset, data, 0, UefiConstants.SIZE_8);
subType += " Partition Start = " + HexUtils.byteArrayToHexString(data);
System.arraycopy(path, UefiConstants.OFFSET_16 + offset, data, 0, UefiConstants.SIZE_8);
subType += " Partition Size = " + HexUtils.byteArrayToHexString(data);
byte[] signature = new byte[UefiConstants.SIZE_16];
System.arraycopy(path, UefiConstants.OFFSET_24 + offset, signature, 0, UefiConstants.SIZE_16);
subType += "\n Partition Signature = ";
if (path[UefiConstants.OFFSET_41 + offset] == UefiConstants.DRIVE_SIG_NONE) {
subType += "None";
} else if (path[UefiConstants.OFFSET_41 + offset] == UefiConstants.DRIVE_SIG_32BIT) {
subType += HexUtils.byteArrayToHexString(signature);
} else if (path[UefiConstants.OFFSET_41 + offset] == UefiConstants.DRIVE_SIG_GUID) {
UefiGuid guid = new UefiGuid(signature);
subType += guid.toString();
} else {
subType += "invalid partition signature type";
}
subType += " Partition Format = ";
if (path[UefiConstants.OFFSET_40 + offset] == UefiConstants.DRIVE_TYPE_PC_AT) {
subType += " PC-AT compatible legacy MBR";
} else if (path[UefiConstants.OFFSET_40 + offset] == UefiConstants.DRIVE_TYPE_GPT) {
subType += " GUID Partition Table";
} else {
subType += " Invalid partition table type";
}
return subType;
}
/**
* Process the File path sub type.
*
* @param path
* @param offset
* @return file path info.
*/
private String filePathSubType(final byte[] path, final int offset) {
subType = "File Path = ";
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
System.arraycopy(path, 2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
byte[] filePath = new byte[subTypeLength];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, filePath, 0, subTypeLength);
byte[] fileName = convertChar16tobyteArray(filePath);
subType += new String(fileName, StandardCharsets.UTF_8);
return subType;
}
/**
* Process a vendor sub-type on a Media Type.
* Length of this structure in bytes. Length is 20 + n bytes
* Vendor-assigned GUID that defines the data that follows.
* Vendor-defined variable size data.
*
* @param path
* @param offset
* @return vendor device info.
*/
private String vendorSubType(final byte[] path, final int offset) {
subType = "Vendor Subtype GUID = ";
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
byte[] guidData = new byte[UefiConstants.SIZE_16];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData, 0, UefiConstants.SIZE_16);
UefiGuid guid = new UefiGuid(guidData);
subType += guid.toString() + " ";
if (subTypeLength - UefiConstants.SIZE_16 > 0) {
byte[] vendorData = new byte[subTypeLength - UefiConstants.SIZE_16];
System.arraycopy(path, UefiConstants.OFFSET_20
+ offset, vendorData, 0, subTypeLength - UefiConstants.SIZE_16);
subType += " : Vendor Data = " + HexUtils.byteArrayToHexString(vendorData);
} else {
subType += " : No Vendor Data pesent";
}
return subType;
}
/**
* Returns USB device info.
* UEFI Specification, Version 2.8.
*
* @param path
* @param offset
* @return USB device info.
*/
private String usbSubType(final byte[] path, final int offset) {
subType = " USB ";
subType += " port = " + Integer.valueOf(path[offset + UefiConstants.OFFSET_4]);
subType += " interface = " + Integer.valueOf(path[offset + UefiConstants.OFFSET_5]);
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
byte[] usbData = new byte[subTypeLength];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, usbData, 0, subTypeLength);
// Todo add further USB processing ...
return subType;
}
/**
* Returns NVM device info.
* UEFI Specification, Version 2.8.
* Name space Identifier (NSID) and IEEE Extended Unique Identifier (EUI-64):
* See Links to UEFI Related Documents
* (http://uefi.org/uefi under the headings NVM Express Specification.
*
* @param path
* @param offset
* @return NVM device info.
*/
private String nvmSubType(final byte[] path, final int offset) {
subType = "NVM Express Namespace = ";
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
byte[] nvmData = new byte[subTypeLength];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, nvmData, 0, subTypeLength);
subType += HexUtils.byteArrayToHexString(nvmData);
return subType;
}
/**
* BIOS Device Type definition.
* From Appendix A of the BIOS Boot Specification.
* Only processes the Device type.
* Status bootHandler pointer, and description String pointer are ignored.
*
* @param path byte array holding the device path.
* @return String that represents the UEFI defined BIOS Device Type.
*/
private String biosDevicePath(final byte[] path, final int offset) {
subType = "Legacy BIOS : Type = ";
Byte pathType = Byte.valueOf(path[offset + 1]);
switch (pathType.intValue()) {
case UefiConstants.DEVPATH_BIOS_RESERVED:
subType += "Reserved";
break;
case UefiConstants.DEVPATH_BIOS_FLOPPY:
subType += "Floppy";
break;
case UefiConstants.DEVPATH_BIOS_HD:
subType += "Hard Disk";
break;
case UefiConstants.DEVPATH_BIOS_CD:
subType += "CD-ROM";
break;
case UefiConstants.DEVPATH_BIOS_PCM:
subType += "PCMCIA";
break;
case UefiConstants.DEVPATH_BIOS_USB:
subType += "USB";
break;
case UefiConstants.DEVPATH_BIOS_EN:
subType += "Embedded network";
break;
case UefiConstants.DEVPATH_BIOS_BEV:
subType +=
"Bootstrap Entry Vector (BEV) from an Option ROM";
break;
default:
subType += "Unknown";
break;
}
return subType;
}
/**
* Returns PIWG firmware volume info.
* UEFI Specification, Version 2.8.
* PIWG Firmware File Section 10.3.5.6:
* Contents are defined in the UEFI PI Specification.
*
* @param path
* @param offset
* @return String that represents the PIWG Firmware Volume Path
*/
private String piwgFirmVolFile(final byte[] path, final int offset) {
subType = "PIWG Firmware File ";
byte[] guidData = new byte[UefiConstants.SIZE_16];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData, 0, UefiConstants.SIZE_16);
UefiGuid guid = new UefiGuid(guidData);
subType += guid.toString();
return subType;
}
/**
* Returns PIWG firmware file info.
* UEFI Specification, Version 2.8.
* PIWG Firmware Volume Section 10.3.5.7:
* Contents are defined in the UEFI PI Specification.
*
* @param path
* @param offset
* @return String that represents the PIWG Firmware Volume Path
*/
private String piwgFirmVolPath(final byte[] path, final int offset) {
subType = "PIWG Firmware Volume ";
byte[] guidData = new byte[UefiConstants.SIZE_16];
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData, 0, UefiConstants.SIZE_16);
UefiGuid guid = new UefiGuid(guidData);
subType += guid.toString();
return subType;
}
/**
* Returns a string that represents the UEFi Device path.
*
* @return UEFi Device path.
*/
public String toString() {
return devPathInfo;
}
/**
* Converts from a char array to byte array.
* Removes the upper byte (typically set to 0) of each char.
*
* @param data Character array.
* @return byte array.
*/
public static byte[] convertChar16tobyteArray(final byte[] data) {
byte[] hexdata = new byte[data.length];
int j = 0;
for (int i = 0; i < data.length; i = i + UefiConstants.SIZE_2) {
hexdata[j++] = data[i];
}
return hexdata;
}
}

View File

@ -0,0 +1,75 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import hirs.attestationca.portal.utils.HexUtils;
import lombok.Getter;
import java.math.BigInteger;
/**
* Class to process the PFP defined UEFI_PLATFORM_FIRMWARE_BLOB structure.
* <p>
* typedef struct tdUEFI_PLATFORM_FIRMWARE_BLOB {
* UEFI_PHYSICAL_ADDRESS BlobBase;
* UINT64 BlobLength;
* } UEFI_PLATFORM_FIRMWARE_BLOB;
*/
public class UefiFirmware {
private boolean bError = false;
/**
* byte array holding the firmwares physical address.
*/
private byte[] physicalAddress = null;
/**
* byte array holding the uefi address length.
*/
private byte[] addressLength = null;
/**
* uefi physical address.
*/
@Getter
private int physicalBlobAddress = 0;
/**
* uefi address length.
*/
@Getter
private int blobLength = 0;
/**
* UefiFirmware constructor.
*
* @param blob byte array holding a Firmware Blob.
*/
public UefiFirmware(final byte[] blob) {
if (blob.length != UefiConstants.SIZE_16) {
bError = true;
} else {
physicalAddress = new byte[UefiConstants.SIZE_8];
addressLength = new byte[UefiConstants.SIZE_8];
System.arraycopy(blob, 0, physicalAddress, 0, UefiConstants.SIZE_8);
System.arraycopy(blob, UefiConstants.SIZE_8, addressLength, 0, UefiConstants.SIZE_8);
byte[] lelength = HexUtils.leReverseByte(addressLength);
BigInteger bigIntLength = new BigInteger(lelength);
blobLength = bigIntLength.intValue();
byte[] leAddress = HexUtils.leReverseByte(physicalAddress);
BigInteger bigIntAddress = new BigInteger(leAddress);
physicalBlobAddress = bigIntAddress.intValue();
}
}
/**
* Returns a description of the firmware blobs location.
*
* @return a description of the the firmware blobs location.
*/
public String toString() {
StringBuilder blobInfo = new StringBuilder();
if (!bError) {
blobInfo.append(String.format(" Platform Firmware Blob Address = %s",
Integer.toHexString(physicalBlobAddress)));
blobInfo.append(String.format(" length = %d", blobLength));
} else {
blobInfo.append(" Invalid Firmware Blob event encountered");
}
return blobInfo.toString();
}
}

View File

@ -0,0 +1,193 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import com.eclipsesource.json.JsonObject;
import hirs.attestationca.portal.utils.HexUtils;
import hirs.attestationca.portal.utils.JsonUtils;
import java.math.BigInteger;
import java.nio.file.FileSystems;
import java.nio.file.Path;
import java.util.UUID;
/**
* Class to process GUID per the UEFI specification
* GUIDs are essentially UUID as defined by RFC-1422, however Microsoft refers to GUIDS.
*/
public class UefiGuid {
/**
* number of 100ns intervals since UUID Epoch.
*/
private static final long UUID_EPOCH_INTERVALS = 0x01b21dd213814000L;
/**
* used for conversion to uuid time.
*/
private static final int UUID_EPOCH_DIVISOR = 10000;
private static final Path JSON_PATH = FileSystems.getDefault().getPath("/opt",
"hirs", "default-properties", "vendor-table.json");
private JsonObject uefiVendorRef;
/**
* guid byte array.
*/
private byte[] guid;
/**
* UUID object.
*/
private UUID uuid;
/**
* UefiGUID constructor.
*
* @param guidBytes byte array holding a valid guid.
*/
public UefiGuid(final byte[] guidBytes) {
guid = new byte[UefiConstants.SIZE_16];
System.arraycopy(guidBytes, 0, guid, 0, UefiConstants.SIZE_16);
uuid = processGuid(guidBytes);
uefiVendorRef = JsonUtils.getSpecificJsonObject(JSON_PATH, "VendorTable");
}
/**
* UefiGUID constructor.
*
* @param guidBytes byte array holding a valid guid.
* @param vendorPathString string path for vendor
*/
public UefiGuid(final byte[] guidBytes, final Path vendorPathString) {
guid = new byte[UefiConstants.SIZE_16];
System.arraycopy(guidBytes, 0, guid, 0, UefiConstants.SIZE_16);
uuid = processGuid(guidBytes);
uefiVendorRef = JsonUtils.getSpecificJsonObject(vendorPathString,
"VendorTable");
}
/**
* Converts a GUID with a byte array to a RFC-1422 UUID object.
* Assumes a MS format and converts to Big Endian format used by most others , including Linux
* Matched uuids found in /sys/firmware/efi/efivars on Centos 7.
*/
private static UUID processGuid(final byte[] guid) {
byte[] msb1 = new byte[UefiConstants.SIZE_4];
System.arraycopy(guid, 0, msb1, 0, UefiConstants.SIZE_4);
byte[] msb1r = HexUtils.leReverseByte(msb1);
byte[] msb2 = new byte[UefiConstants.SIZE_4];
System.arraycopy(guid, UefiConstants.OFFSET_4, msb2, 0, UefiConstants.SIZE_4);
byte[] msb2r = HexUtils.leReverseByte(msb2);
byte[] msb2rs = new byte[UefiConstants.SIZE_4];
System.arraycopy(msb2r, 0, msb2rs, UefiConstants.OFFSET_2, UefiConstants.SIZE_2);
System.arraycopy(msb2r, UefiConstants.OFFSET_2, msb2rs, 0, UefiConstants.SIZE_2);
byte[] msbt = new byte[UefiConstants.SIZE_8];
System.arraycopy(msb1r, 0, msbt, 0, UefiConstants.SIZE_4);
System.arraycopy(msb2rs, 0, msbt, UefiConstants.OFFSET_4, UefiConstants.SIZE_4);
long msbl = new BigInteger(msbt).longValue();
byte[] lsb = new byte[UefiConstants.SIZE_8];
System.arraycopy(guid, UefiConstants.OFFSET_8, lsb, 0, UefiConstants.SIZE_8);
long lsbl = new BigInteger(lsb).longValue();
return new UUID(msbl, lsbl);
}
/**
* Returns the standard GUID length.
*
* @return guid length
*/
public static int getGuidLength() {
return UefiConstants.SIZE_16;
}
/**
* Returns a String that represents a specification name referenced by the
* EFI_CONFIGURATION_TABLE VendorGUID field. For structure of
* EFI_CONFIGURATION_TABLE type, the UEFI specification has set of GUIDs
* published that represent standards that one can find further information on
* the configuration table being referenced.
* Refer to section 4.6 of UEFI spec v 2.8, page 101.
*
* @return A String of major UUID parameters
*/
public String getVendorTableReference() {
return getVendorTableReference(uuid.toString().toLowerCase());
}
/**
* Returns a String that represents a specification name referenced by the
* EFI_CONFIGURATION_TABLE VendorGUID field. For structure of
* EFI_CONFIGURATION_TABLE type, the UEFI specification has set of GUIDs
* published that represent standards that one can find further
* information on the configuration table being referenced.
* Refer to section 4.6 of UEFI spec v 2.8, page 101.
*
* @param lookupValue specific value to look up
* @return A String of major UUID parameters
*/
public String getVendorTableReference(final String lookupValue) {
return uefiVendorRef.getString(lookupValue, "Unknown GUID reference");
}
/**
* Returns a string of the entity that the UUID represents.
* Contains a Vendor String lookup on the UUID.
*
* @return UUID description.
*/
public String toString() {
return String.format("%s : %s", uuid.toString(), getVendorTableReference());
}
/**
* Returns a string of the entity that the UUID represents.
* Does not contain a vendor lookup on the UUID.
*
* @return UUID description.
*/
public String toStringNoLookup() {
return uuid.toString();
}
/**
* Returns a string of the entity that the UUID represents.
* Does not contain a vendor lookup on the UUID.
*
* @param guid byte array holding the guid data.
* @return true if the UUID has a valid structure.
*/
public static boolean isValidUUID(final byte[] guid) {
boolean valid = false;
UUID tmpUuid = processGuid(guid);
if (tmpUuid.toString().length() != 0) {
valid = true;
}
return valid;
}
/**
* Checks to see if the uuid is the test or Empty UUID ("00000000-0000-0000-0000-000000000000").
*
* @return true if the uuid is the Empty UUID, false if not
*/
public boolean isEmptyUUID() {
return uuid.toString().equals("00000000-0000-0000-0000-000000000000");
}
/**
* Checks to see if the uuid is the Empty UUID or an unknown.
*
* @return true if the uuid is the Empty UUID, false if not
*/
public boolean isUnknownUUID() {
if (getVendorTableReference().equals("Unknown GUID reference")) {
return true;
}
return false;
}
/**
* Retrieves the timestamp within a time based GUID.
*
* @param uuid uuid object
* @return long representing the time stamp from the GUID
*/
public long getTimeFromUUID(final UUID uuid) {
return (uuid.timestamp() - UUID_EPOCH_INTERVALS) / UUID_EPOCH_DIVISOR;
}
}

View File

@ -0,0 +1,93 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import hirs.attestationca.portal.utils.HexUtils;
import lombok.Getter;
import java.nio.charset.StandardCharsets;
/**
* Class to process EFI Partitions for EFI Partition tables defined in UEFI section 5.3.3
* typedef struct {
* EFI_GUID PartitionTypeGUID;
* EFI_GUID UniquePartitionGUID;
* EFI_LBA StartingLBA; // Same as UINT64.
* EFI_LBA EndingLBA;
* UINT64 Attributes;
* CHAR16 PartitionName[36]; // 36 CHAR16 = 72 Bytes
* } EFI_PARTITION_ENTRY;
* <p>
* UEFI Table 23. Defined GPT Partition Entry - Partition Type GUIDs (implemented in EFIGui.java)
* Examples:
* Unused Entry 00000000-0000-0000-0000-000000000000
* EFI System Partition C12A7328-F81F-11D2-BA4B-00A0C93EC93B
* Partition containing a legacy MBR 024DEE41-33E7-11D3-9D69-0008C781F39F
* Linux filesystem data 0FC63DAF-8483-4772-8E79-3D69D8477DE4
* Logical Volume Manager (LVM) partition E6D6D379-F507-44C2-A23C-238F2A3DF928
* Plain dm-crypt partition 7FFEC5C9-2D00-49B7-8941-3EA10A5586B7
* Root partition (x86-64) 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709
* RAID partition A19D880F-05FC-4D3B-A006-743F0F84911E
* LUKS partition CA7D7CCB-63ED-4C53-861C-1742536059CC
* <p>
* linux commands to check uuids:
* blkid list //unique parition guids
* ls /dev/disk/by-partuuid
*/
@Getter
public class UefiPartition {
private UefiGuid partitionTypeGUID = null;
private UefiGuid uniquePartitionGUID = null;
private String partitionName = "";
private String attributes = "";
/**
* Processes a UEFI defined partition entry.
*
* @param table byte array holding the partition table.
*/
public UefiPartition(final byte[] table) {
byte[] partitionGuidBytes = new byte[UefiConstants.SIZE_16];
System.arraycopy(table, 0, partitionGuidBytes, 0, UefiConstants.SIZE_16);
partitionTypeGUID = new UefiGuid(partitionGuidBytes);
byte[] uniquePartGuidBytes = new byte[UefiConstants.SIZE_16];
System.arraycopy(table, UefiConstants.SIZE_16, uniquePartGuidBytes, 0, UefiConstants.SIZE_16);
uniquePartitionGUID = new UefiGuid(uniquePartGuidBytes);
byte[] attributeBytes = new byte[UefiConstants.SIZE_8];
System.arraycopy(table, UefiConstants.ATTRIBUTE_LENGTH, attributeBytes,
0, UefiConstants.SIZE_8);
attributes = HexUtils.byteArrayToHexString(attributeBytes);
byte[] partitionNameBytes = new byte[UefiConstants.UEFI_PT_LENGTH];
System.arraycopy(table, UefiConstants.PART_NAME_LENGTH, partitionNameBytes,
0, UefiConstants.UEFI_PT_LENGTH);
byte[] pName = convertChar16tobyteArray(partitionNameBytes);
partitionName = new String(pName, StandardCharsets.UTF_8).trim();
}
/**
* Returns a description of the partition.
*
* @return partition description.
*/
public String toString() {
String partitionInfo = "";
partitionInfo += " Partition Name : " + partitionName + "\n";
partitionInfo += " Partition Type GUID : " + partitionTypeGUID.toString() + "\n";
partitionInfo += " Unique Partition GUID : " + uniquePartitionGUID.toStringNoLookup() + "\n";
partitionInfo += " Attributes : " + attributes;
return partitionInfo;
}
/**
* Copies character array to a byte by removing upper byte of character array.
*
* @param data input char array
* @return byte array
*/
private byte[] convertChar16tobyteArray(final byte[] data) {
byte[] hexdata = new byte[data.length];
int j = 0;
for (int i = 0; i < data.length; i += 2) {
hexdata[j++] = data[i];
}
return hexdata;
}
}

View File

@ -0,0 +1,57 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import lombok.Getter;
import java.math.BigInteger;
/**
* Class that processes the UEFI defined SecureBoot Variable.
* Currently this variable only specifies if SecureBoot is on/off.
*/
public class UefiSecureBoot {
/**
* Variable value.
*/
@Getter
private int secureBootVariable = 0;
/**
* Error flag.
*/
private boolean berror = false;
/**
* Human readable description.
*/
private String info = "";
/**
* Constructor to process the EFI Secure Boot Variable.
*
* @param data UEFI variable data.
*/
public UefiSecureBoot(final byte[] data) {
if (data.length == 0) {
berror = true;
info = "Unknown State: Empty Secure Boot variable\n";
} else {
secureBootVariable = new BigInteger(data).intValue();
}
}
/**
* Provides a human readable value for the Secure Boot variable.
*
* @return Human readable description.
*/
public String toString() {
if (!berror) {
if (secureBootVariable == 1) {
info += " Secure Boot is enabled ";
} else if (secureBootVariable == 0) {
info += " Secure Boot is NOT enabled ";
} else {
info += " Unkown State: Secure Variable is undefined ";
}
}
return info;
}
}

View File

@ -0,0 +1,172 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import hirs.attestationca.portal.utils.HexUtils;
import lombok.Getter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
/**
* Class for processing the contents of a Secure Boot DB or DBX contents.
* used for EFIVariables associated with Secure Boot
* as defined by Section 32.4.1 Signature Database from the UEFI 2.8 specification
* <p>
* typedef struct _EFI_SIGNATURE_DATA {
* EFI_GUID SignatureOwner;
* UINT8 SignatureData[...];
* } EFI_SIGNATURE_DATA;
* <p>
* However page 1729 0f UEFI 2.8 implies that SignatureListType of EFI_CERT_SHA256_GUID
* will contain the "the SHA-256 hash of the binary".
* So the Signature Data depends upon the Signature Type from the EFI Signature List.
*/
public class UefiSignatureData {
/**
* UEFI Certificate GUID.
*/
private byte[] guid = new byte[UefiConstants.SIZE_16];
/**
* UEFI Signature data.
*/
private byte[] sigData = null;
/**
* UEFI Certificate object .
*/
@Getter
private UefiX509Cert cert = null;
/**
* UEFI Certificate GUID.
*/
@Getter
private UefiGuid efiVarGuid = null;
/**
* UEFI Signature type.
*/
@Getter
private UefiGuid signatureType = null;
/**
* UEFI Signature validity.
*/
@Getter
private boolean valid = false;
/**
* UEFI Certificate SHA1 hash.
*/
private byte[] binaryHash = new byte[UefiConstants.SIZE_40];
/**
* UEFI Signature data status.
*/
@Getter
private String status = "Signature Data contains a valid Certificate";
/**
* UefiSignatureData constructor.
*
* @param inputStream The Signature data.
* @param sigType UEFI defined signature type.
* @throws java.io.IOException if there's an problem reading the input stream.
* @throws java.security.cert.CertificateException If there a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
*/
UefiSignatureData(final ByteArrayInputStream inputStream, final UefiGuid sigType)
throws IOException, CertificateException, NoSuchAlgorithmException {
signatureType = sigType;
// UEFI spec section 32.5.3.3 states that SignatureListType of EFI_CERT_SHA256_GUID
// only contains a hash, not a cert
if (sigType.getVendorTableReference().equals("EFI_CERT_SHA256_GUID")) {
inputStream.read(guid);
efiVarGuid = new UefiGuid(guid);
// Should be a SHA256 hash of the "binary"
inputStream.read(binaryHash);
} else if (sigType.getVendorTableReference().equals("EFI_CERT_X509_GUID")) {
inputStream.read(guid);
efiVarGuid = new UefiGuid(guid);
// Read in Type and Length separately so we calculate the rest of the cert size
byte[] certType = new byte[UefiConstants.SIZE_2];
inputStream.read(certType);
byte[] certLength = new byte[UefiConstants.SIZE_2];
inputStream.read(certLength);
int cLength = new BigInteger(certLength).intValue() + UefiConstants.SIZE_4;
byte[] certData = new byte[cLength];
inputStream.read(certData);
// put the cert back together
byte[] certBlob = new byte[cLength + UefiConstants.SIZE_4];
System.arraycopy(certType, 0, certBlob, 0, UefiConstants.SIZE_2);
System.arraycopy(certLength, 0, certBlob, UefiConstants.OFFSET_2, UefiConstants.SIZE_2);
System.arraycopy(certData, 0, certBlob, UefiConstants.OFFSET_4, cLength);
cert = new UefiX509Cert(certBlob);
} else if (sigType.isUnknownUUID()) {
//status = "Signature List Type has an unknown GUID: " + efiGuid.toString();
status = "Signature List Type has an unknown GUID";
return;
} else { // else process as a cert (RH SHIM does this)
processC509Cert(inputStream);
efiVarGuid = sigType;
}
valid = true;
}
/**
* Default EFISignatureData Constructor.
*
* @param data byte array of the EFISignatureData to process
* @throws java.security.cert.CertificateException If there a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
*/
UefiSignatureData(final byte[] data) throws CertificateException, NoSuchAlgorithmException {
System.arraycopy(data, 0, guid, 0, UefiConstants.SIZE_16);
sigData = new byte[data.length - UefiConstants.SIZE_16];
System.arraycopy(data, UefiConstants.OFFSET_16, sigData, 0, data.length - UefiConstants.SIZE_16);
cert = new UefiX509Cert(sigData);
efiVarGuid = new UefiGuid(guid);
}
/**
* Processes an x509 Cert used by secure DB or DBx.
*
* @param inputStream x509 certificate data.
* @throws java.io.IOException is there's a problem reading the data.
* @throws java.security.cert.CertificateException if there's a problem parsing the certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem creating a hash.
*/
private void processC509Cert(final ByteArrayInputStream inputStream)
throws IOException, CertificateException, NoSuchAlgorithmException {
byte[] certType = new byte[UefiConstants.SIZE_2];
inputStream.read(certType);
byte[] certLength = new byte[UefiConstants.SIZE_2];
inputStream.read(certLength);
int cLength = new BigInteger(certLength).intValue() + UefiConstants.SIZE_4;
byte[] certData = new byte[cLength];
inputStream.read(certData);
// put the cert back together
byte[] certBlob = new byte[cLength + UefiConstants.SIZE_4];
System.arraycopy(certType, 0, certBlob, 0, 2);
System.arraycopy(certLength, 0, certBlob, 2, 2);
System.arraycopy(certData, 0, certBlob, UefiConstants.OFFSET_4, cLength);
cert = new UefiX509Cert(certBlob);
}
/**
* Provides a description of the fields within the EFI Signature Data.
*
* @return X509Cert human readable description.
*/
public String toString() {
String sigInfo = "";
if (!valid) {
sigInfo = status;
} else {
if (signatureType.getVendorTableReference().equals("EFI_CERT_SHA256_GUID")) {
sigInfo += "UEFI Signature Owner = " + efiVarGuid.toString() + "\n";
sigInfo += " Binary Hash = " + HexUtils.byteArrayToHexString(binaryHash) + "\n";
} else {
sigInfo += "UEFI Signature Owner = " + efiVarGuid.toString() + "\n";
sigInfo += cert.toString();
}
}
return sigInfo;
}
}

View File

@ -0,0 +1,225 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import hirs.attestationca.portal.utils.HexUtils;
import lombok.Getter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
/**
* Class for processing the contents of a Secure Boot DB or DBX contents.
* used for EFIVariables associated with Secure Boot
* as defined by Section 32.4.1 Signature Database from the UEFI 2.8 specification.
* <p>
* An EFI Signature List is actual a list of Certificates used to verify a Signature.
* This is mainly found in PCR[7] UEFI variables for the Secure Boot PK, KEK, Db and DBx variables.
* <p>
* typedef struct _EFI_SIGNATURE_LIST {
* EFI_GUID SignatureType;
* UINT32 SignatureListSize;
* UINT32 SignatureHeaderSize;
* UINT32 SignatureSize;
* // UINT8 SignatureHeader[SignatureHeaderSize];
* // EFI_SIGNATURE_DATA Signatures[...][SignatureSize];
* } EFI_SIGNATURE_LIST;
*/
public class UefiSignatureList {
/**
* Size of the signature list.
*/
private int listSize = 0;
/**
* Size of a signature.
*/
private int signatureSize = 0;
/**
* Signature data.
*/
private byte[] sigData = null;
/**
* Number of Items in the list.
*/
@Getter
private int numberOfCerts = 0;
/**
* Signature validity.
*/
private boolean valid = true;
/**
* Current status.
*/
private String status = "Signature List is Valid";
/**
* Array List of Signature found in the list.
*/
private ArrayList<UefiSignatureData> sigList = new ArrayList<UefiSignatureData>();
/**
* Input Stream for processing.
*/
private ByteArrayInputStream efiSigDataIS = null;
/**
* Type of signature.
*/
private UefiGuid signatureType = null;
/**
* UefiSignatureList constructor.
*
* @param list byte array holding the signature list.
* @throws java.security.cert.CertificateException If there a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
* @throws java.io.IOException If there's a problem parsing the signature data.
*/
UefiSignatureList(final byte[] list)
throws CertificateException, NoSuchAlgorithmException, IOException {
byte[] guid = new byte[UefiConstants.SIZE_16];
System.arraycopy(list, 0, guid, 0, UefiConstants.SIZE_16);
signatureType = new UefiGuid(guid);
byte[] lSize = new byte[UefiConstants.SIZE_4];
System.arraycopy(list, UefiConstants.OFFSET_16, lSize, 0, UefiConstants.SIZE_4);
listSize = HexUtils.leReverseInt(lSize);
byte[] hSize = new byte[UefiConstants.SIZE_4];
System.arraycopy(list, UefiConstants.OFFSET_20, hSize, 0, UefiConstants.SIZE_4);
byte[] sSize = new byte[UefiConstants.SIZE_4];
System.arraycopy(list, UefiConstants.OFFSET_24, sSize, 0, UefiConstants.SIZE_4);
signatureSize = HexUtils.leReverseInt(sSize);
sigData = new byte[signatureSize];
System.arraycopy(list, UefiConstants.OFFSET_28, sigData, 0, signatureSize);
processSignatureList(sigData);
}
/**
* EFI Signature list constructor.
*
* @param lists ByteArrayInputStream containing an EFI Signature list.
* @throws java.io.IOException If there's a problem in reading he input stream.
* @throws java.security.cert.CertificateException If there's a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
*/
UefiSignatureList(final ByteArrayInputStream lists)
throws IOException, CertificateException, NoSuchAlgorithmException {
byte[] guid = new byte[UefiConstants.SIZE_16];
lists.read(guid);
signatureType = new UefiGuid(guid);
if (!isValidSigListGUID(signatureType)) {
processSignatureData(lists);
} else { // valid SigData Processing
byte[] lSize = new byte[UefiConstants.SIZE_4];
lists.read(lSize);
listSize = HexUtils.leReverseInt(lSize);
byte[] hSize = new byte[UefiConstants.SIZE_4];
lists.read(hSize);
byte[] sSize = new byte[UefiConstants.SIZE_4];
lists.read(sSize);
signatureSize = listSize - UefiConstants.SIZE_28;
sigData = new byte[signatureSize];
lists.read(sigData);
processSignatureList(sigData);
}
}
/**
* Method for processing a set of EFI SignatureList(s).
*
* @param efiSigData Byte array holding one or more SignatureLists
* @throws java.security.cert.CertificateException If there's a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
* @throws java.io.IOException If there's a problem parsing the signature data.
*/
private void processSignatureList(final byte[] efiSigData)
throws CertificateException, NoSuchAlgorithmException, IOException {
efiSigDataIS = new ByteArrayInputStream(efiSigData);
while (efiSigDataIS.available() > 0) {
UefiSignatureData tmpSigData = new UefiSignatureData(efiSigDataIS, signatureType);
if (!tmpSigData.isValid()) {
valid = false;
status = tmpSigData.getStatus();
break;
}
sigList.add(tmpSigData);
numberOfCerts++;
}
}
/**
* Method for processing a set of EFI SignatureList(s).
*
* @param sigDataIS Byte array holding one or more SignatureLists.
* @throws java.security.cert.CertificateException If there's a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
* @throws java.io.IOException If there's a problem parsing the signature data.
*/
private void processSignatureData(final ByteArrayInputStream sigDataIS)
throws CertificateException, NoSuchAlgorithmException, IOException {
while (sigDataIS.available() > 0) {
UefiSignatureData tmpigData = new UefiSignatureData(sigDataIS, signatureType);
if (!tmpigData.isValid()) {
valid = false;
status = tmpigData.getStatus();
break;
}
sigList.add(tmpigData);
numberOfCerts++;
}
}
/**
* Returns an ArrayList of EFISignatureData objects.
*
* @return ArrayList of EFISignatureData objects.
*/
public ArrayList<UefiSignatureData> getSignatureDataList() {
return sigList;
}
/**
* Checks to see if GUID is listed on page 1729 of UEFI spec version 2.8.
*
* @param guid GUID of the has algorithm.
* @return true if the GUID is a valid GUID for Signature List Type, false if not.
*/
public boolean isValidSigListGUID(final UefiGuid guid) {
switch (guid.getVendorTableReference()) {
case "EFI_CERT_SHA256_GUID":
case "EFI_CERT_X509_SHA256":
case "EFI_CERT_X509_SHA384":
case "EFI_CERT_X509_SHA512":
case "EFI_CERT_X509_GUID":
return true;
default:
return false;
}
}
/**
* Provides a description of the fields within the EFI Signature Data field.
* Which is essentially a list of X509 certificates.
*
* @return human readable description.
*/
public String toString() {
StringBuilder sigInfo = new StringBuilder();
sigInfo.append("UEFI Signature List Type = " + signatureType.toString() + "\n");
sigInfo.append("Number if items = " + numberOfCerts + "\n");
sigList.iterator();
for (int i = 0; i < sigList.size(); i++) {
UefiSignatureData certData = sigList.get(i);
sigInfo.append(certData.toString());
}
if (!valid) {
sigInfo.append("*** Invalid UEFI Signature data encountered: " + status + "\n");
}
return sigInfo.toString();
}
}

View File

@ -0,0 +1,204 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import hirs.attestationca.portal.utils.HexUtils;
import lombok.Getter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
/**
* Class to process a UEFI variable within a TPM Event.
* typedef struct tdUEFI_VARIABLE_DATA{
* UEFI_GUID VariableName; (16 bytes)
* UINT64 UnicodeNameLength; (8 bytes)
* UINT64 VariableDataLength; (8 bytes)
* CHAR16 UnicodeName[];
* INT8 VariableData[];
* } UEFI_VARIABLE_DATA
*/
public class UefiVariable {
/**
* UEFI defined variable identifier GUID.
*/
@Getter
private UefiGuid uefiVarGuid = null;
/**
* List of Signature lists.
*/
@Getter
private ArrayList<UefiSignatureList> certSuperList = new ArrayList<>();
/**
* Name of the UEFI variable.
*/
@Getter
private String efiVarName = "";
/**
* UEFI defined Boot Variable.
*/
private UefiBootVariable bootv = null;
/**
* UEFI Defined boot order.
*/
private UefiBootOrder booto = null;
/**
* UEFI defined secure boot.
*/
private UefiSecureBoot sb = null;
/**
* UEFI variable data.
*/
private byte[] uefiVariableData = null;
/**
* EFIVariable constructor.
* The UEFI_VARIABLE_DATA contains a "VariableName" field which is used to determine
* the class used to parse the data within the "VariableData".
*
* @param variableData byte array holding the UEFI Variable.
* @throws java.security.cert.CertificateException If there a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
* @throws java.io.IOException If there's a problem parsing the signature data.
*/
public UefiVariable(final byte[] variableData)
throws CertificateException, NoSuchAlgorithmException, IOException {
byte[] guid = new byte[UefiConstants.SIZE_16];
byte[] nameLength = new byte[UefiConstants.SIZE_8];
byte[] nameTemp = null;
byte[] dataLength = new byte[UefiConstants.SIZE_8];
byte[] name = null;
int variableLength = 0;
System.arraycopy(variableData, 0, guid, 0, UefiConstants.SIZE_16);
uefiVarGuid = new UefiGuid(guid);
System.arraycopy(variableData, UefiConstants.SIZE_16, nameLength, 0, UefiConstants.SIZE_8);
int nlength = HexUtils.leReverseInt(nameLength);
System.arraycopy(variableData, UefiConstants.OFFSET_24, dataLength, 0, UefiConstants.SIZE_8);
nameTemp = new byte[nlength * UefiConstants.SIZE_2];
System.arraycopy(variableData, UefiConstants.OFFSET_32,
nameTemp, 0, nlength * UefiConstants.SIZE_2);
byte[] name1 = UefiDevicePath.convertChar16tobyteArray(nameTemp);
name = new byte[nlength];
System.arraycopy(name1, 0, name, 0, nlength);
variableLength = HexUtils.leReverseInt(dataLength);
uefiVariableData = new byte[variableLength];
System.arraycopy(variableData, UefiConstants.OFFSET_32
+ nlength * UefiConstants.SIZE_2, uefiVariableData, 0, variableLength);
efiVarName = new String(name, StandardCharsets.UTF_8);
String tmpName = efiVarName;
if (efiVarName.contains("Boot00")) {
tmpName = "Boot00";
}
switch (tmpName) {
case "PK":
case "KEK":
case "db":
case "dbx":
processSigList(uefiVariableData);
break;
case "Boot00":
bootv = new UefiBootVariable(uefiVariableData);
break;
case "BootOrder":
booto = new UefiBootOrder(uefiVariableData);
break;
case "SecureBoot":
sb = new UefiSecureBoot(uefiVariableData);
break;
default:
}
}
/**
* Processes the data as a UEFI defined Signature List.
*
* @param data the bye array holding the Signature List.
* @throws java.security.cert.CertificateException If there a problem parsing the X509 certificate.
* @throws java.security.NoSuchAlgorithmException if there's a problem hashing the certificate.
* @throws java.io.IOException If there's a problem parsing the signature data.
*/
private void processSigList(final byte[] data)
throws CertificateException, NoSuchAlgorithmException, IOException {
ByteArrayInputStream certData = new ByteArrayInputStream(data);
while (certData.available() > 0) {
UefiSignatureList list;
list = new UefiSignatureList(certData);
certSuperList.add(list);
}
}
/**
* Print out all the interesting characteristics available on this UEFI Variable.
*
* @return human readable description of the UEFi variable.
*/
public String toString() {
StringBuilder efiVariable = new StringBuilder();
efiVariable.append("UEFI Variable Name:" + efiVarName + "\n");
efiVariable.append("UEFI_GUID = " + uefiVarGuid.toString() + "\n ");
if (efiVarName != "") {
efiVariable.append("UEFI Variable Contents => " + "\n ");
}
String tmpName = efiVarName;
if (efiVarName.contains("Boot00")) {
tmpName = "Boot00";
} else {
tmpName = efiVarName;
}
switch (tmpName) {
case "Shim":
case "MokList":
efiVariable.append(printCert(uefiVariableData, 0));
break;
case "Boot00":
efiVariable.append(bootv.toString());
break;
case "BootOrder":
efiVariable.append(booto.toString());
break;
case "SecureBoot":
efiVariable.append(sb.toString());
break;
default:
if (!tmpName.isEmpty()) {
efiVariable.append(String.format("Data not provided for UEFI variable named %s ",
tmpName));
} else {
efiVariable.append("Data not provided ");
}
}
for (int i = 0; i < certSuperList.size(); i++) {
efiVariable.append(certSuperList.get(i).toString());
}
return efiVariable.toString();
}
/**
* Retrieves human readable description from a Certificate.
*
* @param data byte[] holding the certificate.
* @param offset offset to start of the certificate within the byte array.
* @return human readable description of a certificate.
*/
public String printCert(final byte[] data, final int offset) {
String certInfo = "";
byte[] certLength = new byte[UefiConstants.SIZE_2];
System.arraycopy(data, offset + UefiConstants.OFFSET_2, certLength, 0, UefiConstants.SIZE_2);
int cLength = new BigInteger(certLength).intValue() + UefiConstants.SIZE_4;
byte[] certData = new byte[cLength];
System.arraycopy(data, offset, certData, 0, cLength);
try {
UefiX509Cert cert = new UefiX509Cert(certData);
certInfo = cert.toString();
} catch (Exception e) {
certInfo = "Error Processing Certificate : " + e.getMessage();
}
return (certInfo);
}
}

View File

@ -0,0 +1,92 @@
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;
import jakarta.xml.bind.DatatypeConverter;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateEncodingException;
import java.security.cert.CertificateException;
import java.security.cert.CertificateFactory;
import java.security.cert.X509Certificate;
/**
* Class for processing a Secure Boot certificate stored in the UEFI DB or DBX.
* X509 certs are used by Secure Boot for validating EFI files.
*/
public class UefiX509Cert {
/**
* Certificate object .
*/
private java.security.cert.Certificate cert = null;
/**
* Constructor for the certificate.
*
* @param certData byte array holding the certificate.
* @throws java.security.cert.CertificateException If the certificate cannot parse.
* @throws java.security.NoSuchAlgorithmException if a hash cannot be generated from the cert.
*/
public UefiX509Cert(final byte[] certData) throws CertificateException, NoSuchAlgorithmException {
CertificateFactory cf;
cf = CertificateFactory.getInstance("X.509");
InputStream targetStream = new ByteArrayInputStream(certData);
cert = cf.generateCertificate(targetStream);
MessageDigest md = MessageDigest.getInstance("SHA1");
md.update(certData);
}
/**
* Finds the byte length of the certificate.
*
* @return the certificate length.
* @throws java.security.cert.CertificateEncodingException if the certificate failed to parse.
*/
public int getLength() throws CertificateEncodingException {
int length = 0;
X509Certificate x509Cert = (X509Certificate) cert;
length = x509Cert.getEncoded().length;
return length;
}
/**
* Calculates the fingerprint per Microsoft's specs using SHA1 and colon based notation.
* e.g. "44:d6:41:ca:ca:08:09:00:23:98:b4:87:7b:8e:98:2e:d2:6f:7b:76"
*
* @return a string representation of the certificate fingerprint
*/
public String getSHA1FingerPrint() {
byte[] der = null;
MessageDigest md = null;
try {
md = MessageDigest.getInstance("SHA-1");
der = cert.getEncoded();
} catch (Exception e) {
return ("Error creating Certificate Fingerprint: " + e.getMessage());
}
md.update(der);
byte[] digest = md.digest();
String digestHex = DatatypeConverter.printHexBinary(digest);
digestHex = digestHex.replaceAll("..(?!$)", "$0:"); // places : every 2 digits
return digestHex.toLowerCase();
}
/**
* Provides a Sting of select fields of the Certificate data.
*
* @return A string detailing select fields of the certificate.
*/
public String toString() {
X509Certificate x509Cert = (X509Certificate) cert;
String certData = "";
certData += " Certificate Serial Number = "
+ x509Cert.getSerialNumber().toString(UefiConstants.SIZE_16) + "\n";
certData += " Subject DN = " + x509Cert.getSubjectDN() + "\n";
certData += " Issuer DN = " + x509Cert.getIssuerDN() + "\n";
certData += " Not Before Date = " + x509Cert.getNotBefore() + "\n";
certData += " Not After Date = " + x509Cert.getNotAfter() + "\n";
certData += " Signature Algorithm = " + x509Cert.getSigAlgName() + "\n";
certData += " SHA1 Fingerprint = " + getSHA1FingerPrint() + "\n";
return certData;
}
}

View File

@ -0,0 +1,6 @@
/**
* Non-persistant classes related to TGC Event Logs.
*/
package hirs.attestationca.portal.utils.tpm.eventlog.uefi;

View File

@ -0,0 +1,6 @@
/**
* Non-persistant classes related to TPM.
*/
package hirs.attestationca.portal.utils.tpm;

View File

@ -0,0 +1,104 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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
*
*
* <p>Java class for BaseElement complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="BaseElement">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;attribute ref="{http://www.w3.org/XML/1998/namespace}lang"/>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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<QName, String> otherAttributes = new HashMap<QName, String>();
/**
*
* 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.
*
* <p>
* 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<QName, String> getOtherAttributes() {
return otherAttributes;
}
}

View File

@ -0,0 +1,109 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for CanonicalizationMethodType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="CanonicalizationMethodType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CanonicalizationMethodType", propOrder = {
"content"
})
public class CanonicalizationMethodType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
/**
* Gets the value of the content property.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
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;
}
}

View File

@ -0,0 +1,227 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for DSAKeyValueType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="DSAKeyValueType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;sequence minOccurs="0">
* &lt;element name="P" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
* &lt;element name="Q" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
* &lt;/sequence>
* &lt;element name="G" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary" minOccurs="0"/>
* &lt;element name="Y" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
* &lt;element name="J" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary" minOccurs="0"/>
* &lt;sequence minOccurs="0">
* &lt;element name="Seed" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
* &lt;element name="PgenCounter" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
* &lt;/sequence>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,111 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for DigestMethodType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="DigestMethodType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DigestMethodType", propOrder = {
"content"
})
public class DigestMethodType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
/**
* Gets the value of the content property.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
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;
}
}

View File

@ -0,0 +1,86 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.utils.xjc;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElements;
import jakarta.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for Directory complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Directory">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}FilesystemItem">
* &lt;choice maxOccurs="unbounded" minOccurs="0">
* &lt;element name="Directory" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Directory"/>
* &lt;element name="File" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}File"/>
* &lt;/choice>
* &lt;anyAttribute processContents='lax'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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", type = Directory.class),
@XmlElement(name = "File", type = File.class)
})
protected List<FilesystemItem> directoryOrFile;
/**
* Gets the value of the directoryOrFile property.
*
* <p>
* 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 <CODE>set</CODE> method for the directoryOrFile property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDirectoryOrFile().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Directory }
* {@link File }
*
*
*/
public List<FilesystemItem> getDirectoryOrFile() {
if (directoryOrFile == null) {
directoryOrFile = new ArrayList<FilesystemItem>();
}
return this.directoryOrFile;
}
}

View File

@ -0,0 +1,200 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for Entity complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Entity">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
* &lt;sequence maxOccurs="unbounded" minOccurs="0">
* &lt;element name="Meta" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta"/>
* &lt;/sequence>
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="regid" type="{http://www.w3.org/2001/XMLSchema}anyURI" default="http://invalid.unavailable" />
* &lt;attribute name="role" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKENS" />
* &lt;attribute name="thumbprint" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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> 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<String> role;
@XmlAttribute(name = "thumbprint")
protected String thumbprint;
/**
* Gets the value of the meta property.
*
* <p>
* 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 <CODE>set</CODE> method for the meta property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getMeta().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Meta }
*
*
*/
public List<Meta> getMeta() {
if (meta == null) {
meta = new ArrayList<Meta>();
}
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.
*
* <p>
* 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 <CODE>set</CODE> method for the role property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getRole().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link String }
*
*
*/
public List<String> getRole() {
if (role == null) {
role = new ArrayList<String>();
}
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;
}
}

View File

@ -0,0 +1,98 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for Evidence complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Evidence">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}ResourceCollection">
* &lt;attribute name="date" type="{http://www.w3.org/2001/XMLSchema}dateTime" />
* &lt;attribute name="deviceId" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,96 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for File complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="File">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}FilesystemItem">
* &lt;attribute name="size" type="{http://www.w3.org/2001/XMLSchema}integer" />
* &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,154 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for FilesystemItem complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="FilesystemItem">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
* &lt;attribute name="key" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="location" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="root" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,142 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for KeyInfoType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="KeyInfoType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;choice maxOccurs="unbounded">
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}KeyName"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}KeyValue"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}RetrievalMethod"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}X509Data"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}PGPData"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}SPKIData"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}MgmtData"/>
* &lt;any processContents='lax' namespace='##other'/>
* &lt;/choice>
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyInfoType", propOrder = {
"content"
})
public class KeyInfoType {
@XmlElementRefs({
@XmlElementRef(name = "KeyValue", 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 = "MgmtData", 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 = "SPKIData", 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 = "RetrievalMethod", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false)
})
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@XmlAttribute(name = "Id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
/**
* Gets the value of the content property.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link KeyValueType }{@code >}
* {@link JAXBElement }{@code <}{@link X509DataType }{@code >}
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link String }
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link Object }
* {@link JAXBElement }{@code <}{@link SPKIDataType }{@code >}
* {@link Element }
* {@link JAXBElement }{@code <}{@link PGPDataType }{@code >}
* {@link JAXBElement }{@code <}{@link RetrievalMethodType }{@code >}
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
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;
}
}

View File

@ -0,0 +1,92 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for KeyValueType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="KeyValueType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;choice>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}DSAKeyValue"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}RSAKeyValue"/>
* &lt;any processContents='lax' namespace='##other'/>
* &lt;/choice>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyValueType", propOrder = {
"content"
})
public class KeyValueType {
@XmlElementRefs({
@XmlElementRef(name = "DSAKeyValue", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false),
@XmlElementRef(name = "RSAKeyValue", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false)
})
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
/**
* Gets the value of the content property.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link RSAKeyValueType }{@code >}
* {@link Element }
* {@link String }
* {@link JAXBElement }{@code <}{@link DSAKeyValueType }{@code >}
* {@link Object }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
}
}

View File

@ -0,0 +1,236 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for Link complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Link">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
* &lt;attribute name="artifact" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="href" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;attribute name="media" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Media" />
* &lt;attribute name="ownership" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Ownership" />
* &lt;attribute name="rel" use="required" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" />
* &lt;attribute name="type" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}MediaType" />
* &lt;attribute name="use" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Use" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,111 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for ManifestType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ManifestType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Reference" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ManifestType", propOrder = {
"reference"
})
public class ManifestType {
@XmlElement(name = "Reference", required = true)
protected List<ReferenceType> reference;
@XmlAttribute(name = "Id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
/**
* Gets the value of the reference property.
*
* <p>
* 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 <CODE>set</CODE> method for the reference property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReference().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ReferenceType }
*
*
*/
public List<ReferenceType> getReference() {
if (reference == null) {
reference = new ArrayList<ReferenceType>();
}
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;
}
}

View File

@ -0,0 +1,47 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for Meta complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Meta">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
* &lt;anyAttribute processContents='lax'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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
{
}

View File

@ -0,0 +1,723 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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.attestationca.portal.utils.xjc package.
* <p>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 _SPKIDataTypeSPKISexp_QNAME = new QName("http://www.w3.org/2000/09/xmldsig#", "SPKISexp");
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 _TransformTypeXPath_QNAME = new QName("http://www.w3.org/2000/09/xmldsig#", "XPath");
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");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: hirs.attestationca.portal.utils.xjc
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link SoftwareIdentity }
*
*/
public SoftwareIdentity createSoftwareIdentity() {
return new SoftwareIdentity();
}
/**
* Create an instance of {@link SoftwareMeta }
*
*/
public SoftwareMeta createSoftwareMeta() {
return new SoftwareMeta();
}
/**
* Create an instance of {@link Entity }
*
*/
public Entity createEntity() {
return new Entity();
}
/**
* Create an instance of {@link Meta }
*
*/
public Meta createMeta() {
return new Meta();
}
/**
* Create an instance of {@link FilesystemItem }
*
*/
public FilesystemItem createFilesystemItem() {
return new FilesystemItem();
}
/**
* Create an instance of {@link Resource }
*
*/
public Resource createResource() {
return new Resource();
}
/**
* Create an instance of {@link Process }
*
*/
public Process createProcess() {
return new Process();
}
/**
* Create an instance of {@link BaseElement }
*
*/
public BaseElement createBaseElement() {
return new BaseElement();
}
/**
* Create an instance of {@link Evidence }
*
*/
public Evidence createEvidence() {
return new Evidence();
}
/**
* Create an instance of {@link File }
*
*/
public File createFile() {
return new File();
}
/**
* Create an instance of {@link Link }
*
*/
public Link createLink() {
return new Link();
}
/**
* Create an instance of {@link Directory }
*
*/
public Directory createDirectory() {
return new Directory();
}
/**
* Create an instance of {@link ResourceCollection }
*
*/
public ResourceCollection createResourceCollection() {
return new ResourceCollection();
}
/**
* Create an instance of {@link PGPDataType }
*
*/
public PGPDataType createPGPDataType() {
return new PGPDataType();
}
/**
* Create an instance of {@link KeyValueType }
*
*/
public KeyValueType createKeyValueType() {
return new KeyValueType();
}
/**
* Create an instance of {@link DSAKeyValueType }
*
*/
public DSAKeyValueType createDSAKeyValueType() {
return new DSAKeyValueType();
}
/**
* Create an instance of {@link ReferenceType }
*
*/
public ReferenceType createReferenceType() {
return new ReferenceType();
}
/**
* Create an instance of {@link RetrievalMethodType }
*
*/
public RetrievalMethodType createRetrievalMethodType() {
return new RetrievalMethodType();
}
/**
* Create an instance of {@link TransformsType }
*
*/
public TransformsType createTransformsType() {
return new TransformsType();
}
/**
* Create an instance of {@link CanonicalizationMethodType }
*
*/
public CanonicalizationMethodType createCanonicalizationMethodType() {
return new CanonicalizationMethodType();
}
/**
* Create an instance of {@link DigestMethodType }
*
*/
public DigestMethodType createDigestMethodType() {
return new DigestMethodType();
}
/**
* Create an instance of {@link ManifestType }
*
*/
public ManifestType createManifestType() {
return new ManifestType();
}
/**
* Create an instance of {@link SignaturePropertyType }
*
*/
public SignaturePropertyType createSignaturePropertyType() {
return new SignaturePropertyType();
}
/**
* Create an instance of {@link X509DataType }
*
*/
public X509DataType createX509DataType() {
return new X509DataType();
}
/**
* Create an instance of {@link SignedInfoType }
*
*/
public SignedInfoType createSignedInfoType() {
return new SignedInfoType();
}
/**
* Create an instance of {@link RSAKeyValueType }
*
*/
public RSAKeyValueType createRSAKeyValueType() {
return new RSAKeyValueType();
}
/**
* Create an instance of {@link SPKIDataType }
*
*/
public SPKIDataType createSPKIDataType() {
return new SPKIDataType();
}
/**
* Create an instance of {@link SignatureValueType }
*
*/
public SignatureValueType createSignatureValueType() {
return new SignatureValueType();
}
/**
* Create an instance of {@link KeyInfoType }
*
*/
public KeyInfoType createKeyInfoType() {
return new KeyInfoType();
}
/**
* Create an instance of {@link SignatureType }
*
*/
public SignatureType createSignatureType() {
return new SignatureType();
}
/**
* Create an instance of {@link SignaturePropertiesType }
*
*/
public SignaturePropertiesType createSignaturePropertiesType() {
return new SignaturePropertiesType();
}
/**
* Create an instance of {@link SignatureMethodType }
*
*/
public SignatureMethodType createSignatureMethodType() {
return new SignatureMethodType();
}
/**
* Create an instance of {@link ObjectType }
*
*/
public ObjectType createObjectType() {
return new ObjectType();
}
/**
* Create an instance of {@link TransformType }
*
*/
public TransformType createTransformType() {
return new TransformType();
}
/**
* Create an instance of {@link X509IssuerSerialType }
*
*/
public X509IssuerSerialType createX509IssuerSerialType() {
return new X509IssuerSerialType();
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SPKIDataType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKIData")
public JAXBElement<SPKIDataType> createSPKIData(SPKIDataType value) {
return new JAXBElement<SPKIDataType>(_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<KeyInfoType> createKeyInfo(KeyInfoType value) {
return new JAXBElement<KeyInfoType>(_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<SignatureValueType> createSignatureValue(SignatureValueType value) {
return new JAXBElement<SignatureValueType>(_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<KeyValueType> createKeyValue(KeyValueType value) {
return new JAXBElement<KeyValueType>(_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<TransformsType> createTransforms(TransformsType value) {
return new JAXBElement<TransformsType>(_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<DigestMethodType> createDigestMethod(DigestMethodType value) {
return new JAXBElement<DigestMethodType>(_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<X509DataType> createX509Data(X509DataType value) {
return new JAXBElement<X509DataType>(_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<SignaturePropertyType> createSignatureProperty(SignaturePropertyType value) {
return new JAXBElement<SignaturePropertyType>(_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<String> createKeyName(String value) {
return new JAXBElement<String>(_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<RSAKeyValueType> createRSAKeyValue(RSAKeyValueType value) {
return new JAXBElement<RSAKeyValueType>(_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<SoftwareIdentity> createSoftwareIdentity(SoftwareIdentity value) {
return new JAXBElement<SoftwareIdentity>(_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<SignatureType> createSignature(SignatureType value) {
return new JAXBElement<SignatureType>(_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<String> createMgmtData(String value) {
return new JAXBElement<String>(_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<SignatureMethodType> createSignatureMethod(SignatureMethodType value) {
return new JAXBElement<SignatureMethodType>(_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<ObjectType> createObject(ObjectType value) {
return new JAXBElement<ObjectType>(_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<SignaturePropertiesType> createSignatureProperties(SignaturePropertiesType value) {
return new JAXBElement<SignaturePropertiesType>(_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<TransformType> createTransform(TransformType value) {
return new JAXBElement<TransformType>(_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<PGPDataType> createPGPData(PGPDataType value) {
return new JAXBElement<PGPDataType>(_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<ReferenceType> createReference(ReferenceType value) {
return new JAXBElement<ReferenceType>(_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<RetrievalMethodType> createRetrievalMethod(RetrievalMethodType value) {
return new JAXBElement<RetrievalMethodType>(_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<DSAKeyValueType> createDSAKeyValue(DSAKeyValueType value) {
return new JAXBElement<DSAKeyValueType>(_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<byte[]> createDigestValue(byte[] value) {
return new JAXBElement<byte[]>(_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<CanonicalizationMethodType> createCanonicalizationMethod(CanonicalizationMethodType value) {
return new JAXBElement<CanonicalizationMethodType>(_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<SignedInfoType> createSignedInfo(SignedInfoType value) {
return new JAXBElement<SignedInfoType>(_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<ManifestType> createManifest(ManifestType value) {
return new JAXBElement<ManifestType>(_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 = "SPKISexp", scope = SPKIDataType.class)
public JAXBElement<byte[]> createSPKIDataTypeSPKISexp(byte[] value) {
return new JAXBElement<byte[]>(_SPKIDataTypeSPKISexp_QNAME, byte[].class, SPKIDataType.class, ((byte[]) 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<byte[]> createPGPDataTypePGPKeyID(byte[] value) {
return new JAXBElement<byte[]>(_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<byte[]> createPGPDataTypePGPKeyPacket(byte[] value) {
return new JAXBElement<byte[]>(_PGPDataTypePGPKeyPacket_QNAME, byte[].class, PGPDataType.class, ((byte[]) 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<String> createTransformTypeXPath(String value) {
return new JAXBElement<String>(_TransformTypeXPath_QNAME, String.class, TransformType.class, 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<BigInteger> createSignatureMethodTypeHMACOutputLength(BigInteger value) {
return new JAXBElement<BigInteger>(_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<X509IssuerSerialType> createX509DataTypeX509IssuerSerial(X509IssuerSerialType value) {
return new JAXBElement<X509IssuerSerialType>(_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<byte[]> createX509DataTypeX509CRL(byte[] value) {
return new JAXBElement<byte[]>(_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<String> createX509DataTypeX509SubjectName(String value) {
return new JAXBElement<String>(_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<byte[]> createX509DataTypeX509SKI(byte[] value) {
return new JAXBElement<byte[]>(_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<byte[]> createX509DataTypeX509Certificate(byte[] value) {
return new JAXBElement<byte[]>(_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<Link> createSoftwareIdentityLink(Link value) {
return new JAXBElement<Link>(_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<Evidence> createSoftwareIdentityEvidence(Evidence value) {
return new JAXBElement<Evidence>(_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<ResourceCollection> createSoftwareIdentityPayload(ResourceCollection value) {
return new JAXBElement<ResourceCollection>(_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<Entity> createSoftwareIdentityEntity(Entity value) {
return new JAXBElement<Entity>(_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<SoftwareMeta> createSoftwareIdentityMeta(SoftwareMeta value) {
return new JAXBElement<SoftwareMeta>(_SoftwareIdentityMeta_QNAME, SoftwareMeta.class, SoftwareIdentity.class, value);
}
}

View File

@ -0,0 +1,171 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for ObjectType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ObjectType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence maxOccurs="unbounded" minOccurs="0">
* &lt;any processContents='lax'/>
* &lt;/sequence>
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;attribute name="MimeType" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="Encoding" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ObjectType", propOrder = {
"content"
})
public class ObjectType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> 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.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
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;
}
}

View File

@ -0,0 +1,85 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.utils.xjc;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Ownership.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* &lt;simpleType name="Ownership">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* &lt;enumeration value="abandon"/>
* &lt;enumeration value="private"/>
* &lt;enumeration value="shared"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*
*/
@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);
}
}

View File

@ -0,0 +1,105 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for PGPDataType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="PGPDataType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;choice>
* &lt;sequence>
* &lt;element name="PGPKeyID" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;element name="PGPKeyPacket" type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
* &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;sequence>
* &lt;element name="PGPKeyPacket" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;/choice>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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<Object> content;
/**
* Gets the rest of the content model.
*
* <p>
* 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
* <p>
* 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.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
* {@link Object }
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
return this.content;
}
}

View File

@ -0,0 +1,96 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for Process complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Process">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="pid" type="{http://www.w3.org/2001/XMLSchema}integer" />
* &lt;anyAttribute processContents='lax'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,93 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for RSAKeyValueType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="RSAKeyValueType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="Modulus" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
* &lt;element name="Exponent" type="{http://www.w3.org/2000/09/xmldsig#}CryptoBinary"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,214 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for ReferenceType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ReferenceType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Transforms" minOccurs="0"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}DigestMethod"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}DigestValue"/>
* &lt;/sequence>
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;attribute name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,68 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for Resource complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="Resource">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
* &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,96 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.utils.xjc;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlElements;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for ResourceCollection complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="ResourceCollection">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
* &lt;choice maxOccurs="unbounded" minOccurs="0">
* &lt;element name="Directory" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Directory"/>
* &lt;element name="File" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}File"/>
* &lt;element name="Process" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Process"/>
* &lt;element name="Resource" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Resource"/>
* &lt;/choice>
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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", type = Directory.class),
@XmlElement(name = "File", type = File.class),
@XmlElement(name = "Process", type = Process.class),
@XmlElement(name = "Resource", type = Resource.class)
})
protected List<Meta> directoryOrFileOrProcess;
/**
* Gets the value of the directoryOrFileOrProcess property.
*
* <p>
* 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 <CODE>set</CODE> method for the directoryOrFileOrProcess property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getDirectoryOrFileOrProcess().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Directory }
* {@link File }
* {@link Process }
* {@link Resource }
*
*
*/
public List<Meta> getDirectoryOrFileOrProcess() {
if (directoryOrFileOrProcess == null) {
directoryOrFileOrProcess = new ArrayList<Meta>();
}
return this.directoryOrFileOrProcess;
}
}

View File

@ -0,0 +1,127 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for RetrievalMethodType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="RetrievalMethodType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Transforms" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="URI" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;attribute name="Type" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,83 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SPKIDataType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SPKIDataType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence maxOccurs="unbounded">
* &lt;element name="SPKISexp" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;any processContents='lax' namespace='##other' minOccurs="0"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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<Object> spkiSexpAndAny;
/**
* Gets the value of the spkiSexpAndAny property.
*
* <p>
* 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 <CODE>set</CODE> method for the spkiSexpAndAny property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSPKISexpAndAny().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
*
*
*/
public List<Object> getSPKISexpAndAny() {
if (spkiSexpAndAny == null) {
spkiSexpAndAny = new ArrayList<Object>();
}
return this.spkiSexpAndAny;
}
}

View File

@ -0,0 +1,115 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SignatureMethodType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SignatureMethodType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="HMACOutputLength" type="{http://www.w3.org/2000/09/xmldsig#}HMACOutputLengthType" minOccurs="0"/>
* &lt;any namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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<Object> content;
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
/**
* Gets the value of the content property.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link Object }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
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;
}
}

View File

@ -0,0 +1,111 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SignaturePropertiesType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SignaturePropertiesType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}SignatureProperty" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SignaturePropertiesType", propOrder = {
"signatureProperty"
})
public class SignaturePropertiesType {
@XmlElement(name = "SignatureProperty", required = true)
protected List<SignaturePropertyType> signatureProperty;
@XmlAttribute(name = "Id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@XmlSchemaType(name = "ID")
protected String id;
/**
* Gets the value of the signatureProperty property.
*
* <p>
* 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 <CODE>set</CODE> method for the signatureProperty property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getSignatureProperty().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SignaturePropertyType }
*
*
*/
public List<SignaturePropertyType> getSignatureProperty() {
if (signatureProperty == null) {
signatureProperty = new ArrayList<SignaturePropertyType>();
}
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;
}
}

View File

@ -0,0 +1,144 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SignaturePropertyType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SignaturePropertyType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;choice maxOccurs="unbounded">
* &lt;any processContents='lax' namespace='##other'/>
* &lt;/choice>
* &lt;attribute name="Target" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SignaturePropertyType", propOrder = {
"content"
})
public class SignaturePropertyType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> 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.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link Element }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
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;
}
}

View File

@ -0,0 +1,195 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SignatureType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SignatureType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}SignedInfo"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}SignatureValue"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}KeyInfo" minOccurs="0"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Object" maxOccurs="unbounded" minOccurs="0"/>
* &lt;/sequence>
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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<ObjectType> 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.
*
* <p>
* 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 <CODE>set</CODE> method for the object property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getObject().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ObjectType }
*
*
*/
public List<ObjectType> getObject() {
if (object == null) {
object = new ArrayList<ObjectType>();
}
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;
}
}

View File

@ -0,0 +1,99 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SignatureValueType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SignatureValueType">
* &lt;simpleContent>
* &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>base64Binary">
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;/extension>
* &lt;/simpleContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,167 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SignedInfoType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SignedInfoType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}SignatureMethod"/>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Reference" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;attribute name="Id" type="{http://www.w3.org/2001/XMLSchema}ID" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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<ReferenceType> 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.
*
* <p>
* 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 <CODE>set</CODE> method for the reference property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getReference().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link ReferenceType }
*
*
*/
public List<ReferenceType> getReference() {
if (reference == null) {
reference = new ArrayList<ReferenceType>();
}
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;
}
}

View File

@ -0,0 +1,375 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SoftwareIdentity complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SoftwareIdentity">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}BaseElement">
* &lt;choice maxOccurs="unbounded">
* &lt;element name="Entity" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Entity" maxOccurs="unbounded"/>
* &lt;element name="Evidence" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Evidence" minOccurs="0"/>
* &lt;element name="Link" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Link" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="Meta" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}SoftwareMeta" maxOccurs="unbounded" minOccurs="0"/>
* &lt;element name="Payload" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}ResourceCollection" minOccurs="0"/>
* &lt;any processContents='lax' namespace='##other' maxOccurs="unbounded" minOccurs="0"/>
* &lt;/choice>
* &lt;attribute name="corpus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="patch" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="media" type="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Media" />
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="supplemental" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
* &lt;attribute name="tagId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="tagVersion" type="{http://www.w3.org/2001/XMLSchema}integer" default="0" />
* &lt;attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" default="0.0" />
* &lt;attribute name="versionScheme" type="{http://www.w3.org/2001/XMLSchema}NMTOKEN" default="multipartnumeric" />
* &lt;anyAttribute processContents='lax' namespace='##other'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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 = "Meta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = JAXBElement.class, required = false),
@XmlElementRef(name = "Evidence", 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),
@XmlElementRef(name = "Payload", 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)
})
@XmlAnyElement(lax = true)
protected List<Object> 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.
*
* <p>
* 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 <CODE>set</CODE> method for the entityOrEvidenceOrLink property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getEntityOrEvidenceOrLink().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link SoftwareMeta }{@code >}
* {@link Object }
* {@link JAXBElement }{@code <}{@link Evidence }{@code >}
* {@link Element }
* {@link JAXBElement }{@code <}{@link Link }{@code >}
* {@link JAXBElement }{@code <}{@link ResourceCollection }{@code >}
* {@link JAXBElement }{@code <}{@link Entity }{@code >}
*
*
*/
public List<Object> getEntityOrEvidenceOrLink() {
if (entityOrEvidenceOrLink == null) {
entityOrEvidenceOrLink = new ArrayList<Object>();
}
return this.entityOrEvidenceOrLink;
}
/**
* Gets the value of the corpus property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public boolean isCorpus() {
if (corpus == null) {
return false;
} else {
return corpus;
}
}
/**
* Sets the value of the corpus property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setCorpus(Boolean value) {
this.corpus = value;
}
/**
* Gets the value of the patch property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public boolean isPatch() {
if (patch == null) {
return false;
} else {
return patch;
}
}
/**
* Sets the value of the patch property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setPatch(Boolean value) {
this.patch = value;
}
/**
* Gets the value of the media property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMedia() {
return media;
}
/**
* Sets the value of the media property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMedia(String value) {
this.media = value;
}
/**
* Gets the value of the name property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getName() {
return name;
}
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
}
/**
* Gets the value of the supplemental property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public boolean isSupplemental() {
if (supplemental == null) {
return false;
} else {
return supplemental;
}
}
/**
* Sets the value of the supplemental property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setSupplemental(Boolean value) {
this.supplemental = value;
}
/**
* Gets the value of the tagId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTagId() {
return tagId;
}
/**
* Sets the value of the tagId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTagId(String value) {
this.tagId = value;
}
/**
* Gets the value of the tagVersion property.
*
* @return
* possible object is
* {@link BigInteger }
*
*/
public BigInteger getTagVersion() {
if (tagVersion == null) {
return new BigInteger("0");
} else {
return tagVersion;
}
}
/**
* Sets the value of the tagVersion property.
*
* @param value
* allowed object is
* {@link BigInteger }
*
*/
public void setTagVersion(BigInteger value) {
this.tagVersion = value;
}
/**
* Gets the value of the version property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersion() {
if (version == null) {
return "0.0";
} else {
return version;
}
}
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
}
/**
* Gets the value of the versionScheme property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getVersionScheme() {
if (versionScheme == null) {
return "multipartnumeric";
} else {
return versionScheme;
}
}
/**
* Sets the value of the versionScheme property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setVersionScheme(String value) {
this.versionScheme = value;
}
}

View File

@ -0,0 +1,446 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for SoftwareMeta complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="SoftwareMeta">
* &lt;complexContent>
* &lt;extension base="{http://standards.iso.org/iso/19770/-2/2015/schema.xsd}Meta">
* &lt;attribute name="activationStatus" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="channelType" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="colloquialVersion" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="edition" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="entitlementDataRequired" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* &lt;attribute name="entitlementKey" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="generator" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="persistentId" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="product" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="productFamily" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="revision" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="summary" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="unspscCode" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;attribute name="unspscVersion" type="{http://www.w3.org/2001/XMLSchema}string" />
* &lt;anyAttribute processContents='lax'/>
* &lt;/extension>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,116 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for TransformType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="TransformType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;choice maxOccurs="unbounded" minOccurs="0">
* &lt;any processContents='lax' namespace='##other'/>
* &lt;element name="XPath" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;/choice>
* &lt;attribute name="Algorithm" use="required" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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<Object> content;
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
/**
* Gets the value of the content property.
*
* <p>
* 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 <CODE>set</CODE> method for the content property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getContent().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Element }
* {@link String }
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link Object }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
}
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;
}
}

View File

@ -0,0 +1,76 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for TransformsType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="TransformsType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element ref="{http://www.w3.org/2000/09/xmldsig#}Transform" maxOccurs="unbounded"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TransformsType", propOrder = {
"transform"
})
public class TransformsType {
@XmlElement(name = "Transform", required = true)
protected List<TransformType> transform;
/**
* Gets the value of the transform property.
*
* <p>
* 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 <CODE>set</CODE> method for the transform property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getTransform().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link TransformType }
*
*
*/
public List<TransformType> getTransform() {
if (transform == null) {
transform = new ArrayList<TransformType>();
}
return this.transform;
}
}

View File

@ -0,0 +1,82 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.utils.xjc;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for Use.
*
* <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre>
* &lt;simpleType name="Use">
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}NMTOKEN">
* &lt;enumeration value="required"/>
* &lt;enumeration value="recommended"/>
* &lt;enumeration value="optional"/>
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*
*/
@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);
}
}

View File

@ -0,0 +1,100 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for X509DataType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="X509DataType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence maxOccurs="unbounded">
* &lt;choice>
* &lt;element name="X509IssuerSerial" type="{http://www.w3.org/2000/09/xmldsig#}X509IssuerSerialType"/>
* &lt;element name="X509SKI" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;element name="X509SubjectName" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="X509Certificate" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;element name="X509CRL" type="{http://www.w3.org/2001/XMLSchema}base64Binary"/>
* &lt;any processContents='lax' namespace='##other'/>
* &lt;/choice>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "X509DataType", propOrder = {
"x509IssuerSerialOrX509SKIOrX509SubjectName"
})
public class X509DataType {
@XmlElementRefs({
@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),
@XmlElementRef(name = "X509IssuerSerial", namespace = "http://www.w3.org/2000/09/xmldsig#", type = JAXBElement.class, required = false),
@XmlElementRef(name = "X509SKI", 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)
})
@XmlAnyElement(lax = true)
protected List<Object> x509IssuerSerialOrX509SKIOrX509SubjectName;
/**
* Gets the value of the x509IssuerSerialOrX509SKIOrX509SubjectName property.
*
* <p>
* 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 <CODE>set</CODE> method for the x509IssuerSerialOrX509SKIOrX509SubjectName property.
*
* <p>
* For example, to add a new item, do as follows:
* <pre>
* getX509IssuerSerialOrX509SKIOrX509SubjectName().add(newItem);
* </pre>
*
*
* <p>
* Objects of the following type(s) are allowed in the list
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
* {@link Object }
* {@link JAXBElement }{@code <}{@link X509IssuerSerialType }{@code >}
* {@link Element }
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
*
*
*/
public List<Object> getX509IssuerSerialOrX509SKIOrX509SubjectName() {
if (x509IssuerSerialOrX509SKIOrX509SubjectName == null) {
x509IssuerSerialOrX509SKIOrX509SubjectName = new ArrayList<Object>();
}
return this.x509IssuerSerialOrX509SKIOrX509SubjectName;
}
}

View File

@ -0,0 +1,98 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
package hirs.attestationca.portal.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;
/**
* <p>Java class for X509IssuerSerialType complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType name="X509IssuerSerialType">
* &lt;complexContent>
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* &lt;sequence>
* &lt;element name="X509IssuerName" type="{http://www.w3.org/2001/XMLSchema}string"/>
* &lt;element name="X509SerialNumber" type="{http://www.w3.org/2001/XMLSchema}integer"/>
* &lt;/sequence>
* &lt;/restriction>
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@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;
}
}

View File

@ -0,0 +1,9 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2023.02.16 at 04:29:40 PM UTC
//
@javax.xml.bind.annotation.XmlSchema(namespace = "http://www.w3.org/2000/09/xmldsig#", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package hirs.attestationca.portal.utils.xjc;

View File

@ -0,0 +1,477 @@
{
"TCG": {
"Processors": {
"ID": "0x00010000",
"Types": {
"0x00000002": "CPU",
"0x00000003": "Math Processor",
"0x00000004": "DSP Processor",
"0x00000005": "Video Processor",
"0x00000006": "GPU"
}
},
"Containers": {
"ID": "0x00020000",
"Types": {
"0x00000002": "Desktop",
"0x00000003": "Low Profile Desktop",
"0x00000004": "Pizza Box",
"0x00000005": "Mini Tower",
"0x00000006": "Tower",
"0x00000007": "Portable",
"0x00000008": "Laptop",
"0x00000009": "Notebook",
"0x0000000A": "Hand Held",
"0x0000000B": "Docking Station",
"0x0000000C": "All in One",
"0x0000000D": "Sub Notebook",
"0x0000000E": "Space-saving",
"0x0000000F": "Lunch Box",
"0x00000010": "Main Server Chassis",
"0x00000011": "Expansion Chassis",
"0x00000012": "Sub Chassis",
"0x00000013": "Bus Expansion Chassis",
"0x00000014": "Peripheral Chassis",
"0x00000015": "RAID Chassis",
"0x00000016": "Rack Mount Chassis",
"0x00000017": "Sealed-case PC",
"0x00000018": "Multi-system Chassis",
"0x00000019": "Compact PCI",
"0x0000001A": "Advanced TCA",
"0x0000001B": "Blade",
"0x0000001C": "Blade Enclosure",
"0x0000001D": "Tablet",
"0x0000001E": "Convertible",
"0x0000001F": "Detachable",
"0x00000020": "IoT Gateway",
"0x00000021": "Embedded PC",
"0x00000022": "MiniPC",
"0x00000023": "Stick PC",
"0x00000024": "1U Rack Mount Chassis",
"0x00000025": "2U Rack Mount Chassis",
"0x00000026": "3U Rack Mount Chassis",
"0x00000027": "4U Rack Mount Chassis",
"0x00000028": "5U Rack Mount Chassis",
"0x00000029": "6U Rack Mount Chassis",
"0x0000002A": "7U Rack Mount Chassis",
"0x0000002B": "8U Rack Mount Chassis"
}
},
"IC Boards": {
"ID": "0x00030000",
"Types": {
"0x00000002": "Daughter Board",
"0x00000003": "Motherboard",
"0x00000004": "Riser Card"
}
},
"Modules": {
"ID": "0x00040000",
"Types": {
"0x00000002": "SAS Bridgeboard",
"0x00000003": "Processor Module",
"0x00000004": "I/O Module",
"0x00000005": "Memory Module",
"0x00000006": "Power Module",
"0x00000007": "Processor/Memory Module",
"0x00000008": "Processor/IO Module",
"0x00000009": "TPM"
}
},
"Controllers": {
"ID": "0x00050000",
"Types": {
"0x00000002": "Video Controller",
"0x00000003": "SCSI Controller",
"0x00000004": "Ethernet Controller",
"0x00000005": "Token Ring Controller",
"0x00000006": "Audio/Sound Controller",
"0x00000007": "PATA Controller",
"0x00000008": "SATA Controller",
"0x00000009": "SAS Controller",
"0x0000000A": "LED Display Controller",
"0x0000000B": "RAID Controller",
"0x0000000C": "Remote Access Controller",
"0x0000000E": "USB Controller",
"0x0000000F": "Multi-function Storage Controller",
"0x00000010": "Multi-function Network Controller",
"0x00000011": "Smart IO Controller"
}
},
"Memory": {
"ID": "0x00060000",
"Types": {
"0x00000002": "Port Controller",
"0x00000003": "Baseboard Management Controller",
"0x00000004": "DRAM Memory",
"0x00000005": "EDRAM Memory",
"0x00000006": "VRAM Memory",
"0x00000007": "SRAM Memory",
"0x00000008": "RAM Memory",
"0x00000009": "ROM Memory",
"0x0000000A": "FLASH Memory",
"0x0000000B": "EEPROM Memory",
"0x0000000C": "FEPROM Memory",
"0x0000000D": "EPROM Memory",
"0x0000000E": "CDRAM Memory",
"0x0000000F": "3DRAM Memory",
"0x00000010": "SDRAM Memory",
"0x00000011": "SGRAM Memory",
"0x00000012": "RDRAM Memory",
"0x00000013": "DDR Memory",
"0x00000014": "DDR2 Memory",
"0x00000015": "DDR3 Memory",
"0x00000016": "DDR4 Memory",
"0x00000017": "LPDDR Memory",
"0x00000018": "LPDDR2 Memory",
"0x00000019": "LPDDR3 Memory",
"0x0000001A": "LPDDR4 Memory",
"0x0000001B": "NVRAM Memory",
"0x0000001C": "3D Xpoint Memory"
}
},
"Storage": {
"ID": "0x00070000",
"Types": {
"0x00000002": "Storage Drive",
"0x00000003": "SSD Drive",
"0x00000004": "M.2 Drive",
"0x00000005": "HDD Drive"
}
},
"Media Drives": {
"ID": "0x00080000",
"Types": {
"0x00000002": "Floppy Drive",
"0x00000003": "Tape Drive",
"0x00000004": "PCIe Drive",
"0x00000005": "CD Drive",
"0x00000006": "DVD Drive",
"0x00000007": "Blu-Ray Drive"
}
},
"Network Adapters": {
"ID": "0x00090000",
"Types": {
"0x00000002": "Ethernet Adapter",
"0x00000003": "WiFi Adapter",
"0x00000004": "Bluetooh Adapter",
"0x00000005": "Cellular Adapter",
"0x00000006": "Zigbee Adapter",
"0x00000007": "3G Cellular Adapter",
"0x00000008": "4G Cellular Adapter",
"0x00000009": "5G Cellular Adapter",
"0x0000000A": "Network Switch",
"0x0000000B": "Network Router"
}
},
"Energy Object": {
"ID": "0x000A0000",
"Types": {
"0x00000002": "Power Supply",
"0x00000003": "Battery",
"0x00000004": "Coin Battery",
"0x00000005": "Capacitor Battery"
}
},
"Sensors": {
"ID": "0x000B0000",
"Types": {
"0x00000002": "Optical Sensor",
"0x00000003": "Temperature Sensor",
"0x00000004": "Proximity Sensor",
"0x00000005": "IR Sensor",
"0x00000006": "Chemical Sensor",
"0x00000007": "Motion Detection Sensor",
"0x00000008": "Level Sensor",
"0x00000009": "Gyroscopic Sensor",
"0x0000000A": "Humidity Sensor",
"0x0000000B": "Accelerometer Sensor"
}
},
"Display Devices": {
"ID": "0x000C0000",
"Types": {
"0x00000002": "LCD Display Panel",
"0x00000003": "LED Display Panel",
"0x00000004": "OLED Display Panel",
"0x00000005": "CRT Display Panel"
}
},
"Cooling": {
"ID": "0x000D0000",
"Types": {
"0x00000002": "Thermal Assembly",
"0x00000003": "Fan",
"0x00000004": "Chassis Fan",
"0x00000005": "Socket Fan",
"0x00000006": "Heatsink",
"0x00000007": "Liquid Cooling"
}
},
"Input Devices": {
"ID": "0x000E0000",
"Types": {
"0x00000002": "Mouse",
"0x00000003": "Track Ball",
"0x00000004": "Track Point",
"0x00000005": "Glide Point",
"0x00000006": "Touch Pad",
"0x00000007": "Touch Screen",
"0x00000008": "Camera",
"0x00000009": "Fingerprint Reader",
"0x0000000A": "Keyboard",
"0x0000000B": "Smartcard Reader",
"0x0000000C": "Biometric Reader",
"0x0000000D": "Joystick",
"0x0000000E": "Gaming Controller",
"0x0000000F": "IR Camera",
"0x00000010": "Facial Recognition Camera",
"0x00000011": "Scanner"
}
},
"Slots": {
"ID": "0x000F0000",
"Types": {
"0x00000002": "Socket",
"0x00000003": "ISA Slot",
"0x00000004": "PCI Slot",
"0x00000005": "AGP Slot",
"0x00000006": "PCI-X Slot",
"0x00000007": "M.2 Slot",
"0x00000008": "MXM Slot",
"0x00000009": "PCI Express Slot",
"0x0000000A": "PCI Express Mini",
"0x0000000B": "PC-98 Slot",
"0x0000000C": "Memory Slot"
}
},
"Ports": {
"ID": "0x00100000",
"Types": {
"0x00000002": "Parallel Port",
"0x00000003": "Serial Port",
"0x00000004": "SCSI Port",
"0x00000005": "MIDI Port",
"0x00000006": "USB Port",
"0x00000007": "Firewire Port",
"0x00000008": "PCMCIA Port",
"0x00000009": "ATA Port",
"0x0000000A": "SATA Port",
"0x0000000B": "SAS Port",
"0x0000000C": "Optical Port",
"0x0000000D": "DisplayPort",
"0x0000000E": "Mini DisplayPort",
"0x0000000F": "HDMI Port",
"0x00000010": "Mini HDMI Port",
"0x00000011": "Micro HDMI Port",
"0x00000012": "Thunderbolt Port",
"0x00000013": "VGA Port",
"0x00000014": "Mini VGA Port",
"0x00000015": "DVI Port",
"0x00000016": "DVI-I Port",
"0x00000017": "DVI-D Port",
"0x00000018": "DVI-A Port",
"0x00000019": "Mini DVI Port",
"0x0000001A": "Micro DVI Port",
"0x0000001B": "Ethernet Port",
"0x0000001C": "ADB Port",
"0x0000001D": "Mac Serial Port",
"0x0000001E": "PS/2 Port",
"0x0000001F": "Surround Sound Port",
"0x00000020": "Stereo Port",
"0x00000021": "Dolby 5.1 Port",
"0x00000022": "Dolby 7.1 Port",
"0x00000023": "Dolby 7.2 Port",
"0x00000024": "Line In Port",
"0x00000025": "Microphone Port",
"0x00000026": "Speaker Port",
"0x00000027": "Digital Audio Port",
"0x00000028": "TOSLINK Port"
}
},
"Discrete Component": {
"ID": "0x00110000",
"Types": {
"0x00000002": "Capacitor",
"0x00000003": "Resistor",
"0x00000004": "Inductor",
"0x00000005": "Diode",
"0x00000006": "Crystal Oscilator",
"0x00000007": "Logic Gate",
"0x00000008": "Ferrite Beads",
"0x00000009": "Transistor",
"0x0000000A": "Fuse",
"0x0000000B": "Voltage Regulator",
"0x0000000C": "DC/DC Converter",
"0x0000000D": "Switching Regulator",
"0x0000000E": "Power Switch"
}
},
"Cabling": {
"ID": "0x00120000",
"Types": {
"0x00000002": "AC Adapter",
"0x00000003": "Power Cord",
"0x00000004": "Serial ATA Cable",
"0x00000005": "Serial ATA Power Cable",
"0x00000006": "Drive Cable",
"0x00000007": "Power Supply Cable",
"0x00000008": "IDE Cable",
"0x00000009": "Molex Cable",
"0x0000000A": "Ribbon Cable",
"0x0000000B": "PCI Express Cable"
}
},
"Firmware": {
"ID": "0x00130000",
"Types": {
"0x00000002": "UEFI",
"0x00000003": "System BIOS",
"0x00000004": "Drive BIOS",
"0x00000005": "Bootloader",
"0x00000006": "System Management Module"
}
}
},
"SMBIOS": {
"BIOS": {
"ID": "0x00000000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown"
}
},
"System": {
"ID": "0x00010000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown"
}
},
"Baseboard": {
"ID": "0x00020000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown",
"0x00000003": "Server Blade",
"0x00000004": "Connectivity Switch",
"0x00000005": "System Management Module",
"0x00000006": "Processor Module",
"0x00000007": "I/O Module",
"0x00000008": "Memory Module",
"0x00000009": "Daughter board",
"0x0000000A": "Motherboard (includes processor, memory, and I/O)",
"0x0000000B": "Processor/Memory Module",
"0x0000000C": "Processor/IO Module",
"0x0000000D": "Interconnect board"
}
},
"Chassis": {
"ID": "0x00030000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown",
"0x00000003": "Desktop",
"0x00000004": "Low Profile Desktop",
"0x00000005": "Pizza Box",
"0x00000006": "Mini Tower",
"0x00000007": "Tower",
"0x00000008": "Portable",
"0x00000009": "Laptop",
"0x0000000A": "Notebook",
"0x0000000B": "Hand Held",
"0x0000000C": "Docking Station",
"0x0000000D": "All in One",
"0x0000000E": "Sub Notebook",
"0x0000000F": "Space-saving",
"0x00000010": "Lunch Box",
"0x00000011": "Main Server Chassis",
"0x00000012": "Expansion Chassis",
"0x00000013": "SubChassis",
"0x00000014": "Bus Expansion Chassis",
"0x00000015": "Peripheral Chassis",
"0x00000016": "RAID Chassis",
"0x00000017": "Rack Mount Chassis",
"0x00000018": "Sealed-case PC",
"0x00000019": "Multi-system chassis",
"0x0000001A": "Compact PCI",
"0x0000001B": "Advanced TCA",
"0x0000001C": "Blade",
"0x0000001D": "Blade Enclosure",
"0x0000001E": "Tablet",
"0x0000001F": "Convertible",
"0x00000020": "Detachable",
"0x00000021": "IoT Gateway",
"0x00000022": "Embedded PC",
"0x00000023": "Mini PC",
"0x00000024": "Stick PC"
}
},
"Processor": {
"ID": "0x00040000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown",
"0x00000003": "Central Processor",
"0x00000004": "Math Processor",
"0x00000005": "DSP Processor",
"0x00000006": "Video Processor"
}
},
"RAM": {
"ID": "0x00110000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown",
"0x00000003": "DRAM",
"0x00000004": "EDRAM",
"0x00000005": "VRAM",
"0x00000006": "SRAM",
"0x00000007": "RAM",
"0x00000008": "ROM",
"0x00000009": "FLASH",
"0x0000000A": "EEPROM",
"0x0000000B": "FEPROM",
"0x0000000C": "EPROM",
"0x0000000D": "CDRAM",
"0x0000000E": "3DRAM",
"0x0000000F": "SDRAM",
"0x00000010": "SGRAM",
"0x00000011": "RDRAM",
"0x00000012": "DDR",
"0x00000013": "DDR2",
"0x00000014": "DDR2 FB-DIMM",
"0x00000015": "Reserved",
"0x00000016": "Reserved",
"0x00000017": "Reserved",
"0x00000018": "DDR3",
"0x00000019": "FBD2",
"0x0000001A": "DDR4",
"0x0000001B": "LPDDR",
"0x0000001C": "LPDDR2",
"0x0000001D": "LPDDR3",
"0x0000001E": "LPDDR4",
"0x0000001F": "Logical non-volatile device",
"0x00000020": "HBM (High Bandwidth Memory)",
"0x00000021": "HBM2 (High Bandwidth Memory Generation 2)",
"0x00000022": "DDR5",
"0x00000023": "LPDDR5"
}
},
"Power Supply": {
"ID": "0x00270000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown"
}
},
"TPM": {
"ID": "0x002B0000",
"Types": {
"0x00000001": "Other",
"0x00000002": "Unknown"
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,233 @@
{
"VendorTable": {
"_comment_1": "UUIDS listed in the UEFI Specification",
"eb9d2d30-2d88-11d3-9a16-0090273fc14d": "ACPI_TABLE_GUID",
"eb9d2d32-2d88-11d3-9a16-0090273fc14d": "SAL_SYSTEM_TABLE_GUID",
"eb9d2d31-2d88-11d3-9a16-0090273fc14d": "SMBIOS_TABLE_GUID",
"f2fd1544-9794-4a2c-992e-e5bbcf20e394": "SMBIOS3_TABLE_GUID",
"eb9d2d2f-2d88-11d3-9a16-0090273fc14d": "MPS_TABLE_GUID",
"8868e871-e4f1-11d3-bc22-0080c73c8881": "EFI_ACPI_TABLE_GUID",
"87367f87-1119-41ce-aaec-8be01101f558": "EFI_JSON_CONFIG_DATA_TABLE_GUID",
"35e7a725-8dd2-4cac-8011-33cda8109056": "EFI_JSON_CAPSULE_DATA_TABLE_GUID",
"dbc461c3-b3de-422a-b9b4-9886fd49a1e5": "EFI_JSON_CAPSULE_RESULT_TABLE_GUID",
"77ab535a-45fc-624b-5560-f7b281d1f96e": "EFI_VIRTUAL_DISK_GUID",
"3d5abd30-4175-87Ce-6d64-d2ADe523C4bb": "EFI_VIRTUAL_CD_GUID",
"5Cea02c9-4d07-69d3-269f-4496Fbe096f9": "EFI_PERSISTENT_VIRTUAL_DISK_GUID",
"08018188-42cd-bb48-100f-5387D53ded3d": "EFI_PERSISTENT_VIRTUAL_CD_GUID",
"_comment_2": "DXE GUIds from https://github.com/linuxboot/linuxboot/blob/master/boards/qemu/image-files.txt",
"fc510ee7-ffdc-11d4-bd41-0080c73c8881": "DXE Apriori-FVRECOVERY",
"1b45cc0a-156a-428a-62af-49864da0e6e6": "PEI Apriori file name",
"80cf7257-87ab-47f9-a3fe-d50b76d89541": "PcdDxe",
"b601f8c4-43b7-4784-95b1-f4226cb40cee": "RuntimeDxe",
"f80697e9-7fd6-4665-8646-88e33ef71dfc": "SecurityStubDxe",
"1a1e4886-9517-440e-9fde-3be44cee2136": "CpuDxe",
"11a6edf6-a9be-426d-a6cc-b22fe51d9224": "PciHotPlugInitDxe",
"128fb770-5e79-4176-9e51-9bb268a17dd1": "PciHostBridgeDxe",
"93b80004-9fb3-11d4-9a3a-0090273fc14d": "PCI Bus Driver - PciBusDxe",
"9b680fce-ad6b-4f3a-b60b-f59899003443": "DevicePathDxe",
"f9d88642-0737-49bc-81b5-6889cd57d9ea": "SmbiosDxe",
"4110465d-5ff3-4f4b-b580-24ed0d06747a": "SmbiosPlatformDxe",
"9622e42c-8e38-4a08-9e8f-54f784652f6b": "AcpiTableDxe",
"49970331-e3fa-4637-9abc-3b7868676970": "AcpiPlatform",
"7e374e25-8e01-4fee-87f2-390c23c606cd": "ACPI data",
"bdce85bb-fbaa-4f4e-9264-501a2c249581": "S3SaveStateDxe",
"d9dcc5df-4007-435e-9098-8970935504b2": "PlatformDxe",
"8657015b-ea43-440d-949a-af3be365c0fc": "IoMmuDxe",
"cbd2e4d5-7068-4ff5-b462-9822b4ad8d60": "VariableRuntimeDxe",
"_comment_3": "PIWG Dxe driver Files (FvFile)from https://bugs.launchpad.net/ubuntu/+source/edk2/+bug/1272444",
"70d57d67-7f05-494d-a014-b75d7345b700": "Storage Security Command Driver",
"3acc966d-8e33-45c6-b4fe-62724bcd15a9": "AHCI Bus Driver",
"67bbc344-84bc-4e5c-b4df-f5e4a00e1f3a": "Host Controller Driver",
"86edaae5-073c-4c89-b949-8984ac8a55f3": "MMC/SD Media Device Driver",
"9e863906-a40f-4875-977F-5b93ff237fc6": "Serial Terminal Driver",
"a6cc6bc8-2ada-46C3-bba4-e99672CC9530": "PCI Serial Driver",
"69fd8e47-a161-4550-b01a-5594ceb2b2b2": "PCI IDE/ATAPI Bus Driver",
"51ccf399-4fdf-4e55-a45b-e123f84d456a": "Platform Console Management Driver",
"6b38f7b4-ad98-40e9-9093-aca2b5a253c4": "Generic Disk I/O Driver",
"2d2e62cf-9ecf-43b7-8219-94e7fC713dfe": "Usb Keyboard Driver",
"9fb4b4a7-42C0-4bcd-8540-9bcc6711f83e": "Usb Mass Storage Driver",
"e3752948-b9a1-4770-90c4-df41c38986be": "QEMU Video Driver",
"240612B7-a063-11d4-9a3a-0090273fc14d": "Usb Bus Driver",
"bdfe430e-8F2a-4db0-9991-6f856594777e": "Usb Ehci Driver",
"2fb92efa-2ee0-4bae-9eB6-7464125E1EF7": "Usb Ehci Driver",
"a92cdb4b-82f1-4e0b-a516-8a655d371524": "Virtio Network Driver",
"4579b72d-7ec4-4dd4-8486-083c86b182a7": "iSCSI Driver",
"3b1deaB5-c75d-442e-9238-8e2ffb62b0bb": "UEFI PXE Base Code Driver",
"6b6963ab-906d-4a65-a7ca-bd40e5d6af2b": "UDP Network Service Driver",
"6d6963ab-906d-4a65-a7ca-bd40e5d6af4d": "Tcp Network Service Driver",
"dc3641b8-2fa8-4ed3-bc1f-f9962a03454b": "MTFTP4 Network Service Driver",
"9fb1a1f3-3b71-4324-b39a-745cbb015fff": "IP4 Network Service Driver",
"26841bde-920a-4e7a-9Fbe-637f477143a6": "IP4 CONFIG Network Service Driver",
"94734718-0bbc-47fb-96a5-ee7a5ae6a2ad": "DHCP Protocol Driver",
"529d3f93-e8e9-4e73-b1e1-bdf6a9d50113": "ARP Network Service Driver",
"e4f61863-fe2c-4b56-a8d4-08519bc439df": "VLAN Configuration Driver",
"a2f436ea-a127-4ef8-957c-8048606ff670": "Simple Network Protocol Driver",
"961578fe-b6b7-44c3-af35-6bc705cd2b1f": "FAT File System Driver",
"0abd8284-6da3-4616-971a-83a5148067ba": "ISA Floppy Driver",
"3dc82376-637b-40a6-a8fc-a565417f2c38": "PS/2 Keyboard Driver",
"93b80003-9fb3-11d4-9a3a-0090273fc14d": "ISA Serial Driver",
"240612b5-a063-11d4-9a3a-0090273fc14a": "ISA Bus Driver",
"99549f44-49bb-4820-b9d2-901329412d67": "IDE Controller Init Driver",
"0a66e322-3740-4cce-ad62-bd172cecca35": "Scsi Disk Driver",
"1fa1f39e-feff-4aae-bd7b-38a070a3b609": "Partition Driver",
"9e863906-a40f-4875-977f-5b93ff237fc6": "Serial Terminal Driver",
"cccb0c28-4b24-11d5-9a5a-0090273fc14d": "Graphics Console Driver",
"408edcec-cf6d-477c-a5a8-b4844e3de281": "Console Splitter Driver",
"fab5d4f4-83c0-4aaf-8480-442d11df6cea": "Virtio SCSI Host Driver",
"11d92dfb-3Ca9-4f93-ba2e-4780ed3e03b5": "Virtio Block Driver",
"33cb97af-6c33-4c42-986b-07581fa366d4": "Block MMIO to Block IO Driver",
"_comment_4": "PIWG Volumes (Fv)",
"a881d567-6cb0-4eee-8435-2e72d33e45B5": "PIWG Default Volume",
"_comment_5": "UEFI UUIDS for Certificates",
"3c5766e8-269c-4e34-aa14-ed776e85b3b6": "EFI_CERT_RSA2048_GUID",
"e2b36190-879b-4a3d-ad8d-f2e7bba32784": "EFI_CERT_RSA2048_SHA256_GUID",
"c1c41626-504c-4092-aca9-41f936934328": "EFI_CERT_SHA256_GUID",
"826ca512-cf10-4ac9-b187-be01496631bd": "EFI_CERT_SHA1_GUID",
"67f8444f-8743-48f1-a328-1eaab8736080": "EFI_CERT_RSA2048_SHA1_GUID",
"a5c059a1-94e4-4aa7-87b5-ab155c2bf072": "EFI_CERT_X509_GUID",
"0b6e5233-a65c-44c9-9407-d9ab83bfc8bd": "EFI_CERT_SHA224_GUID",
"ff3e5307-9fd0-48c9-85f1-8ad56c701e01": "EFI_CERT_SHA384_GUID",
"093e0fae-a6c4-4f50-9f1b-d41e2b89c19a": "EFI_CERT_SHA512_GUID",
"3bd2a492-96c0-4079-b420-fcf98ef103ed": "EFI_CERT_X509_SHA256_GUID",
"7076876e-80c2-4ee6-aad2-28b349a6865b": "EFI_CERT_X509_SHA384_GUID",
"446dbf63-2502-4cda-bcfa-2465d2b0fe9d": "EFI_CERT_X509_SHA512_GUID",
"a7717414-c616-4977-9420-844712a735bf": "EFI_CERT_TYPE_RSA2048_SHA256_GUID",
"_comment_6": "UEFI defined variables",
"452e8ced-dfff-4b8c-ae01-5118862e682c": "EFI_CERT_EXTERNAL_MANAGEMENT_GUID",
"d719b2cb-3d3a-4596-a3bc-dad00e67656f": "EFI_IMAGE_SECURITY_DATABASE_GUID",
"4aafd29d-68df-49ee-8aa9-347d375665a7": "EFI_CERT_TYPE_PKCS7_GUID",
"c12a7328-f81f-11d2-ba4b-00a0c93ec93b": "EFI System Partition",
"024DEE41-33E7-11D3-9D69-0008C781F39F": "Partition containing a legacy MBR",
"_comment_7": "RHBoot UEFI Application UUIDs From listed in RHBoot (RHShim) https://github.com/rhboot/efivar/blob/master/src/guids.txt",
"0abba7dc-e516-4167-bbf5-4d9d1c739416": "fwupdate:",
"3b8c8162-188c-46a4-aec9-be43f1d65697": "ux_capsule",
"605dab50-e046-4300-abb6-3dd810dd8b23": "RH_Shim",
"8be4df61-93ca-11d2-aa0d-00e098032b8c": "EFI_Global_Variable",
"91376aff-cba6-42be-949d-06fde81128e8": "GRUB",
"_comment_8": "Partition Table GUIDs",
"0fc63daf-8483-4772-8e79-3d69d8477de4": "Linux filesystem data",
"e6d6d379-f507-44c2-a23c-238f2a3df928": "Logical Volume Manager (LVM) partition",
"4f68bce3-e8cd-4db1-96e7-fbcaf984b709": "Root partition (x86-64)",
"a19d880f-05fc-4d3b-a006-743f0f84911e": "RAID partition",
"933ac7e1-2eb4-4f13-b844-0e14e2aef915": "/home partition[ (x86-64)",
"ebd0a0a2-b9e5-4433-87c0-68b6b72699c7": "GPT Basic data partition",
"_comment_9": "RHBoot Lenovo specific UUIDS",
"3cc24e96-22c7-41d8-8863-8e39dcdcc2cf": "lenovo",
"82988420-7467-4490-9059-feb448dd1963": "lenovo_me_config",
"f7e615b-0d45-4f80-88dc-26b234958560": "lenovo_diag",
"665d3f60-ad3e-4cad-8e26-db46eee9f1b5": "lenovo_rescue",
"721c8b66-426c-4e86-8e99-3457c46ab0b9": "lenovo_setup",
"f46ee6f4-4785-43a3-923d-7f786c3c8479": "lenovo_startup_interrupt",
"126a762d-5758-4fca-8531-201a7f57f850": "lenovo_boot_menu",
"a7d8d9a6-6ab0-4aeb-ad9d-163e59a7a380": "lenovo_diag_splash",
"_comment_10": "Company UUIDs (From Internet searches)",
"77fa9abd-0359-4d32-bd60-28f4e78f784b": "Microsoft Inc.",
"f5a96b31-dba0-4faa-a42a-7a0c9832768e": "HPE Inc.",
"2879c886-57ee-45cc-b126-f92f24f906b9": "SUSE Certificate",
"70564dce-9afc-4ee3-85fc-949649d7e45c": "Dell Inc.",
"_comment_11": "Intel GUIDS",
"bfcc0833-2125-42d1-8c6d-13821e23c078": "Intel(R) Desktop Boards",
"80b3ad5b-9880-4af9-a645-e56a68be89de": "Intel(R) CISD FW Update",
"_comment_12": "Microsoft GUIDS",
"e3c9e316-0b5c-4db8-817d-f92df00215ae": "Microsoft Reserved Partition (MSR)",
"5808c8aa-7e8f-42e0-85d2-e1e90434cfb3": "Logical Disk Manager (LDM) metadata partition ",
"af9b60a0-1431-4f62-bc68-3311714a69ad": "Logical Disk Manager data partition",
"de94bba4-06d1-4d40-a16a-bfd50179d6ac": "Windows Recovery Environment",
"9f25ee7a-e7b7-11db-94b5-f7e662935912": "Windows Boot Loader",
"_comment_13": "Linux specific GUIDS",
"0fc63daf-8483-4772-8e79-3d69d8477de": "Linux filesystem data",
"44479540-f297-41b2-9af7-d131d5f0458a4": "Root partition (x86)",
"69dad710-2ce4-4e3c-b16c-21a1d49abed3": "Root partition (32-bit ARM)",
"b921b045-1df0-41c3-af44-4c6f280d3fae": "Root partition (64-bit ARM/AArch64)",
"0657fd6d-a4ab-43c4-84e5-0933c84b4f4f": "Swap partition",
"3b8f8425-20e0-4f3b-907f-1a25a76f98e8": "/srv (server data) partition",
"7ffec5c9-2d00-49b7-8941-3ea10a5586b7": "Plain dm-crypt partitiont",
"ca7d7ccb-63ed-4c53-861c-1742536059cc": "LUKS partition",
"_comment_14": "Linux Boot GUIDS https://github.com/linuxboot/linuxboot/blob/master/boards/s2600wf/vendor-files.txt",
"9cfd802c-09a1-43d6-8217-aa49c1f90d2c": "Intel Management Engine BIOS Extension (Mebx)",
"b62efbbb-3923-4cb9-a6e8-db818e828a80": "Intel Management Engine BIOS Extension (Mebx) Setup Browser",
"9ce4325e-003e-11e3-b582-b8ac6f199a57": "Non-Volatile Dual In-line Memory Module (NVDIMM) Driver",
"ea9de6d5-7839-46f7-9e63-4de8b00e2e5d": "NVM DIMM Human Interface Infrastructure (HII)",
"56a1b86f-0d4a-485d-87de-ad0eba1c8c2a": "IBM C Video Gop",
"a1f436ea-a127-4ef8-957c-8048606ff670": "SnpDxe",
"a210f973-229d-4f4d-aa37-9895e6c9eaba": "DpcDxe",
"025bbfc7-e6a9-4b8b-82ad-6815a1aeaf4a": "MNP Network Service Driver - MnpDxe",
"b44b2005-42bc-41c9-80af-abd7dc7d6923": "RSTesSATAEFI",
"15e1e31a-9f9d-4c84-82fb-1a707fc0f63b": "RSTeSATAEFI",
"2cc25173-bd9f-4c89-89cc-29256a3fd9c3": "RSTesSATALegacy",
"bd5d4ca5-674f-4584-8cf9-ce4ea1f54dd1": "RSTeSATALegacy",
"_comment_15": "WinNt GUIDs, add if they are still found in use https://sourceforge.net/p/uefinotes/wiki/FV%20Sources/?version=3",
"fc5c7020-1a48-4198-9be2-ead5abc8cf2f": "BdsDxe",
"d0893f05-b06d-4161-b947-9be9b85ac3a1": "SnpNt32Dxe",
"9b3ada4f-ae56-4c24-8Dea-f03b7558ae50": "PcdPeim",
"34c8c28F-b61c-45a2-8f2e-89e46becc63b": "PeiVariable",
"fe5cea76-4f72-49e8-986f-2cd899dffe5d": "FaultTolerantWriteDxe",
"_comment_16": "Linux Boot Image files UEFI Platform Initialization (PI) specifications Driver Execution Environment (DXE) Architectural protocols and platform modules https://github.com/linuxboot/linuxboot/blob/master/boards/winterfell/image-files.txt",
"5ae3f37e-4eae-41ae-8240-35465b5e81eb": "CORE_DXE",
"cbc59c4a-383a-41eb-a8ee-4498aea567e4": "DXE Runtime",
"3c1de39f-d207-408a-aacc-731cfb7f1dd7": "DXE PciBus",
"80e66e0a-ccd1-43fa-a7b1-2d5ee0f13910": "DXE PciRootBridge",
"9f3a0016-ae55-4288-829d-d22fd344c347": "DXE AmiBoardInfo",
"13ac6dd0-73d0-11d4-b06b-00aa00bd6de7": "DXE EBC",
"e03abadf-e536-4e88-b3a0-b77f78eb34fe": "CPU DXE",
"b7d19491-e55a-470d-8508-85a5dfa41974": "SBDXE",
"e23f86e1-056e-4888-b685-cfcd67c179d4": "DXE SBRun",
"e4ecd0b2-e277-4f2b-becb-e4d75c9a812e": "NBDXE",
"5ad34ba6-f024-2149-52e4-da0398e2bb9": "DXE Services Table",
"_comment_17": "ACPI configuration and tables",
"750890a6-7acf-4f4f-81bd-b400c2bea95a": "AcpiModeEnable",
"d4c05cd1-5eae-431d-a095-13a9e5822045": "MPST",
"db93cb2c-bf1c-431a-abc8-8737bc2afc1f": "PRAD-ACPI-table",
"3bc5b795-a4e0-4d56-9321-316d18a7aefe": "PRAD",
"16d0a23e-c09c-407d-a14a-ad058fdd0ca1": "ACPI",
"26a2481e-4424-46a2-9943-cc4039ead8f8": "S3Save",
"efd652cc-0e99-40f0-96c0-e08c089070fc": "S3Restore",
"8c783970-f02a-4a4d-af09-8797a51eec8d": "PowerManagement",
"299141bb-211a-48a5-92c0-6f9a0a3a006e0": "PowerManagement-ACPI-table",
"2df10014-cf21-4280-8c3f-e539b8ee5150": "PpmPolicyInitDxe",
"4b680e2d-0d63-4f62-b930-7ae995b9b3a3": "SmBusDxe",
"_comment_18": "SMM handlers",
"4a37320b-3fb3-4365-9730-9e89c600395d": "SmmDispatcher",
"753630c9-fae5-47a9-bbbf-88d621cd7282": "SmmChildDispatcher",
"be216ba8-38c4-4535-a6ca-5dca5b43addf": "SmiVariable",
"a56897a1-a77f-4600-84db-22b0a801fa9a": "SmmRuntime",
"d2596f82-f0e1-49fa-95bc-62012c795728": "SmmBase Data",
"69009842-63f2-43db-964b-efad1c39ec85": "SmmBase Data",
"d0632c90-afd7-4492-b186-257c63143c61": "SmmBase",
"7e2d983f-f703-4a29-9761-77b51f5354ed": "SmmCommunicate",
"_comment_19": "CMOS and NVRAM handlers",
"6869c5b3-ac8d-4973-8b37-e354dbf34add": "CmosManagerSmm",
"842a454a-75e5-408b-8b1c-36420e4e3f21": "NvramSmi",
"5446c293-339b-47cd-b719-585de39408cc": "PostReport",
"71ca9ca1-325d-4bfe-afa3-2ec5c94a8680": "DmAcpi",
"cef68c66-06ab-4fb3-a3ed-5ffa885b5725": "SMBiosBoard",
"b13edd38-684c-41ed-a305-d7b7e32497df": "SMBios64",
"ded7956d-7e20-4f20-91a1-190439b04d5b": "SmbiosGetFlashData64",
"daf4bf89-ce71-4917-b522-c89d32fbc59f": "SmbiosStaticData",
"_comment_20": "Apple GUIDS",
"48465300-0000-11aa-aa11-00306543ecac": "Apple Hierarchical File System Plus (HFS+) partition ",
"7c3457ef-0000-11aa-aa11-00306543ecac": "Apple APFS container",
"55465300-0000-11aa-aa11-00306543ecac": "Apple UFS container",
"52414944-0000-11aa-aa11-00306543ecac": "Apple RAID partition",
"4c616265-6c00-11aa-aa11-00306543ecac": "Apple Label",
"53746f72-6167-11aa-aa11-00306543ecac": "Apple Core Storage Container",
"6a898cc3-1dd2-11b2-99a6-080020736631": "ZFS Partition",
"_comment_21": "Chrome OS GUIDS",
"2568845d-2332-4675-bc39-8fa5a4748d15": "Chrome OS kernel ",
"3cb8e202-3b7e-47dd-8a3c-7ff2a13cfcec": "Chrome OS rootfs ",
"2e0a753d-9e48-43b0-8337-b15192cb1b5e": "Chrome OS future use ",
"_comment_22": "Android GUIDS",
"fe3a2a5d-4f32-41a7-b725-accc3285a309": "Android Bootloader",
"114eaffe-1552-4022-b26e-9b053604cf84": "Android Bootloader 2",
"49a4d17f-93a3-45c1-a0de-f50b2ebe2599": "Android Boot",
"4177c722-9e92-4aab-8644-43502bfd5506": "Android Recovery",
"38f428e6-d326-425d-9140-6e0ea133647c": "Android System",
"bd59408b-4514-490d-bf12-9878d963f378": "Android Config",
"8f68cc74-c5e5-48da-be91-a0c8c15e9c80": "Android Factory",
"ac6d7924-eb71-4df8-b48d-e267b27148ff": "Android OEM",
"_comment_23": "MISC GUIDs",
"5023b95c-db26-429b-a648-bd47664c8012": "Built-in EFI Shell",
"610a0202-d308-00c4-0000-000004300d06": "Mystery UUID",
"00000000-0000-0000-0000-000000000000": "Empty UUID"
}
}