issue_847: fixed merge conflicts

This commit is contained in:
TheSilentCoder 2024-11-08 10:33:34 -05:00
commit 07cc787599
82 changed files with 1828 additions and 3684 deletions

View File

@ -28,7 +28,7 @@ import java.util.Map;
@Entity
@Getter
@EqualsAndHashCode
@EqualsAndHashCode(callSuper = true)
@Log4j2
public class IDevIDCertificate extends Certificate {

View File

@ -26,7 +26,7 @@ import org.apache.commons.codec.binary.Hex;
@Log4j2
@Getter
@ToString
@EqualsAndHashCode
@EqualsAndHashCode(callSuper = false)
@Embeddable
@XmlAccessorType(XmlAccessType.FIELD)
public final class TPMMeasurementRecord extends ExaminableRecord {

View File

@ -166,22 +166,22 @@ public class BaseReferenceManifest extends ReferenceManifest {
*/
private void parseSoftwareMeta(final Element softwareMeta) {
if (softwareMeta != null) {
this.colloquialVersion = softwareMeta.getAttribute(SwidTagConstants._COLLOQUIAL_VERSION_STR);
this.product = softwareMeta.getAttribute(SwidTagConstants._PRODUCT_STR);
this.revision = softwareMeta.getAttribute(SwidTagConstants._REVISION_STR);
this.edition = softwareMeta.getAttribute(SwidTagConstants._EDITION_STR);
this.rimLinkHash = softwareMeta.getAttribute(SwidTagConstants._RIM_LINK_HASH_STR);
this.bindingSpec = softwareMeta.getAttribute(SwidTagConstants._BINDING_SPEC_STR);
this.bindingSpecVersion = softwareMeta.getAttribute(SwidTagConstants._BINDING_SPEC_VERSION_STR);
this.colloquialVersion = softwareMeta.getAttribute(SwidTagConstants.COLLOQUIAL_VERSION_STR);
this.product = softwareMeta.getAttribute(SwidTagConstants.PRODUCT_STR);
this.revision = softwareMeta.getAttribute(SwidTagConstants.REVISION_STR);
this.edition = softwareMeta.getAttribute(SwidTagConstants.EDITION_STR);
this.rimLinkHash = softwareMeta.getAttribute(SwidTagConstants.RIM_LINK_HASH_STR);
this.bindingSpec = softwareMeta.getAttribute(SwidTagConstants.BINDING_SPEC_STR);
this.bindingSpecVersion = softwareMeta.getAttribute(SwidTagConstants.BINDING_SPEC_VERSION_STR);
this.setPlatformManufacturerId(
softwareMeta.getAttribute(SwidTagConstants._PLATFORM_MANUFACTURER_ID_STR));
softwareMeta.getAttribute(SwidTagConstants.PLATFORM_MANUFACTURER_ID_STR));
this.setPlatformManufacturer(
softwareMeta.getAttribute(SwidTagConstants._PLATFORM_MANUFACTURER_STR));
this.setPlatformModel(softwareMeta.getAttribute(SwidTagConstants._PLATFORM_MODEL_STR));
this.platformVersion = softwareMeta.getAttribute(SwidTagConstants._PLATFORM_VERSION_STR);
this.payloadType = softwareMeta.getAttribute(SwidTagConstants._PAYLOAD_TYPE_STR);
this.pcURIGlobal = softwareMeta.getAttribute(SwidTagConstants._PC_URI_GLOBAL_STR);
this.pcURILocal = softwareMeta.getAttribute(SwidTagConstants._PC_URI_LOCAL_STR);
softwareMeta.getAttribute(SwidTagConstants.PLATFORM_MANUFACTURER_FULL_STR));
this.setPlatformModel(softwareMeta.getAttribute(SwidTagConstants.PLATFORM_MODEL_STR));
this.platformVersion = softwareMeta.getAttribute(SwidTagConstants.PLATFORM_VERSION_STR);
this.payloadType = softwareMeta.getAttribute(SwidTagConstants.PAYLOAD_TYPE_STR);
this.pcURIGlobal = softwareMeta.getAttribute(SwidTagConstants.PC_URI_GLOBAL_STR);
this.pcURILocal = softwareMeta.getAttribute(SwidTagConstants.PC_URI_LOCAL_STR);
} else {
log.warn("SoftwareMeta Tag not found.");
}
@ -248,7 +248,7 @@ public class BaseReferenceManifest extends ReferenceManifest {
try {
document = unmarshallSwidTag(byteArrayInputStream);
} catch (UnmarshalException e) {
log.error("Error while parsing Directory tag: " + e.getMessage());
log.error("Error while parsing Directory tag: {}", e.getMessage());
}
if (document != null) {
Element softwareIdentity =
@ -293,8 +293,8 @@ public class BaseReferenceManifest extends ReferenceManifest {
swidResource = new SwidResource();
swidResource.setName(file.getAttribute(SwidTagConstants.NAME));
swidResource.setSize(file.getAttribute(SwidTagConstants.SIZE));
swidResource.setHashValue(file.getAttribute(SwidTagConstants._SHA256_HASH.getPrefix() + ":"
+ SwidTagConstants._SHA256_HASH.getLocalPart()));
swidResource.setHashValue(file.getAttribute(SwidTagConstants.SHA_256_HASH.getPrefix() + ":"
+ SwidTagConstants.SHA_256_HASH.getLocalPart()));
validHashes.add(swidResource);
}

View File

@ -27,7 +27,7 @@ import java.util.Collection;
*/
@Getter
@Setter
@EqualsAndHashCode
@EqualsAndHashCode(callSuper = false)
@Log4j2
@Entity
public class EventLogMeasurements extends SupportReferenceManifest {

View File

@ -3,8 +3,8 @@ plugins {
id 'checkstyle'
}
// Get version from main project gradle
def packVersion = properties.get("packageVersion");
def jarVersion = properties.get("jarVersion");
def packVersion = properties.get("packageVersion")
def jarVersion = properties.get("jarVersion")
//println "packageVersion is ${projVersion}"

View File

@ -27,17 +27,6 @@ import java.util.List;
@Log4j2
public final class PciIds {
/**
* Track status of pciids file.
*/
@Getter
private static String pciidsFileStatus = UefiConstants.FILESTATUS_NOT_ACCESSIBLE;
/**
* Name of pciids file in code.
*/
private static final String PCIIDS_FILENAME = "/pci.ids";
/**
* This pci ids file can be in different places on different distributions.
* Fedora/RHEL/Rocky/CentOS: /usr/share/hwdata/pci.ids
@ -48,19 +37,28 @@ public final class PciIds {
public static final List<String> PCI_IDS_PATH =
Collections.unmodifiableList(new ArrayList<>() {
private static final long serialVersionUID = 1L;
{
add("/usr/share/hwdata/pci.ids");
add("/usr/share/misc/pci.ids");
add("/tmp/pci.ids");
}
});
/**
* The PCI IDs Database object.
* This only needs to be loaded one time.
* The pci ids library protects the data inside the object by making it immutable.
*/
public static final PciIdsDatabase DB = new PciIdsDatabase();
/**
* Name of pciids file in code.
*/
private static final String PCIIDS_FILENAME = "/pci.ids";
/**
* Track status of pciids file.
*/
@Getter
private static String pciidsFileStatus = UefiConstants.FILESTATUS_NOT_ACCESSIBLE;
//Configure the PCI IDs Database object.
static {
@ -124,7 +122,8 @@ public final class PciIds {
/**
* Default private constructor so checkstyles doesn't complain.
*/
private PciIds() { }
private PciIds() {
}
/**
* Look up the vendor name from the PCI IDs list, if the input string contains an ID.

View File

@ -17,6 +17,16 @@ public final class StringValidator {
private final String fieldName;
private final Logger logger;
private StringValidator(final String value, final String fieldName, final Logger logger) {
this.value = value;
this.fieldName = fieldName;
if (logger == null) {
this.logger = log;
} else {
this.logger = logger;
}
}
/**
* Begins a validation operation.
*
@ -41,16 +51,6 @@ public final class StringValidator {
return new StringValidator(value, fieldName, logger);
}
private StringValidator(final String value, final String fieldName, final Logger logger) {
this.value = value;
this.fieldName = fieldName;
if (logger == null) {
this.logger = log;
} else {
this.logger = logger;
}
}
/**
* Assert that the given field is not null. Throws an IllegalArgumentException if the value
* is indeed null.

View File

@ -34,15 +34,14 @@ public final class Digest extends AbstractDigest {
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;
private static final String SHA1_EMPTY_HEX =
"da39a3ee5e6b4b0d3255bfef95601890afd80709";
static {
try {
SHA1_OF_NO_DATA = new Digest(
@ -59,10 +58,10 @@ public final class Digest extends AbstractDigest {
columnDefinition = "varbinary(64)")
private final byte[] digest;
@Getter
@XmlElement
@Column(nullable = false)
@Enumerated(EnumType.ORDINAL)
@Getter
private final DigestAlgorithm algorithm;
/**
@ -81,6 +80,7 @@ public final class Digest extends AbstractDigest {
/**
* Creates a new <code>Digest</code> when an algorithm isn't specified.
*
* @param digest byte array value
*/
public Digest(final byte[] digest) {
@ -90,11 +90,22 @@ public final class Digest extends AbstractDigest {
/**
* Default constructor necessary for Hibernate.
*/
protected Digest() {
private Digest() {
this.algorithm = null;
this.digest = null;
}
/**
* 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));
}
/**
* Retrieves the digest.
*
@ -113,15 +124,4 @@ public final class Digest extends AbstractDigest {
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

@ -3,7 +3,6 @@ package hirs.utils.digest;
/**
* Enumeration identifying the different outcomes of a comparison between
* two {@link Digest} objects.
*
*/
public enum DigestComparisonResultType {
/**

View File

@ -23,12 +23,12 @@ import java.util.Arrays;
@Access(AccessType.FIELD)
public final class OptionalDigest extends AbstractDigest {
@XmlElement
@Column(nullable = true, name = "digest", length = SHA512_DIGEST_LENGTH,
@Column(name = "digest", length = SHA512_DIGEST_LENGTH,
columnDefinition = "varbinary(64)")
private final byte[] digest;
@XmlElement
@Column(nullable = true)
@Column
@Enumerated(EnumType.ORDINAL)
@Getter
private final DigestAlgorithm algorithm;
@ -50,11 +50,22 @@ public final class OptionalDigest extends AbstractDigest {
/**
* Default constructor necessary for Hibernate.
*/
protected OptionalDigest() {
private OptionalDigest() {
this.algorithm = null;
this.digest = null;
}
/**
* 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));
}
/**
* Returns the digest.
*
@ -73,15 +84,4 @@ public final class OptionalDigest extends AbstractDigest {
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

@ -18,6 +18,7 @@ public final class DeviceInfoEnums {
* Constant variable representing the various Long sized strings.
*/
public static final int LONG_STRING_LENGTH = 255;
/**
* Default private constructor so checkstyles doesn't complain.
*/

View File

@ -12,8 +12,7 @@ public class PolicyManagerException extends RuntimeException {
* Creates a new <code>PolicyManagerException</code> that has the message
* <code>msg</code>.
*
* @param msg
* exception message
* @param msg exception message
*/
public PolicyManagerException(final String msg) {
super(msg);
@ -23,8 +22,7 @@ public class PolicyManagerException extends RuntimeException {
* Creates a new <code>PolicyManagerException</code> that wraps the given
* <code>Throwable</code>.
*
* @param t
* root cause
* @param t root cause
*/
public PolicyManagerException(final Throwable t) {
super(t);
@ -34,10 +32,8 @@ public class PolicyManagerException extends RuntimeException {
* Creates a new <code>PolicyManagerException</code> that has the message
* <code>msg</code> and wraps the root cause.
*
* @param msg
* exception message
* @param t
* root cause
* @param msg exception message
* @param t root cause
*/
public PolicyManagerException(final String msg, final Throwable t) {
super(msg, t);

View File

@ -277,8 +277,8 @@ public class ReferenceManifestValidator {
filepath = file.getAttribute(SwidTagConstants.NAME);
}
if (getHashValue(filepath, "SHA256").equals(
file.getAttribute(SwidTagConstants._SHA256_HASH.getPrefix() + ":"
+ SwidTagConstants._SHA256_HASH.getLocalPart()))) {
file.getAttribute(SwidTagConstants.SHA_256_HASH.getPrefix() + ":"
+ SwidTagConstants.SHA_256_HASH.getLocalPart()))) {
log.info("Support RIM hash verified for {}", filepath);
return true;
} else {
@ -377,7 +377,7 @@ public class ReferenceManifestValidator {
*
* @param signature the signature that failed to validate
* @param context the context used for validation
* @throws XMLSignatureException
* @throws XMLSignatureException if there is an issue validating the provided signature
*/
private void whySignatureInvalid(final XMLSignature signature, final DOMValidateContext context)
throws XMLSignatureException {
@ -415,7 +415,7 @@ public class ReferenceManifestValidator {
throws Exception {
if (cert == null || trustStore == null) {
throw new Exception("Null certificate or truststore received");
} else if (trustStore.size() == 0) {
} else if (trustStore.isEmpty()) {
throw new Exception("Truststore is empty");
}
@ -542,9 +542,8 @@ public class ReferenceManifestValidator {
*
* @param pemString the input string
* @return an X509Certificate created from the string, or null
* @throws Exception if certificate cannot be successfully parsed
*/
private X509Certificate parseCertFromPEMString(final String pemString) throws Exception {
private X509Certificate parseCertFromPEMString(final String pemString) {
String certificateHeader = "-----BEGIN CERTIFICATE-----";
String certificateFooter = "-----END CERTIFICATE-----";
try {
@ -614,7 +613,7 @@ public class ReferenceManifestValidator {
*
* @param certificate the cert to pull the subjectKeyIdentifier from
* @return the String representation of the subjectKeyIdentifier
* @throws IOException
* @throws IOException if there are issues retrieving the certificate subject key identifier
*/
private String getCertificateSubjectKeyIdentifier(final X509Certificate certificate)
throws IOException {
@ -631,7 +630,7 @@ public class ReferenceManifestValidator {
/**
* This method parses the subject key identifier from the KeyName element of a signature.
*
* @param doc
* @param doc document
* @return SKID if found, or an empty string.
*/
private String getKeyName(final Document doc) {

View File

@ -78,83 +78,83 @@ public final class SwidTagConstants {
public static final String FX_SEPARATOR = ":";
public static final String RFC3852_PFX = "rcf3852";
public static final String RFC3339_PFX = "rcf3339";
public static final String _COLLOQUIAL_VERSION_STR = N8060_PFX + FX_SEPARATOR
public static final String COLLOQUIAL_VERSION_STR = N8060_PFX + FX_SEPARATOR
+ COLLOQUIAL_VERSION;
public static final String _PRODUCT_STR = N8060_PFX + FX_SEPARATOR
public static final String PRODUCT_STR = N8060_PFX + FX_SEPARATOR
+ PRODUCT;
public static final String _REVISION_STR = N8060_PFX + FX_SEPARATOR
public static final String REVISION_STR = N8060_PFX + FX_SEPARATOR
+ REVISION;
public static final String _EDITION_STR = N8060_PFX + FX_SEPARATOR
public static final String EDITION_STR = N8060_PFX + FX_SEPARATOR
+ EDITION;
public static final String _RIM_LINK_HASH_STR = RIM_PFX + FX_SEPARATOR
public static final String RIM_LINK_HASH_STR = RIM_PFX + FX_SEPARATOR
+ RIM_LINK_HASH;
public static final String _BINDING_SPEC_STR = RIM_PFX + FX_SEPARATOR
public static final String BINDING_SPEC_STR = RIM_PFX + FX_SEPARATOR
+ BINDING_SPEC;
public static final String _BINDING_SPEC_VERSION_STR = RIM_PFX + FX_SEPARATOR
public static final String BINDING_SPEC_VERSION_STR = RIM_PFX + FX_SEPARATOR
+ BINDING_SPEC_VERSION;
public static final String _PLATFORM_MANUFACTURER_STR = RIM_PFX + FX_SEPARATOR
public static final String PLATFORM_MANUFACTURER_FULL_STR = RIM_PFX + FX_SEPARATOR
+ PLATFORM_MANUFACTURER_STR;
public static final String _PLATFORM_MANUFACTURER_ID_STR = RIM_PFX + FX_SEPARATOR
public static final String PLATFORM_MANUFACTURER_ID_STR = RIM_PFX + FX_SEPARATOR
+ PLATFORM_MANUFACTURER_ID;
public static final String _PLATFORM_MODEL_STR = RIM_PFX + FX_SEPARATOR
public static final String PLATFORM_MODEL_STR = RIM_PFX + FX_SEPARATOR
+ PLATFORM_MODEL;
public static final String _PLATFORM_VERSION_STR = RIM_PFX + FX_SEPARATOR
public static final String PLATFORM_VERSION_STR = RIM_PFX + FX_SEPARATOR
+ PLATFORM_VERSION;
public static final String _PAYLOAD_TYPE_STR = RIM_PFX + FX_SEPARATOR
public static final String PAYLOAD_TYPE_STR = RIM_PFX + FX_SEPARATOR
+ PAYLOAD_TYPE;
public static final String _PC_URI_LOCAL_STR = RIM_PFX + FX_SEPARATOR
public static final String PC_URI_LOCAL_STR = RIM_PFX + FX_SEPARATOR
+ PC_URI_LOCAL;
public static final String _PC_URI_GLOBAL_STR = RIM_PFX + FX_SEPARATOR
public static final String PC_URI_GLOBAL_STR = RIM_PFX + FX_SEPARATOR
+ PC_URI_GLOBAL;
public static final QName _SHA256_HASH = new QName(
public static final QName SHA_256_HASH = new QName(
"http://www.w3.org/2001/04/xmlenc#sha256", HASH, "SHA256");
public static final QName _COLLOQUIAL_VERSION = new QName(
public static final QName QNAME_COLLOQUIAL_VERSION = new QName(
NIST_NS, COLLOQUIAL_VERSION, N8060_PFX);
public static final QName _EDITION = new QName(
public static final QName QNAME_EDITION = new QName(
NIST_NS, EDITION, N8060_PFX);
public static final QName _PRODUCT = new QName(
public static final QName QNAME_PRODUCT = new QName(
NIST_NS, PRODUCT, N8060_PFX);
public static final QName _REVISION = new QName(
public static final QName QNAME_REVISION = new QName(
NIST_NS, REVISION, N8060_PFX);
public static final QName _PAYLOAD_TYPE = new QName(
public static final QName QNAME_PAYLOAD_TYPE = new QName(
TCG_NS, PAYLOAD_TYPE, RIM_PFX);
public static final QName _PLATFORM_MANUFACTURER = new QName(
public static final QName QNAME_PLATFORM_MANUFACTURER = new QName(
TCG_NS, PLATFORM_MANUFACTURER_STR, RIM_PFX);
public static final QName _PLATFORM_MANUFACTURER_ID = new QName(
public static final QName QNAME_PLATFORM_MANUFACTURER_ID = new QName(
TCG_NS, PLATFORM_MANUFACTURER_ID, RIM_PFX);
public static final QName _PLATFORM_MODEL = new QName(
public static final QName QNAME_PLATFORM_MODEL = new QName(
TCG_NS, PLATFORM_MODEL, RIM_PFX);
public static final QName _PLATFORM_VERSION = new QName(
public static final QName QNAME_PLATFORM_VERSION = new QName(
TCG_NS, PLATFORM_VERSION, RIM_PFX);
public static final QName _FIRMWARE_MANUFACTURER_STR = new QName(
public static final QName QNAME_FIRMWARE_MANUFACTURER_STR = new QName(
TCG_NS, FIRMWARE_MANUFACTURER_STR, RIM_PFX);
public static final QName _FIRMWARE_MANUFACTURER_ID = new QName(
public static final QName QNAME_FIRMWARE_MANUFACTURER_ID = new QName(
TCG_NS, FIRMWARE_MANUFACTURER_ID, RIM_PFX);
public static final QName _FIRMWARE_MODEL = new QName(
public static final QName QNAME_FIRMWARE_MODEL = new QName(
TCG_NS, FIRMWARE_MODEL, RIM_PFX);
public static final QName _FIRMWARE_VERSION = new QName(
public static final QName QNAME_FIRMWARE_VERSION = new QName(
TCG_NS, FIRMWARE_VERSION, RIM_PFX);
public static final QName _BINDING_SPEC = new QName(
public static final QName QNAME_BINDING_SPEC = new QName(
TCG_NS, BINDING_SPEC, RIM_PFX);
public static final QName _BINDING_SPEC_VERSION = new QName(
public static final QName QNAME_BINDING_SPEC_VERSION = new QName(
TCG_NS, BINDING_SPEC_VERSION, RIM_PFX);
public static final QName _PC_URI_LOCAL = new QName(
public static final QName QNAME_PC_URI_LOCAL = new QName(
TCG_NS, PC_URI_LOCAL, RIM_PFX);
public static final QName _PC_URI_GLOBAL = new QName(
public static final QName QNAME_PC_URI_GLOBAL = new QName(
TCG_NS, PC_URI_GLOBAL, RIM_PFX);
public static final QName _RIM_LINK_HASH = new QName(
public static final QName QNAME_RIM_LINK_HASH = new QName(
TCG_NS, RIM_LINK_HASH, RIM_PFX);
public static final QName _SUPPORT_RIM_TYPE = new QName(
public static final QName QNAME_SUPPORT_RIM_TYPE = new QName(
TCG_NS, SUPPORT_RIM_TYPE, RIM_PFX);
public static final QName _SUPPORT_RIM_FORMAT = new QName(
public static final QName QNAME_SUPPORT_RIM_FORMAT = new QName(
TCG_NS, SUPPORT_RIM_FORMAT, RIM_PFX);
public static final QName _SUPPORT_RIM_URI_GLOBAL = new QName(
public static final QName QNAME_SUPPORT_RIM_URI_GLOBAL = new QName(
TCG_NS, SUPPORT_RIM_URI_GLOBAL, RIM_PFX);
public static final QName _N8060_ENVVARPREFIX = new QName(
public static final QName N8060_ENVVARPREFIX = new QName(
NIST_NS, "envVarPrefix", N8060_PFX);
public static final QName _N8060_ENVVARSUFFIX = new QName(
public static final QName N8060_ENVVARSUFFIX = new QName(
NIST_NS, "envVarSuffix", N8060_PFX);
public static final QName _N8060_PATHSEPARATOR = new QName(
public static final QName N8060_PATHSEPARATOR = new QName(
NIST_NS, "pathSeparator", N8060_PFX);
public static final String CA_ISSUERS = "1.3.6.1.5.5.7.48.2";

View File

@ -12,8 +12,7 @@ public class TPMBaselineGeneratorException extends Exception {
* Creates a new <code>CreateTPMBaselineException</code> that has the
* message <code>msg</code>.
*
* @param msg
* exception message
* @param msg exception message
*/
TPMBaselineGeneratorException(final String msg) {
super(msg);
@ -23,8 +22,7 @@ public class TPMBaselineGeneratorException extends Exception {
* Creates a new <code>CreateTPMBaselineException</code> that wraps the
* given <code>Throwable</code>.
*
* @param t
* root cause
* @param t root cause
*/
TPMBaselineGeneratorException(final Throwable t) {
super(t);
@ -34,10 +32,8 @@ public class TPMBaselineGeneratorException extends Exception {
* 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
* @param msg exception message
* @param t root cause
*/
TPMBaselineGeneratorException(final String msg, final Throwable t) {
super(msg, t);

View File

@ -25,56 +25,104 @@ import java.util.LinkedHashMap;
*/
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 eventLogHashAlgorithm = "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.*/
/**
* Initial value for SHA 256 values.
*/
public static final String INIT_SHA256_LIST = "00000000000000000000000000"
+ "00000000000000000000000000000000000000";
/** Initial value for SHA 256 values.*/
/**
* Initial value for SHA 256 values.
*/
public static final String LOCALITY4_SHA256_LIST = "ffffffffffffffffffffffffff"
+ "ffffffffffffffffffffffffffffffffffffff";
/** Initial value for SHA 1 values. */
/**
* Initial value for SHA 1 values.
*/
public static final String INIT_SHA1_LIST = "0000000000000000000000000000000000000000";
/** Initial value for SHA 1 values. */
/**
* Initial value for SHA 1 values.
*/
public static final String LOCALITY4_SHA1_LIST = "ffffffffffffffffffffffffffffffffffffffff";
/** PFP defined EV_NO_ACTION identifier. */
/**
* PFP defined EV_NO_ACTION identifier.
*/
public static final int NO_ACTION_EVENT = 0x00000003;
/** String value of SHA1 hash.*/
/**
* String value of SHA1 hash.
*/
public static final String HASH_STRING = "SHA1";
/** String value of SHA256 hash. */
/**
* String value of SHA256 hash.
*/
public static final String HASH256_STRING = "SHA-256";
/** Each PCR bank holds 24 registers. */
/**
* Each PCR bank holds 24 registers.
*/
public static final int PCR_COUNT = 24;
/** Locality 4 starts at PCR 17. */
/**
* Locality 4 starts at PCR 17.
*/
public static final int PCR_LOCALITY4_MIN = 17;
/** Locality 4 Ends at PCR 23. */
/**
* 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. */
/**
* Logger.
*/
private static final Logger LOGGER = LogManager.getLogger(TCGEventLog.class);
/**
* Parsed event log array.
*/
private static final int SIG_OFFSET = 32;
/**
* TEV_NO_ACTION signature size.
*/
private static final int SIG_SIZE = 16;
/**
* Name of the hash algorithm used to process the Event Log, default is SHA256.
*/
@Getter
private String eventLogHashAlgorithm = "TPM_ALG_SHA256";
/**
* 2 dimensional array holding the PCR values.
*/
private final byte[][] pcrList;
/**
* List of parsed events within the log.
*/
private final LinkedHashMap<Integer, TpmPcrEvent> eventList = new LinkedHashMap<>();
/**
* Length of PCR. Indicates which hash algorithm is used.
*/
private final int pcrLength;
/**
* Name of hash algorithm.
*/
private final String hashType;
/**
* Initial PCR Value to use.
*/
private final String initValue;
/**
* Initial PcR Value to use for locality 4.
*/
private final String initLocalityFourValue;
/**
* Content Output Flag use.
*/
private boolean bContent = false;
/** Event Output Flag use. */
/**
* Event Output Flag use.
*/
private boolean bHexEvent = false;
/** Event Output Flag use. */
/**
* Event Output Flag use.
*/
private boolean bEvent = false;
/** Event Output Flag use. */
/**
* Event Output Flag use.
*/
@Getter
private boolean bCryptoAgile = false;
/**
@ -111,6 +159,7 @@ public final class TCGEventLog {
/**
* 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.
@ -123,6 +172,7 @@ public final class TCGEventLog {
/**
* 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.
@ -298,6 +348,7 @@ public final class TCGEventLog {
/**
* Returns a list of event found in the Event Log.
*
* @return an arraylist of event.
*/
public Collection<TpmPcrEvent> getEventList() {
@ -307,6 +358,7 @@ public final class TCGEventLog {
/**
* 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
*/
@ -326,6 +378,7 @@ public final class TCGEventLog {
/**
* Human readable string representing the contents of the Event Log.
*
* @return Description of the log.
*/
public String toString() {
@ -339,6 +392,7 @@ public final class TCGEventLog {
/**
* Human readable string representing the contents of the Event Log.
*
* @param event flag to set
* @param hexEvent flag to set
* @param content flag to set
@ -357,6 +411,7 @@ public final class TCGEventLog {
/**
* Returns the TCG Algorithm Registry defined ID for the Digest Algorithm
* used in the event log.
*
* @return TCG Defined Algorithm name
*/
public int getEventLogHashAlgorithmID() {

View File

@ -17,66 +17,80 @@ import java.math.BigInteger;
* } TPMT_HA;
*/
public class TcgTpmtHa {
/**
* 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;
/**
* 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.
* 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.
*/
@ -102,6 +116,61 @@ public class TcgTpmtHa {
System.arraycopy(digest, 0, buffer, algID.length, digest.length);
}
/**
* 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) {
return switch (algId) {
case TPM_ALG_SHA1 -> "TPM_ALG_SHA1";
case TPM_ALG_SHA256 -> "TPM_ALG_SHA256";
case TPM_ALG_SHA384 -> "TPM_ALG_SHA384";
case TPM_ALG_SHA_512 -> "TPM_ALG_SHA512";
case TPM_ALG_NULL -> "TPM_ALG_NULL";
default -> "Unknown or invalid Hash";
};
}
/**
* 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) {
return switch (algorithm) {
case "TPM_ALG_SHA1" -> TPM_ALG_SHA1;
case "TPM_ALG_SHA256" -> TPM_ALG_SHA256;
case "TPM_ALG_SHA384" -> TPM_ALG_SHA384;
case "TPM_ALG_SHA512" -> TPM_ALG_SHA_512;
default -> TPM_ALG_NULL;
};
}
/**
* 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) {
return switch (algId) {
case TPM_ALG_SHA1 -> TPM_ALG_SHA1_LENGTH;
case TPM_ALG_SHA256 -> TPM_ALG_SHA256_LENGTH;
case TPM_ALG_SHA384 -> TPM_ALG_SHA384_LENGTH;
case TPM_ALG_SHA_512 -> TPM_ALG_SHA512_LENGTH;
default -> TPM_ALG_NULL_LENGTH;
};
}
/**
* Returns the contents of the TPMT_HA structure buffer.
*
@ -120,96 +189,4 @@ public class TcgTpmtHa {
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

@ -3,17 +3,17 @@ package hirs.utils.tpm.eventlog;
import hirs.utils.HexUtils;
import hirs.utils.tpm.eventlog.events.EvCompactHash;
import hirs.utils.tpm.eventlog.events.EvConstants;
import hirs.utils.tpm.eventlog.events.EvEfiBootServicesApp;
import hirs.utils.tpm.eventlog.events.EvEfiGptPartition;
import hirs.utils.tpm.eventlog.events.EvEfiHandoffTable;
import hirs.utils.tpm.eventlog.events.EvEfiSpdmDeviceSecurityEvent;
import hirs.utils.tpm.eventlog.events.EvEventTag;
import hirs.utils.tpm.eventlog.events.EvIPL;
import hirs.utils.tpm.eventlog.events.EvNoAction;
import hirs.utils.tpm.eventlog.events.EvPostCode;
import hirs.utils.tpm.eventlog.events.EvSCrtmContents;
import hirs.utils.tpm.eventlog.events.EvSCrtmVersion;
import hirs.utils.tpm.eventlog.uefi.UefiConstants;
import hirs.utils.tpm.eventlog.events.EvEfiBootServicesApp;
import hirs.utils.tpm.eventlog.events.EvPostCode;
import hirs.utils.tpm.eventlog.uefi.UefiFirmware;
import hirs.utils.tpm.eventlog.uefi.UefiVariable;
import lombok.AccessLevel;
@ -61,60 +61,77 @@ public class TpmPcrEvent {
* Log format. SHA1=1, Crytpo agile=2.
* this can be refactored out
*/
@Getter @Setter(value = AccessLevel.PROTECTED)
@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
@Getter
@Setter
private int digestLength = 0;
/**
* Event hash for SHA1 event logs.
*/
private byte[] eventDataSha1hash;
/**
* Event hash for Crypto Agile events.
*/
private byte[] eventDataSha256hash;
@Setter @Getter
@Getter
@Setter
private int eventNumber;
@Setter @Getter
@Getter
@Setter
private boolean error = false;
/**
@ -147,403 +164,6 @@ public class TpmPcrEvent {
}
/**
* 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 data cryptographic hash
* @param length length of the cryptographic hash
*/
protected void setEventDigest(final byte[] data, final int length) {
digest = new byte[length];
System.arraycopy(data, 0, digest, 0, length);
}
/**
* 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 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()) {
specVersion = noAction.getSpecVersion();
specErrataVersion = noAction.getSpecErrataVersion();
}
} catch (UnsupportedEncodingException ueEx) {
log.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) {
log.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) {
log.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:
case EvConstants.EV_EFI_VARIABLE_BOOT:
case EvConstants.EV_EFI_VARIABLE_AUTHORITY:
case EvConstants.EV_EFI_SPDM_DEVICE_POLICY:
case EvConstants.EV_EFI_SPDM_DEVICE_AUTHORITY:
try {
sb.append(new UefiVariable(eventContent).toString());
} catch (CertificateException cEx) {
log.error(cEx);
sb.append(cEx.toString());
} catch (NoSuchAlgorithmException noSaEx) {
log.error(noSaEx);
sb.append(noSaEx.toString());
} catch (IOException ioEx) {
log.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) {
log.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) {
log.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;
case EvConstants.EV_EFI_SPDM_FIRMWARE_BLOB:
case EvConstants.EV_EFI_SPDM_FIRMWARE_CONFIG:
sb.append(new EvEfiSpdmDeviceSecurityEvent(eventContent).toString());
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 eventData the byte array holding the event data.
* @param content the byte array holding the event content.
* @param eventPosition 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 CertificateException if the event contains an event that cannot be processed.
* @throws NoSuchAlgorithmException if an event contains an unsupported algorithm.
* @throws java.io.IOException if the event cannot be parsed.
*/
public String processEvent(final byte[] eventData, final byte[] content,
final int eventPosition, final String hashName)
throws CertificateException, NoSuchAlgorithmException, IOException {
int eventID = (int) eventType;
this.eventNumber = eventPosition;
description += "Event# " + eventPosition + ": ";
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 encountered";
}
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(eventData);
eventDataSha1hash = md1.digest();
MessageDigest md2 = MessageDigest.getInstance("SHA-256");
md2.update(eventData);
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(content);
description += "Event Content:\n" + postCode.toString();
break;
case EvConstants.EV_UNUSED:
break;
case EvConstants.EV_NO_ACTION:
EvNoAction noAction = new EvNoAction(content);
description += "Event Content:\n" + noAction.toString();
if (noAction.isSpecIDEvent()) {
specVersion = noAction.getSpecVersion();
specErrataVersion = noAction.getSpecErrataVersion();
}
pciidsFileStatus = noAction.getPciidsFileStatus();
break;
case EvConstants.EV_SEPARATOR:
if (EvPostCode.isAscii(content)) {
String separatorEventData = new String(content, StandardCharsets.UTF_8);
if (!this.isBlank(content)) {
description += "Separator event content = " + separatorEventData;
}
}
break;
case EvConstants.EV_ACTION:
description += "Event Content:\n"
+ new String(content, StandardCharsets.UTF_8);
break;
case EvConstants.EV_EVENT_TAG:
EvEventTag eventTag = new EvEventTag(content);
description += eventTag.toString();
break;
case EvConstants.EV_S_CRTM_CONTENTS:
EvSCrtmContents sCrtmContents = new EvSCrtmContents(content);
description += "Event Content:\n " + sCrtmContents.toString();
break;
case EvConstants.EV_S_CRTM_VERSION:
EvSCrtmVersion sCrtmVersion = new EvSCrtmVersion(content);
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(content);
description += "Event Content:\n" + compactHash.toString();
break;
case EvConstants.EV_IPL:
EvIPL ipl = new EvIPL(content);
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:
case EvConstants.EV_EFI_VARIABLE_BOOT:
case EvConstants.EV_EFI_VARIABLE_AUTHORITY:
case EvConstants.EV_EFI_SPDM_DEVICE_POLICY:
case EvConstants.EV_EFI_SPDM_DEVICE_AUTHORITY:
UefiVariable efiVar = new UefiVariable(content);
description += "Event Content:\n" + efiVar.toString();
vendorTableFileStatus = efiVar.getVendorTableFileStatus();
break;
case EvConstants.EV_EFI_BOOT_SERVICES_APPLICATION:
case EvConstants.EV_EFI_BOOT_SERVICES_DRIVER:
EvEfiBootServicesApp bootServices = new EvEfiBootServicesApp(content);
description += "Event Content:\n" + bootServices.toString();
break;
case EvConstants.EV_EFI_RUNTIME_SERVICES_DRIVER:
break;
case EvConstants.EV_EFI_GPT_EVENT:
description += "Event Content:\n" + new EvEfiGptPartition(content).toString();
break;
case EvConstants.EV_EFI_ACTION:
description += new String(content, StandardCharsets.UTF_8);
break;
case EvConstants.EV_EFI_PLATFORM_FIRMWARE_BLOB:
description += "Event Content:\n"
+ new UefiFirmware(content).toString();
break;
case EvConstants.EV_EFI_HANDOFF_TABLES:
EvEfiHandoffTable efiTable = new EvEfiHandoffTable(content);
description += "Event Content:\n" + efiTable.toString();
break;
case EvConstants.EV_EFI_HCRTM_EVENT:
break;
case EvConstants.EV_EFI_SPDM_FIRMWARE_BLOB:
case EvConstants.EV_EFI_SPDM_FIRMWARE_CONFIG:
EvEfiSpdmDeviceSecurityEvent efiSpdmDse = new EvEfiSpdmDeviceSecurityEvent(content);
description += "Event Content:\n" + efiSpdmDse.toString();
pciidsFileStatus = efiSpdmDse.getPciidsFileStatus();
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.
@ -628,6 +248,374 @@ public class TpmPcrEvent {
}
}
/**
* 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 data cryptographic hash
* @param length length of the cryptographic hash
*/
protected void setEventDigest(final byte[] data, final int length) {
digest = new byte[length];
System.arraycopy(data, 0, digest, 0, length);
}
/**
* 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);
}
/**
* 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);
}
/**
* 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 evPostCode = new EvPostCode(eventContent);
System.arraycopy(eventData, 0, eventContent, 0, eventData.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));
break;
case EvConstants.EV_UNUSED, EvConstants.EV_IPL_PARTITION_DATA, EvConstants.EV_NONHOST_CODE,
EvConstants.EV_NONHOST_CONFIG, EvConstants.EV_NONHOST_INFO,
EvConstants.EV_EV_OMIT_BOOT_DEVICES_EVENTS, EvConstants.EV_EFI_EVENT_BASE,
EvConstants.EV_EFI_RUNTIME_SERVICES_DRIVER, EvConstants.EV_CPU_MICROCODE,
EvConstants.EV_PLATFORM_CONFIG_FLAGS, EvConstants.EV_TABLE_OF_DEVICES,
EvConstants.EV_EFI_HCRTM_EVENT:
break;
case EvConstants.EV_NO_ACTION:
EvNoAction noAction = null;
try {
noAction = new EvNoAction(eventContent);
sb.append(noAction);
if (noAction.isSpecIDEvent()) {
specVersion = noAction.getSpecVersion();
specErrataVersion = noAction.getSpecErrataVersion();
}
} catch (UnsupportedEncodingException ueEx) {
log.error(ueEx);
sb.append(ueEx);
}
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));
break;
case EvConstants.EV_S_CRTM_CONTENTS:
sb.append(new EvSCrtmContents(eventContent));
break;
case EvConstants.EV_S_CRTM_VERSION:
try {
sb.append(new EvSCrtmVersion(eventContent));
} catch (UnsupportedEncodingException ueEx) {
log.error(ueEx);
sb.append(ueEx);
}
break;
case EvConstants.EV_COMPACT_HASH:
try {
sb.append(new EvCompactHash(eventContent));
} catch (UnsupportedEncodingException ueEx) {
log.error(ueEx);
sb.append(ueEx);
}
break;
case EvConstants.EV_IPL:
sb.append(new EvIPL(eventContent));
break;
case EvConstants.EV_EFI_VARIABLE_DRIVER_CONFIG:
case EvConstants.EV_EFI_VARIABLE_BOOT:
case EvConstants.EV_EFI_VARIABLE_AUTHORITY:
case EvConstants.EV_EFI_SPDM_DEVICE_POLICY:
case EvConstants.EV_EFI_SPDM_DEVICE_AUTHORITY:
try {
sb.append(new UefiVariable(eventContent));
} catch (CertificateException | NoSuchAlgorithmException | IOException exception) {
log.error(exception);
sb.append(exception);
}
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));
} catch (UnsupportedEncodingException ueEx) {
log.error(ueEx);
sb.append(ueEx);
}
break;
case EvConstants.EV_EFI_GPT_EVENT:
try {
sb.append(new EvEfiGptPartition(eventContent));
} catch (UnsupportedEncodingException ueEx) {
log.error(ueEx);
sb.append(ueEx);
}
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));
break;
case EvConstants.EV_EFI_HANDOFF_TABLES:
sb.append(new EvEfiHandoffTable(eventContent));
break;
case EvConstants.EV_EFI_SPDM_FIRMWARE_BLOB:
case EvConstants.EV_EFI_SPDM_FIRMWARE_CONFIG:
sb.append(new EvEfiSpdmDeviceSecurityEvent(eventContent));
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 eventData the byte array holding the event data.
* @param content the byte array holding the event content.
* @param eventPosition 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 CertificateException if the event contains an event that cannot be processed.
* @throws NoSuchAlgorithmException if an event contains an unsupported algorithm.
* @throws java.io.IOException if the event cannot be parsed.
*/
public String processEvent(final byte[] eventData, final byte[] content,
final int eventPosition, final String hashName)
throws CertificateException, NoSuchAlgorithmException, IOException {
int eventID = (int) eventType;
this.eventNumber = eventPosition;
description += "Event# " + eventPosition + ": ";
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 encountered";
}
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(eventData);
eventDataSha1hash = md1.digest();
MessageDigest md2 = MessageDigest.getInstance("SHA-256");
md2.update(eventData);
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(content);
description += "Event Content:\n" + postCode;
break;
case EvConstants.EV_UNUSED, EvConstants.EV_EFI_RUNTIME_SERVICES_DRIVER,
EvConstants.EV_EFI_HCRTM_EVENT, EvConstants.EV_EFI_EVENT_BASE,
EvConstants.EV_EV_OMIT_BOOT_DEVICES_EVENTS, EvConstants.EV_NONHOST_INFO,
EvConstants.EV_NONHOST_CONFIG, EvConstants.EV_NONHOST_CODE,
EvConstants.EV_IPL_PARTITION_DATA, EvConstants.EV_PLATFORM_CONFIG_FLAGS,
EvConstants.EV_CPU_MICROCODE, EvConstants.EV_TABLE_OF_DEVICES:
break;
case EvConstants.EV_NO_ACTION:
EvNoAction noAction = new EvNoAction(content);
description += "Event Content:\n" + noAction;
if (noAction.isSpecIDEvent()) {
specVersion = noAction.getSpecVersion();
specErrataVersion = noAction.getSpecErrataVersion();
}
pciidsFileStatus = noAction.getPciidsFileStatus();
break;
case EvConstants.EV_SEPARATOR:
if (EvPostCode.isAscii(content)) {
String separatorEventData = new String(content, StandardCharsets.UTF_8);
if (!this.isBlank(content)) {
description += "Separator event content = " + separatorEventData;
}
}
break;
case EvConstants.EV_ACTION:
description += "Event Content:\n"
+ new String(content, StandardCharsets.UTF_8);
break;
case EvConstants.EV_EVENT_TAG:
EvEventTag eventTag = new EvEventTag(content);
description += eventTag.toString();
break;
case EvConstants.EV_S_CRTM_CONTENTS:
EvSCrtmContents sCrtmContents = new EvSCrtmContents(content);
description += "Event Content:\n " + sCrtmContents;
break;
case EvConstants.EV_S_CRTM_VERSION:
EvSCrtmVersion sCrtmVersion = new EvSCrtmVersion(content);
description += "Event Content:\n" + sCrtmVersion;
break;
case EvConstants.EV_COMPACT_HASH:
EvCompactHash compactHash = new EvCompactHash(content);
description += "Event Content:\n" + compactHash;
break;
case EvConstants.EV_IPL:
EvIPL ipl = new EvIPL(content);
description += "Event Content:\n" + ipl;
break;
case EvConstants.EV_EFI_VARIABLE_DRIVER_CONFIG:
case EvConstants.EV_EFI_VARIABLE_BOOT:
case EvConstants.EV_EFI_VARIABLE_AUTHORITY:
case EvConstants.EV_EFI_SPDM_DEVICE_POLICY:
case EvConstants.EV_EFI_SPDM_DEVICE_AUTHORITY:
UefiVariable efiVar = new UefiVariable(content);
description += "Event Content:\n" + efiVar;
vendorTableFileStatus = efiVar.getVendorTableFileStatus();
break;
case EvConstants.EV_EFI_BOOT_SERVICES_APPLICATION:
case EvConstants.EV_EFI_BOOT_SERVICES_DRIVER:
EvEfiBootServicesApp bootServices = new EvEfiBootServicesApp(content);
description += "Event Content:\n" + bootServices;
break;
case EvConstants.EV_EFI_GPT_EVENT:
description += "Event Content:\n" + new EvEfiGptPartition(content);
break;
case EvConstants.EV_EFI_ACTION:
description += new String(content, StandardCharsets.UTF_8);
break;
case EvConstants.EV_EFI_PLATFORM_FIRMWARE_BLOB:
description += "Event Content:\n"
+ new UefiFirmware(content);
break;
case EvConstants.EV_EFI_HANDOFF_TABLES:
EvEfiHandoffTable efiTable = new EvEfiHandoffTable(content);
description += "Event Content:\n" + efiTable;
break;
case EvConstants.EV_EFI_SPDM_FIRMWARE_BLOB:
case EvConstants.EV_EFI_SPDM_FIRMWARE_CONFIG:
EvEfiSpdmDeviceSecurityEvent efiSpdmDse = new EvEfiSpdmDeviceSecurityEvent(content);
description += "Event Content:\n" + efiSpdmDse;
pciidsFileStatus = efiSpdmDse.getPciidsFileStatus();
break;
default:
description += " Unknown Event found" + "\n";
}
return description;
}
/**
* Human readable output of a check of input against the current event hash.
*
@ -656,6 +644,7 @@ public class TpmPcrEvent {
/**
* 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.
*/
@ -720,11 +709,12 @@ public class TpmPcrEvent {
sb.append("Event content (Hex) (" + evContent.length + " bytes): "
+ Hex.encodeHexString(evContent));
}
return sb.toString() + "\n";
return sb + "\n";
}
/**
* Remove bad visual value text.
*
* @param text content to operate over.
* @return cleared string
*/

View File

@ -61,7 +61,7 @@ public class TpmPcrEvent2 extends TpmPcrEvent {
/**
* list of digests.
*/
private ArrayList<TcgTpmtHa> hashList = new ArrayList<>();
private final ArrayList<TcgTpmtHa> hashList = new ArrayList<>();
/**
* Constructor.

View File

@ -17,7 +17,7 @@ import lombok.Setter;
* . which implies the data is a DEVICE_SECURITY_EVENT_DATA or ..DATA2, respectively.
* Field 2:
* . The Version field also indicates whether the Device Security Event is ..DATA or ..DATA2.
*
* <p>
* DEVICE SECURITY EVENT structures defined by PFP v1.06 Rev 52:
* <p>
* typedef struct tdDEVICE_SECURITY_EVENT_DATA {
@ -39,18 +39,17 @@ import lombok.Setter;
* }
* <p>
*/
@Getter
public abstract class DeviceSecurityEvent {
/**
* DeviceSecurityEventDataContext Object.
*/
@Getter
private DeviceSecurityEventDataPciContext dsedPciContext = null;
/**
* Device type.
*/
@Getter
@Setter
private int deviceType = -1;
@ -58,7 +57,6 @@ public abstract class DeviceSecurityEvent {
* Human-readable description of the data within the
* DEVICE_SECURITY_EVENT_DATA_DEVICE_CONTEXT. DEVICE can be either PCI or USB.
*/
@Getter
private String deviceContextInfo = "";
/**
@ -70,12 +68,10 @@ public abstract class DeviceSecurityEvent {
* Status will only change IF this is an event that uses this file,
* and if that event causes a different status.
*/
@Getter
private String pciidsFileStatus = UefiConstants.FILESTATUS_FROM_FILESYSTEM;
/**
* DeviceSecurityEventData Default Constructor.
*
*/
public DeviceSecurityEvent() {
@ -85,7 +81,6 @@ public abstract class DeviceSecurityEvent {
* Parse the Device Context structure, can be PCI or USB based on device type field.
*
* @param dsedDeviceContextBytes byte array holding the DeviceSecurityEventData.
*
*/
public void instantiateDeviceContext(final byte[] dsedDeviceContextBytes) {

View File

@ -15,19 +15,9 @@ import lombok.Getter;
* } DEVICE_SECURITY_EVENT_DATA_DEVICE_CONTEXT;
* <p>
*/
@Getter
public abstract class DeviceSecurityEventDataDeviceContext {
/**
* PCI Version.
*/
@Getter
private int version = 0;
/**
* PCI Length.
*/
@Getter
private int length = 0;
/**
* Device Security Event Data Device Type = no device type.
*/
@ -40,6 +30,14 @@ public abstract class DeviceSecurityEventDataDeviceContext {
* Device Security Event Data Device Type = DEVICE_TYPE_USB.
*/
public static final int DEVICE_TYPE_USB = 2;
/**
* PCI Version.
*/
private int version = 0;
/**
* PCI Length.
*/
private int length = 0;
/**
* DeviceSecurityEventDataDeviceContext Constructor.

View File

@ -24,7 +24,6 @@ public abstract class DeviceSecurityEventDataSubHeader {
/**
* DeviceSecurityEventDataSubHeader Default Constructor.
*
*/
public DeviceSecurityEventDataSubHeader() {
}
@ -37,13 +36,10 @@ public abstract class DeviceSecurityEventDataSubHeader {
* @return name of the device type
*/
public static String subheaderTypeToString(final int subheaderTypeInt) {
switch (subheaderTypeInt) {
case SUBHEADERTYPE_MEAS_BLOCK:
return "SPDM Measurement Block";
case SUBHEADERTYPE_CERT_CHAIN:
return "SPDM Cert Chain";
default:
return "Unknown or invalid Subheader Type of value " + subheaderTypeInt;
}
return switch (subheaderTypeInt) {
case SUBHEADERTYPE_MEAS_BLOCK -> "SPDM Measurement Block";
case SUBHEADERTYPE_CERT_CHAIN -> "SPDM Cert Chain";
default -> "Unknown or invalid Subheader Type of value " + subheaderTypeInt;
};
}
}

View File

@ -175,6 +175,7 @@ public final class EvConstants {
* EFI SPDM Device Authority Event ID.
*/
public static final int EV_EFI_SPDM_DEVICE_AUTHORITY = 0x800000E4;
/**
* Default private constructor so checkstyles doesn't complain.
*/

View File

@ -50,25 +50,25 @@ import java.util.List;
*/
public class EvEfiGptPartition {
/**
* Header Size.
* Partition Length.
*/
private int headerSize = 0;
private static final int PARTITION_ENTRY_LENGTH = UefiConstants.SIZE_128;
/**
* Header bytes.
*/
private byte[] header = new byte[UefiConstants.SIZE_8];
private final byte[] header = new byte[UefiConstants.SIZE_8];
/**
* Number of partitions in this event.
*/
private int numberOfPartitions;
/**
* Partition Length.
*/
private int partitonEntryLength = UefiConstants.SIZE_128;
private final int numberOfPartitions;
/**
* List of Partitions.
*/
private List<UefiPartition> partitionList;
private final List<UefiPartition> partitionList;
/**
* Header Size.
*/
private int headerSize = 0;
/**
* GPT Partition Event Type constructor.
@ -89,7 +89,7 @@ public class EvEfiGptPartition {
byte[] partitions = new byte[UefiConstants.SIZE_8];
System.arraycopy(eventDataBytes, headerSize, partitions, 0, UefiConstants.SIZE_8);
numberOfPartitions = getIntFromBytes(partitions);
int partitionLength = numberOfPartitions * partitonEntryLength;
int partitionLength = numberOfPartitions * PARTITION_ENTRY_LENGTH;
byte[] partitionEntries = new byte[partitionLength];
System.arraycopy(eventDataBytes, headerSize + UefiConstants.SIZE_8, partitionEntries,
0, partitionLength);
@ -108,16 +108,16 @@ public class EvEfiGptPartition {
throws UnsupportedEncodingException {
byte[] partitionData = new byte[UefiConstants.SIZE_128];
for (int i = 0; i < numOfPartitions; i++) {
System.arraycopy(partitions, i * partitonEntryLength, partitionData, 0,
partitonEntryLength);
System.arraycopy(partitions, i * PARTITION_ENTRY_LENGTH, partitionData, 0,
PARTITION_ENTRY_LENGTH);
partitionList.add(new UefiPartition(partitionData));
}
}
/**
* Provides a human readable string describing the GPT Partition information.
* Provides a human-readable string describing the GPT Partition information.
*
* @return a human readable string holding the partition information.
* @return a human-readable string holding the partition information.
*/
public String toString() {
String headerStr = HexUtils.byteArrayToHexString(header);

View File

@ -31,20 +31,19 @@ import java.util.ArrayList;
* standard that define the particular table.
*/
public class EvEfiHandoffTable {
/**
* List of Vendor GUIDs.
*/
private final ArrayList<UefiGuid> vendorGuids = new ArrayList<>();
/**
* List of Vendors.
*/
private final ArrayList<byte[]> vendorTables = new ArrayList<>();
/**
* 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;
/**
@ -122,7 +121,7 @@ public class EvEfiHandoffTable {
}
/**
* Returns a human readable description of the hand off tables.
* Returns a human-readable description of the hand off tables.
*
* @return a human readable description.
*/

View File

@ -13,6 +13,7 @@ public class EvIPL {
/**
* IPL Event Constructor.
*
* @param event byte array holding the IPL Event data.
*/
public EvIPL(final byte[] event) {
@ -21,6 +22,7 @@ public class EvIPL {
/**
* Processes IPL event.
*
* @param event byte array holding the IPL Event data.
* @return a description of the IPl event.
*/
@ -34,7 +36,8 @@ public class EvIPL {
}
/**
* Returns a human readable description of the IPL Event.
* Returns a human-readable description of the IPL Event.
*
* @return human readable description.
*/
public String toString() {

View File

@ -7,12 +7,12 @@ import java.nio.charset.StandardCharsets;
/**
* Class for processing EV_POST_CODE event types
*
* <p>
* typedef struct tdUEFI_PLATFORM_FIRMWARE_BLOB {
* UEFI_PHYSICAL_ADDRESS BlobBase; // Same as UINT64 for most systems
* UINT64 BlobLength;
* } UEFI_PLATFORM_FIRMWARE_BLOB;
*
* <p>
* 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.
@ -21,16 +21,25 @@ import java.nio.charset.StandardCharsets;
* For embedded option ROMs, the event data SHOULD be Embedded UEFI Driver.
*/
public class EvPostCode {
/** Event Description. */
/**
* Event Description.
*/
private String codeInfo = "";
/** String type flag. */
/**
* String type flag.
*/
private boolean bisString = false;
/** Firmware object. */
/**
* Firmware object.
*/
@Getter
private UefiFirmware firmwareBlob = null;
/**
* EcPostCode constructor.
*
* @param postCode byte array holding the post code content.
*/
public EvPostCode(final byte[] postCode) {
@ -43,27 +52,9 @@ public class EvPostCode {
}
}
/**
* 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.
*/
@ -75,4 +66,25 @@ public class EvPostCode {
}
return true;
}
/**
* 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();
}
}

View File

@ -11,6 +11,7 @@ public class EvSCrtmContents {
/**
* 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) {
@ -19,20 +20,20 @@ public class EvSCrtmContents {
/**
* 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) {
public void scrtmContents(final byte[] event) {
if (event == null) {
description = "invalid content event data";
this.description = "invalid content event data";
} else {
description = new String(event, StandardCharsets.UTF_8);
this.description = new String(event, StandardCharsets.UTF_8);
}
return description;
}
/**
* Human readable string contained within the CRTM Contents event.
* Human-readable string contained within the CRTM Contents event.
*
* @return Human readable string.
*/
public String toString() {

View File

@ -8,7 +8,7 @@ import java.nio.charset.StandardCharsets;
* Class to process the NV_INDEX_DYNAMIC_EVENT_LOG_DATA per PFP.
* Per PFP, the first 16 bytes of the structure are a String based identifier (Signature),
* which are a NULL-terminated ASCII string "NvIndexDynamic".
*
* <p>
* HEADERS defined by PFP v1.06 Rev 52.
* Certain fields are common to both ..HEADER and ..HEADER2, and are noted below the structures.
* <p>

View File

@ -39,7 +39,7 @@ public class SpdmMeasurementBlock {
/**
* SPDM Measurement.
*/
private SpdmMeasurement spdmMeasurement;
private final SpdmMeasurement spdmMeasurement;
/**
* SpdmMeasurementBlock Constructor.

View File

@ -282,6 +282,7 @@ public final class UefiConstants {
* file status, where file is not accessible (either not found, or no access permission).
*/
public static final String FILESTATUS_NOT_ACCESSIBLE = "fileNotAccessible";
/**
* Default private constructor so checkstyles doesn't complain.
*/

View File

@ -72,6 +72,22 @@ public class UefiDevicePath {
length = HexUtils.leReverseInt(lengthBytes);
}
/**
* 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;
}
/**
* Returns the UEFI device subtype.
*
@ -118,8 +134,8 @@ public class UefiDevicePath {
* Current types processed include Hardware Device Path, ACPI Device Path,
* Messaging Device Path, and Media Device Path.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return human-readable string representing the UEFI device path
* @throws java.io.UnsupportedEncodingException
*/
@ -127,7 +143,7 @@ public class UefiDevicePath {
String devInfo = " ";
int devPath = path[offset];
byte unknownSubType = path[offset + UefiConstants.OFFSET_1];
switch (path[0 + offset]) {
switch (path[offset]) {
case UefiConstants.DEV_HW:
type = "Hardware Device Path";
if (devPath == UefiConstants.DEVPATH_HARWARE) {
@ -182,8 +198,8 @@ public class UefiDevicePath {
/**
* processes the ACPI UEFI device subtype.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return acpi device info
*/
private String acpiSubType(final byte[] path, final int offset) {
@ -205,8 +221,8 @@ public class UefiDevicePath {
/**
* Processes the ACPI short subtype.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return short acpi info.
*/
private String acpiShortSubType(final byte[] path, final int offset) {
@ -226,8 +242,8 @@ public class UefiDevicePath {
/**
* Processes the PCI subType.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return pci device info.
*/
private String pciSubType(final byte[] path, final int offset) {
@ -243,8 +259,8 @@ public class UefiDevicePath {
/**
* processes the SATA subtype.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return SATA drive info.
*/
private String sataSubType(final byte[] path, final int offset) {
@ -264,8 +280,8 @@ public class UefiDevicePath {
/**
* Processes the hard drive subtype.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return hard drive info.
*/
private String hardDriveSubType(final byte[] path, final int offset) {
@ -311,8 +327,8 @@ public class UefiDevicePath {
/**
* Process the File path subtype.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return file path info.
*/
private String filePathSubType(final byte[] path, final int offset) {
@ -336,8 +352,8 @@ public class UefiDevicePath {
* Vendor-assigned GUID that defines the data that follows.
* Vendor-defined variable size data.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return vendor device info.
*/
private String vendorSubType(final byte[] path, final int offset) {
@ -351,7 +367,7 @@ public class UefiDevicePath {
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData,
0, UefiConstants.SIZE_16);
UefiGuid guid = new UefiGuid(guidData);
subType += guid.toString() + " ";
subType += guid + " ";
if (subTypeLength - UefiConstants.SIZE_16 > 0) {
byte[] vendorData = new byte[subTypeLength - UefiConstants.SIZE_16];
System.arraycopy(path, UefiConstants.OFFSET_20
@ -368,8 +384,8 @@ public class UefiDevicePath {
* Returns USB device info.
* UEFI Specification, Version 2.8.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return USB device info.
*/
private String usbSubType(final byte[] path, final int offset) {
@ -395,8 +411,8 @@ public class UefiDevicePath {
* See Links to UEFI Related Documents
* (http://uefi.org/uefi under the headings NVM Express Specification.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return NVM device info.
*/
private String nvmSubType(final byte[] path, final int offset) {
@ -421,7 +437,7 @@ public class UefiDevicePath {
* Status bootHandler pointer, and description String pointer are ignored.
*
* @param path byte array holding the device path.
* @param offset
* @param offset offset
* @return String that represents the UEFI defined BIOS Device Type.
*/
private String biosDevicePath(final byte[] path, final int offset) {
@ -468,8 +484,8 @@ public class UefiDevicePath {
* PIWG Firmware File Section 10.3.5.6:
* Contents are defined in the UEFI PI Specification.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return String that represents the PIWG Firmware Volume Path
*/
private String piwgFirmVolFile(final byte[] path, final int offset) {
@ -489,8 +505,8 @@ public class UefiDevicePath {
* PIWG Firmware Volume Section 10.3.5.7:
* Contents are defined in the UEFI PI Specification.
*
* @param path
* @param offset
* @param path path
* @param offset offset
* @return String that represents the PIWG Firmware Volume Path
*/
private String piwgFirmVolPath(final byte[] path, final int offset) {
@ -512,20 +528,4 @@ public class UefiDevicePath {
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

@ -45,11 +45,11 @@ public class UefiGuid {
/**
* guid byte array.
*/
private byte[] guid;
private final byte[] guid;
/**
* UUID object.
*/
private UUID uuid;
private final UUID uuid;
/**
* UefiGUID constructor.
@ -88,6 +88,7 @@ public class UefiGuid {
* 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.
*
* @param guid byte array holding the guid data.
* @return UUID processed from the passed in guid
*/
@ -120,6 +121,22 @@ public class UefiGuid {
return UefiConstants.SIZE_16;
}
/**
* 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 whether the handle to the file needed to look up the UUID is valid. If empty,
* this likely means the file was not accessible to due to existence or permissions.
@ -179,22 +196,6 @@ public class UefiGuid {
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").
*

View File

@ -33,7 +33,7 @@ public class UefiSignatureData {
/**
* UEFI Certificate GUID.
*/
private byte[] guid = new byte[UefiConstants.SIZE_16];
private final byte[] guid = new byte[UefiConstants.SIZE_16];
/**
* UEFI Signature data.
*/
@ -61,7 +61,7 @@ public class UefiSignatureData {
/**
* UEFI Certificate SHA256 hash.
*/
private byte[] binaryHash = new byte[UefiConstants.SIZE_32];
private final byte[] binaryHash = new byte[UefiConstants.SIZE_32];
/**
* UEFI Signature data status.
*/

View File

@ -33,7 +33,7 @@ import static hirs.utils.tpm.eventlog.uefi.UefiConstants.FILESTATUS_NOT_ACCESSIB
* // UINT8 SignatureHeader[SignatureHeaderSize];
* // EFI_SIGNATURE_DATA Signatures[...][SignatureSize];
* } EFI_SIGNATURE_LIST;
*
* <p>
* SignatureListHeader (contents common to any Signature Type)
* - SignatureType
* - SignatureListSize
@ -44,7 +44,7 @@ import static hirs.utils.tpm.eventlog.uefi.UefiConstants.FILESTATUS_NOT_ACCESSIB
* Signatures[][] is an array of signatures.
* - Each signature is SignatureSize bytes in length.
* - The format of the signature is defined by SignatureType (SHA256, X509).
*
* <p>
* / |-------------------------| ------- SignatureType
* / | Signature List Header | SignatureListSize
* |---------------------| / |-------------------------|\ SignatureHeaderSize
@ -61,9 +61,12 @@ import static hirs.utils.tpm.eventlog.uefi.UefiConstants.FILESTATUS_NOT_ACCESSIB
* \ |-------------------------|
* \ | Signature #n |
* \ |-------------------------|
*
*/
public class UefiSignatureList {
/**
* Array List of Signature found in the list.
*/
private final ArrayList<UefiSignatureData> sigList = new ArrayList<>();
/**
* Size of the signature list.
*/
@ -94,18 +97,16 @@ public class UefiSignatureList {
* Current status of Signature List data.
*/
private String dataInvalidStatus = "Signature List data validity is undetermined yet";
/**
* 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;
/**
* Track status of vendor-table.json.
*/
@ -213,16 +214,11 @@ public class UefiSignatureList {
* @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;
}
return switch (guid.getVendorTableReference()) {
case "EFI_CERT_SHA256_GUID", "EFI_CERT_X509_SHA256", "EFI_CERT_X509_SHA384",
"EFI_CERT_X509_SHA512", "EFI_CERT_X509_GUID" -> true;
default -> false;
};
}
/**

View File

@ -35,7 +35,7 @@ public class UefiVariable {
/**
* List of Signature lists.
*/
private List<UefiSignatureList> certSuperList;
private final List<UefiSignatureList> certSuperList;
/**
* Name of the UEFI variable.
*/

View File

@ -1,6 +1,7 @@
package hirs.utils.tpm.eventlog.uefi;
import jakarta.xml.bind.DatatypeConverter;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.security.MessageDigest;

View File

@ -14,6 +14,8 @@ import jakarta.xml.bind.annotation.XmlAnyAttribute;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import javax.xml.namespace.QName;
import java.util.HashMap;
@ -21,7 +23,6 @@ import java.util.Map;
/**
*
* Attributes common to all Elements in this schema
*
*
@ -39,9 +40,8 @@ import java.util.Map;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "BaseElement", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
@XmlSeeAlso({
@ -53,53 +53,25 @@ import java.util.Map;
})
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;
}
/**
* -- GETTER --
* 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.
*
* <p>
* 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;
}
@XmlAnyAttribute
private final Map<QName, String> otherAttributes = new HashMap<>();
/**
* -- GETTER --
* Allow xml:lang attribute on any element.
*/
@Setter
@XmlAttribute(name = "lang", namespace = "http://www.w3.org/XML/1998/namespace")
protected String lang;
}

View File

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAnyElement;
@ -17,6 +15,11 @@ import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlMixed;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
@ -36,8 +39,6 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CanonicalizationMethodType", propOrder = {
@ -48,6 +49,9 @@ public class CanonicalizationMethodType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@Getter
@Setter
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
@ -72,8 +76,6 @@ public class CanonicalizationMethodType {
* Objects of the following type(s) are allowed in the list
* {@link Object }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
@ -81,29 +83,4 @@ public class CanonicalizationMethodType {
}
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

@ -12,6 +12,8 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
/**
@ -40,9 +42,9 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DSAKeyValueType", propOrder = {
"p",
@ -54,174 +56,24 @@ import jakarta.xml.bind.annotation.XmlType;
"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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAnyElement;
@ -17,8 +15,13 @@ import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlMixed;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for DigestMethodType complex type.
@ -37,8 +40,6 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DigestMethodType", propOrder = {
@ -49,6 +50,9 @@ public class DigestMethodType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@Getter
@Setter
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
@ -74,38 +78,11 @@ public class DigestMethodType {
* {@link Object }
* {@link Element }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
content = new ArrayList<>();
}
return this.content;
}
/**
* Gets the value of the algorithm property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getAlgorithm() {
return algorithm;
}
/**
* Sets the value of the algorithm property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setAlgorithm(String value) {
this.algorithm = value;
}
}

View File

@ -8,14 +8,15 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
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.
@ -35,16 +36,13 @@ import jakarta.xml.bind.annotation.XmlType;
* &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
{
extends FilesystemItem {
@XmlElements({
@XmlElement(name = "Directory", type = Directory.class),
@ -72,12 +70,10 @@ public class Directory
* 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>();
directoryOrFile = new ArrayList<>();
}
return this.directoryOrFile;
}

View File

@ -8,14 +8,17 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
@ -39,27 +42,33 @@ import jakarta.xml.bind.annotation.XmlType;
* &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
{
extends BaseElement {
@XmlElement(name = "Meta")
protected List<Meta> meta;
@Getter
@Setter
@XmlAttribute(name = "name", required = true)
protected String name;
@Setter
@XmlAttribute(name = "regid")
@XmlSchemaType(name = "anyURI")
protected String regid;
@XmlAttribute(name = "role", required = true)
@XmlSchemaType(name = "NMTOKENS")
protected List<String> role;
@Getter
@Setter
@XmlAttribute(name = "thumbprint")
protected String thumbprint;
@ -82,8 +91,6 @@ public class Entity
* <p>
* Objects of the following type(s) are allowed in the list
* {@link Meta }
*
*
*/
public List<Meta> getMeta() {
if (meta == null) {
@ -92,37 +99,11 @@ public class Entity
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
* @return possible object is
* {@link String }
*
*/
public String getRegid() {
if (regid == null) {
@ -132,18 +113,6 @@ public class Entity
}
}
/**
* 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.
*
@ -163,38 +132,11 @@ public class Entity
* <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>();
role = new ArrayList<>();
}
return this.role;
}
/**
* Gets the value of the thumbprint property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getThumbprint() {
return thumbprint;
}
/**
* Sets the value of the thumbprint property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setThumbprint(String value) {
this.thumbprint = value;
}
}

View File

@ -13,6 +13,9 @@ import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import javax.xml.datatype.XMLGregorianCalendar;
@ -32,67 +35,18 @@ import javax.xml.datatype.XMLGregorianCalendar;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Evidence", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
public class Evidence
extends ResourceCollection
{
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

@ -8,11 +8,14 @@
package hirs.utils.xjc;
import java.math.BigInteger;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import java.math.BigInteger;
/**
@ -31,66 +34,17 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "File", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
public class File
extends FilesystemItem
{
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

@ -13,6 +13,8 @@ import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlSeeAlso;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
/**
@ -33,9 +35,9 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "FilesystemItem", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
@XmlSeeAlso({
@ -43,112 +45,17 @@ import jakarta.xml.bind.annotation.XmlType;
Directory.class
})
public class FilesystemItem
extends Meta
{
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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -23,8 +21,13 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.Getter;
import lombok.Setter;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for KeyInfoType complex type.
@ -50,8 +53,6 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyInfoType", propOrder = {
@ -71,6 +72,9 @@ public class KeyInfoType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@Getter
@Setter
@XmlAttribute(name = "Id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@ -105,38 +109,11 @@ public class KeyInfoType {
* {@link Element }
* {@link JAXBElement }{@code <}{@link SPKIDataType }{@code >}
* {@link JAXBElement }{@code <}{@link RetrievalMethodType }{@code >}
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
content = new ArrayList<>();
}
return this.content;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
}

View File

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -20,6 +18,9 @@ import jakarta.xml.bind.annotation.XmlMixed;
import jakarta.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for KeyValueType complex type.
@ -39,8 +40,6 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "KeyValueType", propOrder = {
@ -79,12 +78,10 @@ public class KeyValueType {
* {@link String }
* {@link JAXBElement }{@code <}{@link DSAKeyValueType }{@code >}
* {@link Object }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
content = new ArrayList<>();
}
return this.content;
}

View File

@ -15,6 +15,8 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.Getter;
import lombok.Setter;
/**
@ -38,199 +40,35 @@ import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Link", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
public class Link
extends BaseElement
{
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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
@ -19,6 +17,11 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
@ -38,8 +41,6 @@ import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ManifestType", propOrder = {
@ -49,6 +50,9 @@ public class ManifestType {
@XmlElement(name = "Reference", required = true)
protected List<ReferenceType> reference;
@Getter
@Setter
@XmlAttribute(name = "Id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@ -74,38 +78,11 @@ public class ManifestType {
* <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>();
reference = new ArrayList<>();
}
return this.reference;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
}

View File

@ -28,8 +28,6 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Meta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
@ -40,8 +38,7 @@ import jakarta.xml.bind.annotation.XmlType;
FilesystemItem.class
})
public class Meta
extends BaseElement
{
extends BaseElement {
}

View File

@ -8,11 +8,12 @@
package hirs.utils.xjc;
import java.math.BigInteger;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlElementDecl;
import jakarta.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
import java.math.BigInteger;
/**
@ -27,64 +28,94 @@ import javax.xml.namespace.QName;
* 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 _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 _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 _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 _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 _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 _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 _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 _TransformTypeXPath_QNAME = new QName("http://www.w3.org/2000/09/xmldsig#", "XPath");
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 _PayloadDirectory_QNAME = new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Directory");
private final static QName _DirectoryFile_QNAME = new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "File");
private final static QName _SoftwareIdentityEntity_QNAME = new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Entity");
private final static QName _SoftwareIdentityMeta_QNAME = new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Meta");
private final static QName _SignatureMethodTypeHMACOutputLength_QNAME = new QName("http://www.w3.org/2000/09/xmldsig#", "HMACOutputLength");
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 _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 _PayloadDirectory_QNAME =
new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Directory");
private final static QName _DirectoryFile_QNAME =
new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "File");
private final static QName _SoftwareIdentityEntity_QNAME =
new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Entity");
private final static QName _SoftwareIdentityMeta_QNAME =
new QName("http://standards.iso.org/iso/19770/-2/2015/schema.xsd", "Meta");
private final static QName _SignatureMethodTypeHMACOutputLength_QNAME =
new QName("http://www.w3.org/2000/09/xmldsig#", "HMACOutputLength");
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");
/**
* Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: main.java.hirs.utils.xjc
*
*/
public ObjectFactory() {
}
/**
* Create an instance of {@link SoftwareIdentity }
*
*/
public SoftwareIdentity createSoftwareIdentity() {
return new SoftwareIdentity();
@ -92,7 +123,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SoftwareMeta }
*
*/
public SoftwareMeta createSoftwareMeta() {
return new SoftwareMeta();
@ -100,7 +130,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Entity }
*
*/
public Entity createEntity() {
return new Entity();
@ -108,7 +137,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Meta }
*
*/
public Meta createMeta() {
return new Meta();
@ -116,7 +144,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link FilesystemItem }
*
*/
public FilesystemItem createFilesystemItem() {
return new FilesystemItem();
@ -124,7 +151,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Resource }
*
*/
public Resource createResource() {
return new Resource();
@ -132,7 +158,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Process }
*
*/
public Process createProcess() {
return new Process();
@ -140,7 +165,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link BaseElement }
*
*/
public BaseElement createBaseElement() {
return new BaseElement();
@ -148,7 +172,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Evidence }
*
*/
public Evidence createEvidence() {
return new Evidence();
@ -156,7 +179,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link File }
*
*/
public File createFile() {
return new File();
@ -164,7 +186,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Link }
*
*/
public Link createLink() {
return new Link();
@ -172,7 +193,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link Directory }
*
*/
public Directory createDirectory() {
return new Directory();
@ -180,7 +200,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link ResourceCollection }
*
*/
public ResourceCollection createResourceCollection() {
return new ResourceCollection();
@ -188,7 +207,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link PGPDataType }
*
*/
public PGPDataType createPGPDataType() {
return new PGPDataType();
@ -196,7 +214,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link KeyValueType }
*
*/
public KeyValueType createKeyValueType() {
return new KeyValueType();
@ -204,7 +221,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link DSAKeyValueType }
*
*/
public DSAKeyValueType createDSAKeyValueType() {
return new DSAKeyValueType();
@ -212,7 +228,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link ReferenceType }
*
*/
public ReferenceType createReferenceType() {
return new ReferenceType();
@ -220,7 +235,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link RetrievalMethodType }
*
*/
public RetrievalMethodType createRetrievalMethodType() {
return new RetrievalMethodType();
@ -228,7 +242,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link TransformsType }
*
*/
public TransformsType createTransformsType() {
return new TransformsType();
@ -236,7 +249,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link CanonicalizationMethodType }
*
*/
public CanonicalizationMethodType createCanonicalizationMethodType() {
return new CanonicalizationMethodType();
@ -244,7 +256,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link DigestMethodType }
*
*/
public DigestMethodType createDigestMethodType() {
return new DigestMethodType();
@ -252,7 +263,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link ManifestType }
*
*/
public ManifestType createManifestType() {
return new ManifestType();
@ -260,7 +270,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SignaturePropertyType }
*
*/
public SignaturePropertyType createSignaturePropertyType() {
return new SignaturePropertyType();
@ -268,7 +277,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link X509DataType }
*
*/
public X509DataType createX509DataType() {
return new X509DataType();
@ -276,7 +284,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SignedInfoType }
*
*/
public SignedInfoType createSignedInfoType() {
return new SignedInfoType();
@ -284,7 +291,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link RSAKeyValueType }
*
*/
public RSAKeyValueType createRSAKeyValueType() {
return new RSAKeyValueType();
@ -292,7 +298,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SPKIDataType }
*
*/
public SPKIDataType createSPKIDataType() {
return new SPKIDataType();
@ -300,7 +305,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SignatureValueType }
*
*/
public SignatureValueType createSignatureValueType() {
return new SignatureValueType();
@ -308,7 +312,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link KeyInfoType }
*
*/
public KeyInfoType createKeyInfoType() {
return new KeyInfoType();
@ -316,7 +319,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SignatureType }
*
*/
public SignatureType createSignatureType() {
return new SignatureType();
@ -324,7 +326,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SignaturePropertiesType }
*
*/
public SignaturePropertiesType createSignaturePropertiesType() {
return new SignaturePropertiesType();
@ -332,7 +333,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link SignatureMethodType }
*
*/
public SignatureMethodType createSignatureMethodType() {
return new SignatureMethodType();
@ -340,7 +340,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link ObjectType }
*
*/
public ObjectType createObjectType() {
return new ObjectType();
@ -348,7 +347,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link TransformType }
*
*/
public TransformType createTransformType() {
return new TransformType();
@ -356,7 +354,6 @@ public class ObjectFactory {
/**
* Create an instance of {@link X509IssuerSerialType }
*
*/
public X509IssuerSerialType createX509IssuerSerialType() {
return new X509IssuerSerialType();
@ -364,380 +361,360 @@ public class ObjectFactory {
/**
* 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);
return new JAXBElement<>(_SPKIData_QNAME, SPKIDataType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link KeyInfoType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyInfo")
public JAXBElement<KeyInfoType> createKeyInfo(KeyInfoType value) {
return new JAXBElement<KeyInfoType>(_KeyInfo_QNAME, KeyInfoType.class, null, value);
return new JAXBElement<>(_KeyInfo_QNAME, KeyInfoType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SignatureValueType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureValue")
public JAXBElement<SignatureValueType> createSignatureValue(SignatureValueType value) {
return new JAXBElement<SignatureValueType>(_SignatureValue_QNAME, SignatureValueType.class, null, value);
return new JAXBElement<>(_SignatureValue_QNAME, SignatureValueType.class, null,
value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link KeyValueType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyValue")
public JAXBElement<KeyValueType> createKeyValue(KeyValueType value) {
return new JAXBElement<KeyValueType>(_KeyValue_QNAME, KeyValueType.class, null, value);
return new JAXBElement<>(_KeyValue_QNAME, KeyValueType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link TransformsType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Transforms")
public JAXBElement<TransformsType> createTransforms(TransformsType value) {
return new JAXBElement<TransformsType>(_Transforms_QNAME, TransformsType.class, null, value);
return new JAXBElement<>(_Transforms_QNAME, TransformsType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link DigestMethodType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestMethod")
public JAXBElement<DigestMethodType> createDigestMethod(DigestMethodType value) {
return new JAXBElement<DigestMethodType>(_DigestMethod_QNAME, DigestMethodType.class, null, value);
return new JAXBElement<>(_DigestMethod_QNAME, DigestMethodType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link X509DataType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509Data")
public JAXBElement<X509DataType> createX509Data(X509DataType value) {
return new JAXBElement<X509DataType>(_X509Data_QNAME, X509DataType.class, null, value);
return new JAXBElement<>(_X509Data_QNAME, X509DataType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SignaturePropertyType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureProperty")
public JAXBElement<SignaturePropertyType> createSignatureProperty(SignaturePropertyType value) {
return new JAXBElement<SignaturePropertyType>(_SignatureProperty_QNAME, SignaturePropertyType.class, null, value);
return new JAXBElement<>(_SignatureProperty_QNAME, SignaturePropertyType.class,
null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyName")
public JAXBElement<String> createKeyName(String value) {
return new JAXBElement<String>(_KeyName_QNAME, String.class, null, value);
return new JAXBElement<>(_KeyName_QNAME, String.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link RSAKeyValueType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "RSAKeyValue")
public JAXBElement<RSAKeyValueType> createRSAKeyValue(RSAKeyValueType value) {
return new JAXBElement<RSAKeyValueType>(_RSAKeyValue_QNAME, RSAKeyValueType.class, null, value);
return new JAXBElement<>(_RSAKeyValue_QNAME, RSAKeyValueType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SoftwareIdentity }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "SoftwareIdentity")
public JAXBElement<SoftwareIdentity> createSoftwareIdentity(SoftwareIdentity value) {
return new JAXBElement<SoftwareIdentity>(_SoftwareIdentity_QNAME, SoftwareIdentity.class, null, value);
return new JAXBElement<>(_SoftwareIdentity_QNAME, SoftwareIdentity.class, null,
value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SignatureType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Signature")
public JAXBElement<SignatureType> createSignature(SignatureType value) {
return new JAXBElement<SignatureType>(_Signature_QNAME, SignatureType.class, null, value);
return new JAXBElement<>(_Signature_QNAME, SignatureType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link String }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "MgmtData")
public JAXBElement<String> createMgmtData(String value) {
return new JAXBElement<String>(_MgmtData_QNAME, String.class, null, value);
return new JAXBElement<>(_MgmtData_QNAME, String.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SignatureMethodType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureMethod")
public JAXBElement<SignatureMethodType> createSignatureMethod(SignatureMethodType value) {
return new JAXBElement<SignatureMethodType>(_SignatureMethod_QNAME, SignatureMethodType.class, null, value);
return new JAXBElement<>(_SignatureMethod_QNAME, SignatureMethodType.class, null,
value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ObjectType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Object")
public JAXBElement<ObjectType> createObject(ObjectType value) {
return new JAXBElement<ObjectType>(_Object_QNAME, ObjectType.class, null, value);
return new JAXBElement<>(_Object_QNAME, ObjectType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SignaturePropertiesType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureProperties")
public JAXBElement<SignaturePropertiesType> createSignatureProperties(SignaturePropertiesType value) {
return new JAXBElement<SignaturePropertiesType>(_SignatureProperties_QNAME, SignaturePropertiesType.class, null, value);
return new JAXBElement<>(_SignatureProperties_QNAME,
SignaturePropertiesType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link TransformType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Transform")
public JAXBElement<TransformType> createTransform(TransformType value) {
return new JAXBElement<TransformType>(_Transform_QNAME, TransformType.class, null, value);
return new JAXBElement<>(_Transform_QNAME, TransformType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link PGPDataType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPData")
public JAXBElement<PGPDataType> createPGPData(PGPDataType value) {
return new JAXBElement<PGPDataType>(_PGPData_QNAME, PGPDataType.class, null, value);
return new JAXBElement<>(_PGPData_QNAME, PGPDataType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ReferenceType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Reference")
public JAXBElement<ReferenceType> createReference(ReferenceType value) {
return new JAXBElement<ReferenceType>(_Reference_QNAME, ReferenceType.class, null, value);
return new JAXBElement<>(_Reference_QNAME, ReferenceType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link RetrievalMethodType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "RetrievalMethod")
public JAXBElement<RetrievalMethodType> createRetrievalMethod(RetrievalMethodType value) {
return new JAXBElement<RetrievalMethodType>(_RetrievalMethod_QNAME, RetrievalMethodType.class, null, value);
return new JAXBElement<>(_RetrievalMethod_QNAME, RetrievalMethodType.class, null,
value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link DSAKeyValueType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DSAKeyValue")
public JAXBElement<DSAKeyValueType> createDSAKeyValue(DSAKeyValueType value) {
return new JAXBElement<DSAKeyValueType>(_DSAKeyValue_QNAME, DSAKeyValueType.class, null, value);
return new JAXBElement<>(_DSAKeyValue_QNAME, DSAKeyValueType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestValue")
public JAXBElement<byte[]> createDigestValue(byte[] value) {
return new JAXBElement<byte[]>(_DigestValue_QNAME, byte[].class, null, ((byte[]) value));
return new JAXBElement<>(_DigestValue_QNAME, byte[].class, null, 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);
public JAXBElement<CanonicalizationMethodType> createCanonicalizationMethod(
CanonicalizationMethodType value) {
return new JAXBElement<>(_CanonicalizationMethod_QNAME,
CanonicalizationMethodType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SignedInfoType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignedInfo")
public JAXBElement<SignedInfoType> createSignedInfo(SignedInfoType value) {
return new JAXBElement<SignedInfoType>(_SignedInfo_QNAME, SignedInfoType.class, null, value);
return new JAXBElement<>(_SignedInfo_QNAME, SignedInfoType.class, null, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ManifestType }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Manifest")
public JAXBElement<ManifestType> createManifest(ManifestType value) {
return new JAXBElement<ManifestType>(_Manifest_QNAME, ManifestType.class, null, value);
return new JAXBElement<>(_Manifest_QNAME, ManifestType.class, null, 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);
return new JAXBElement<>(_TransformTypeXPath_QNAME, String.class, TransformType.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);
return new JAXBElement<>(_X509DataTypeX509IssuerSerial_QNAME,
X509IssuerSerialType.class, X509DataType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509CRL", scope = X509DataType.class)
public JAXBElement<byte[]> createX509DataTypeX509CRL(byte[] value) {
return new JAXBElement<byte[]>(_X509DataTypeX509CRL_QNAME, byte[].class, X509DataType.class, ((byte[]) value));
return new JAXBElement<>(_X509DataTypeX509CRL_QNAME, byte[].class, X509DataType.class,
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);
return new JAXBElement<>(_X509DataTypeX509SubjectName_QNAME, String.class, X509DataType.class,
value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509SKI", scope = X509DataType.class)
public JAXBElement<byte[]> createX509DataTypeX509SKI(byte[] value) {
return new JAXBElement<byte[]>(_X509DataTypeX509SKI_QNAME, byte[].class, X509DataType.class, ((byte[]) value));
return new JAXBElement<>(_X509DataTypeX509SKI_QNAME, byte[].class, X509DataType.class,
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));
return new JAXBElement<>(_X509DataTypeX509Certificate_QNAME, byte[].class, X509DataType.class,
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);
return new JAXBElement<>(_SoftwareIdentityLink_QNAME, Link.class, SoftwareIdentity.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link Evidence }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Evidence", scope = SoftwareIdentity.class)
public JAXBElement<Evidence> createSoftwareIdentityEvidence(Evidence value) {
return new JAXBElement<Evidence>(_SoftwareIdentityEvidence_QNAME, Evidence.class, SoftwareIdentity.class, value);
return new JAXBElement<>(_SoftwareIdentityEvidence_QNAME, Evidence.class,
SoftwareIdentity.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link ResourceCollection }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Payload", scope = SoftwareIdentity.class)
public JAXBElement<ResourceCollection> createSoftwareIdentityPayload(ResourceCollection value) {
return new JAXBElement<ResourceCollection>(_SoftwareIdentityPayload_QNAME, ResourceCollection.class, SoftwareIdentity.class, value);
return new JAXBElement<>(_SoftwareIdentityPayload_QNAME, ResourceCollection.class,
SoftwareIdentity.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link FilesystemItem }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Directory", scope = ResourceCollection.class)
public JAXBElement<FilesystemItem> createPayloadDirectory(FilesystemItem value) {
return new JAXBElement<FilesystemItem>(_PayloadDirectory_QNAME, FilesystemItem.class, ResourceCollection.class, value);
return new JAXBElement<>(_PayloadDirectory_QNAME, FilesystemItem.class,
ResourceCollection.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link FilesystemItem }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "File", scope = ResourceCollection.class)
public JAXBElement<FilesystemItem> createDirectoryFile(FilesystemItem value) {
return new JAXBElement<FilesystemItem>(_DirectoryFile_QNAME, FilesystemItem.class, ResourceCollection.class, value);
return new JAXBElement<>(_DirectoryFile_QNAME, FilesystemItem.class,
ResourceCollection.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);
return new JAXBElement<>(_SoftwareIdentityEntity_QNAME, Entity.class, SoftwareIdentity.class,
value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link SoftwareMeta }{@code >}}
*
*/
@XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Meta", scope = SoftwareIdentity.class)
public JAXBElement<SoftwareMeta> createSoftwareIdentityMeta(SoftwareMeta value) {
return new JAXBElement<SoftwareMeta>(_SoftwareIdentityMeta_QNAME, SoftwareMeta.class, SoftwareIdentity.class, value);
return new JAXBElement<>(_SoftwareIdentityMeta_QNAME, SoftwareMeta.class,
SoftwareIdentity.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);
return new JAXBElement<>(_SignatureMethodTypeHMACOutputLength_QNAME, BigInteger.class,
SignatureMethodType.class, value);
}
/**
* Create an instance of {@link JAXBElement }{@code <}{@link byte[]}{@code >}}
*
*/
@XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKISexp", scope = SPKIDataType.class)
public JAXBElement<byte[]> createSPKIDataTypeSPKISexp(byte[] value) {
return new JAXBElement<byte[]>(_SPKIDataTypeSPKISexp_QNAME, byte[].class, SPKIDataType.class, ((byte[]) value));
return new JAXBElement<>(_SPKIDataTypeSPKISexp_QNAME, byte[].class, SPKIDataType.class,
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));
return new JAXBElement<>(_PGPDataTypePGPKeyID_QNAME, byte[].class, PGPDataType.class,
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));
return new JAXBElement<>(_PGPDataTypePGPKeyPacket_QNAME, byte[].class, PGPDataType.class,
value);
}
}

View File

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAnyElement;
@ -20,8 +18,14 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for ObjectType complex type.
@ -42,25 +46,30 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ObjectType", propOrder = {
"content"
})
public class ObjectType {
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
@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;
@ -86,86 +95,11 @@ public class ObjectType {
* {@link Object }
* {@link Element }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
content = new ArrayList<>();
}
return this.content;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
/**
* Gets the value of the mimeType property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMimeType() {
return mimeType;
}
/**
* Sets the value of the mimeType property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMimeType(String value) {
this.mimeType = value;
}
/**
* Gets the value of the encoding property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getEncoding() {
return encoding;
}
/**
* Sets the value of the encoding property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setEncoding(String value) {
this.encoding = value;
}
}

View File

@ -27,7 +27,6 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*
*/
@XmlType(name = "Ownership", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
@XmlEnum
@ -35,31 +34,22 @@ 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");
@ -69,10 +59,6 @@ public enum Ownership {
value = v;
}
public String value() {
return value;
}
public static Ownership fromValue(String v) {
for (Ownership c : Ownership.values()) {
if (c.value.equals(v)) {
@ -82,4 +68,8 @@ public enum Ownership {
throw new IllegalArgumentException(v);
}
public String value() {
return value;
}
}

View File

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -19,6 +17,9 @@ import jakarta.xml.bind.annotation.XmlElementRefs;
import jakarta.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for PGPDataType complex type.
@ -44,8 +45,6 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PGPDataType", propOrder = {
@ -92,8 +91,6 @@ public class PGPDataType {
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
* {@link Element }
* {@link Object }
*
*
*/
public List<Object> getContent() {
if (content == null) {

View File

@ -8,11 +8,14 @@
package hirs.utils.xjc;
import java.math.BigInteger;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import java.math.BigInteger;
/**
@ -31,66 +34,16 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Process", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
public class Process
extends Meta
{
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

@ -12,6 +12,8 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
/**
@ -31,9 +33,9 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RSAKeyValueType", propOrder = {
"modulus",
@ -43,51 +45,7 @@ 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

@ -17,6 +17,8 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.Getter;
import lombok.Setter;
/**
@ -40,9 +42,9 @@ import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ReferenceType", propOrder = {
"transforms",
@ -53,162 +55,24 @@ 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

@ -12,6 +12,8 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
/**
@ -29,40 +31,13 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Resource", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
public class Resource
extends Meta
{
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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
@ -17,6 +15,9 @@ 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.
@ -38,8 +39,6 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResourceCollection", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", propOrder = {
@ -49,8 +48,7 @@ import jakarta.xml.bind.annotation.XmlType;
Evidence.class
})
public class ResourceCollection
extends BaseElement
{
extends BaseElement {
@XmlElements({
@XmlElement(name = "Directory", type = Directory.class),
@ -82,8 +80,6 @@ public class ResourceCollection
* {@link File }
* {@link Process }
* {@link Resource }
*
*
*/
public List<Meta> getDirectoryOrFileOrProcess() {
if (directoryOrFileOrProcess == null) {

View File

@ -14,6 +14,8 @@ import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
/**
@ -34,9 +36,9 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RetrievalMethodType", propOrder = {
"transforms"
@ -45,83 +47,12 @@ 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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -18,6 +16,9 @@ import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for SPKIDataType complex type.
@ -36,8 +37,6 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SPKIDataType", propOrder = {
@ -70,8 +69,6 @@ public class SPKIDataType {
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
* {@link Object }
* {@link Element }
*
*
*/
public List<Object> getSPKISexpAndAny() {
if (spkiSexpAndAny == null) {

View File

@ -8,9 +8,6 @@
package hirs.utils.xjc;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -20,6 +17,12 @@ import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlMixed;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
@ -40,8 +43,6 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SignatureMethodType", propOrder = {
@ -53,6 +54,9 @@ public class SignatureMethodType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@Getter
@Setter
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
@ -78,8 +82,6 @@ public class SignatureMethodType {
* {@link JAXBElement }{@code <}{@link BigInteger }{@code >}
* {@link Object }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
@ -87,29 +89,4 @@ public class SignatureMethodType {
}
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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
@ -19,6 +17,11 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
@ -38,8 +41,6 @@ import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SignaturePropertiesType", propOrder = {
@ -49,6 +50,9 @@ public class SignaturePropertiesType {
@XmlElement(name = "SignatureProperty", required = true)
protected List<SignaturePropertyType> signatureProperty;
@Getter
@Setter
@XmlAttribute(name = "Id")
@XmlJavaTypeAdapter(CollapsedStringAdapter.class)
@XmlID
@ -74,8 +78,6 @@ public class SignaturePropertiesType {
* <p>
* Objects of the following type(s) are allowed in the list
* {@link SignaturePropertyType }
*
*
*/
public List<SignaturePropertyType> getSignatureProperty() {
if (signatureProperty == null) {
@ -83,29 +85,4 @@ public class SignaturePropertiesType {
}
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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAnyElement;
@ -20,8 +18,14 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for SignaturePropertyType complex type.
@ -41,21 +45,25 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SignaturePropertyType", propOrder = {
"content"
})
public class SignaturePropertyType {
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
@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
@ -83,62 +91,11 @@ public class SignaturePropertyType {
* {@link Object }
* {@link Element }
* {@link String }
*
*
*/
public List<Object> getContent() {
if (content == null) {
content = new ArrayList<Object>();
content = new ArrayList<>();
}
return this.content;
}
/**
* Gets the value of the target property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getTarget() {
return target;
}
/**
* Sets the value of the target property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setTarget(String value) {
this.target = value;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
}

View File

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
@ -19,6 +17,12 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
@ -41,9 +45,9 @@ import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SignatureType", propOrder = {
"signedInfo",
@ -55,90 +59,24 @@ 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;
@Setter(AccessLevel.NONE)
@Getter(AccessLevel.NONE)
@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.
*
@ -158,38 +96,11 @@ public class SignatureType {
* <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>();
object = new ArrayList<>();
}
return this.object;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
}

View File

@ -17,6 +17,8 @@ import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.XmlValue;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.Getter;
import lombok.Setter;
/**
@ -33,67 +35,20 @@ import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
* &lt;/simpleContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
@ -19,6 +17,12 @@ import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import lombok.AccessLevel;
import lombok.Getter;
import lombok.Setter;
import java.util.ArrayList;
import java.util.List;
/**
@ -40,9 +44,9 @@ import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SignedInfoType", propOrder = {
"canonicalizationMethod",
@ -53,64 +57,21 @@ public class SignedInfoType {
@XmlElement(name = "CanonicalizationMethod", required = true)
protected CanonicalizationMethodType canonicalizationMethod;
@XmlElement(name = "SignatureMethod", required = true)
protected SignatureMethodType signatureMethod;
@Getter(AccessLevel.NONE)
@Setter(AccessLevel.NONE)
@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.
*
@ -130,38 +91,11 @@ public class SignedInfoType {
* <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>();
reference = new ArrayList<>();
}
return this.reference;
}
/**
* Gets the value of the id property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getId() {
return id;
}
/**
* Sets the value of the id property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setId(String value) {
this.id = value;
}
}

View File

@ -8,9 +8,6 @@
package hirs.utils.xjc;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -24,6 +21,10 @@ import jakarta.xml.bind.annotation.adapters.CollapsedStringAdapter;
import jakarta.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import org.w3c.dom.Element;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for SoftwareIdentity complex type.
@ -56,16 +57,13 @@ import org.w3c.dom.Element;
* &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
{
extends BaseElement {
@XmlElementRefs({
@XmlElementRef(name = "Meta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", type = JAXBElement.class, required = false),
@ -122,8 +120,6 @@ public class SoftwareIdentity
* {@link JAXBElement }{@code <}{@link ResourceCollection }{@code >}
* {@link Element }
* {@link JAXBElement }{@code <}{@link Evidence }{@code >}
*
*
*/
public List<Object> getEntityOrEvidenceOrLink() {
if (entityOrEvidenceOrLink == null) {
@ -135,10 +131,8 @@ public class SoftwareIdentity
/**
* Gets the value of the corpus property.
*
* @return
* possible object is
* @return possible object is
* {@link Boolean }
*
*/
public boolean isCorpus() {
if (corpus == null) {
@ -151,10 +145,8 @@ public class SoftwareIdentity
/**
* Sets the value of the corpus property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link Boolean }
*
*/
public void setCorpus(Boolean value) {
this.corpus = value;
@ -163,10 +155,8 @@ public class SoftwareIdentity
/**
* Gets the value of the patch property.
*
* @return
* possible object is
* @return possible object is
* {@link Boolean }
*
*/
public boolean isPatch() {
if (patch == null) {
@ -179,10 +169,8 @@ public class SoftwareIdentity
/**
* Sets the value of the patch property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link Boolean }
*
*/
public void setPatch(Boolean value) {
this.patch = value;
@ -191,10 +179,8 @@ public class SoftwareIdentity
/**
* Gets the value of the media property.
*
* @return
* possible object is
* @return possible object is
* {@link String }
*
*/
public String getMedia() {
return media;
@ -203,10 +189,8 @@ public class SoftwareIdentity
/**
* Sets the value of the media property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link String }
*
*/
public void setMedia(String value) {
this.media = value;
@ -215,10 +199,8 @@ public class SoftwareIdentity
/**
* Gets the value of the name property.
*
* @return
* possible object is
* @return possible object is
* {@link String }
*
*/
public String getName() {
return name;
@ -227,10 +209,8 @@ public class SoftwareIdentity
/**
* Sets the value of the name property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link String }
*
*/
public void setName(String value) {
this.name = value;
@ -239,10 +219,8 @@ public class SoftwareIdentity
/**
* Gets the value of the supplemental property.
*
* @return
* possible object is
* @return possible object is
* {@link Boolean }
*
*/
public boolean isSupplemental() {
if (supplemental == null) {
@ -255,10 +233,8 @@ public class SoftwareIdentity
/**
* Sets the value of the supplemental property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link Boolean }
*
*/
public void setSupplemental(Boolean value) {
this.supplemental = value;
@ -267,10 +243,8 @@ public class SoftwareIdentity
/**
* Gets the value of the tagId property.
*
* @return
* possible object is
* @return possible object is
* {@link String }
*
*/
public String getTagId() {
return tagId;
@ -279,10 +253,8 @@ public class SoftwareIdentity
/**
* Sets the value of the tagId property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link String }
*
*/
public void setTagId(String value) {
this.tagId = value;
@ -291,10 +263,8 @@ public class SoftwareIdentity
/**
* Gets the value of the tagVersion property.
*
* @return
* possible object is
* @return possible object is
* {@link BigInteger }
*
*/
public BigInteger getTagVersion() {
if (tagVersion == null) {
@ -307,10 +277,8 @@ public class SoftwareIdentity
/**
* Sets the value of the tagVersion property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link BigInteger }
*
*/
public void setTagVersion(BigInteger value) {
this.tagVersion = value;
@ -319,10 +287,8 @@ public class SoftwareIdentity
/**
* Gets the value of the version property.
*
* @return
* possible object is
* @return possible object is
* {@link String }
*
*/
public String getVersion() {
if (version == null) {
@ -335,10 +301,8 @@ public class SoftwareIdentity
/**
* Sets the value of the version property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link String }
*
*/
public void setVersion(String value) {
this.version = value;
@ -347,10 +311,8 @@ public class SoftwareIdentity
/**
* Gets the value of the versionScheme property.
*
* @return
* possible object is
* @return possible object is
* {@link String }
*
*/
public String getVersionScheme() {
if (versionScheme == null) {
@ -363,10 +325,8 @@ public class SoftwareIdentity
/**
* Sets the value of the versionScheme property.
*
* @param value
* allowed object is
* @param value allowed object is
* {@link String }
*
*/
public void setVersionScheme(String value) {
this.versionScheme = value;

View File

@ -12,6 +12,8 @@ import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlAttribute;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
/**
@ -43,404 +45,55 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SoftwareMeta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
public class SoftwareMeta
extends Meta
{
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

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -19,8 +17,13 @@ import jakarta.xml.bind.annotation.XmlElementRef;
import jakarta.xml.bind.annotation.XmlMixed;
import jakarta.xml.bind.annotation.XmlSchemaType;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for TransformType complex type.
@ -40,8 +43,6 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TransformType", propOrder = {
@ -53,6 +54,9 @@ public class TransformType {
@XmlMixed
@XmlAnyElement(lax = true)
protected List<Object> content;
@Getter
@Setter
@XmlAttribute(name = "Algorithm", required = true)
@XmlSchemaType(name = "anyURI")
protected String algorithm;
@ -79,8 +83,6 @@ public class TransformType {
* {@link String }
* {@link JAXBElement }{@code <}{@link String }{@code >}
* {@link Object }
*
*
*/
public List<Object> getContent() {
if (content == null) {
@ -88,29 +90,4 @@ public class TransformType {
}
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

@ -8,13 +8,14 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for TransformsType complex type.
@ -32,8 +33,6 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TransformsType", propOrder = {
@ -63,8 +62,6 @@ public class TransformsType {
* <p>
* Objects of the following type(s) are allowed in the list
* {@link TransformType }
*
*
*/
public List<TransformType> getTransform() {
if (transform == null) {

View File

@ -27,7 +27,6 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/restriction>
* &lt;/simpleType>
* </pre>
*
*/
@XmlType(name = "Use", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd")
@XmlEnum
@ -35,28 +34,19 @@ 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");
@ -66,10 +56,6 @@ public enum Use {
value = v;
}
public String value() {
return value;
}
public static Use fromValue(String v) {
for (Use c : Use.values()) {
if (c.value.equals(v)) {
@ -79,4 +65,8 @@ public enum Use {
throw new IllegalArgumentException(v);
}
public String value() {
return value;
}
}

View File

@ -8,8 +8,6 @@
package hirs.utils.xjc;
import java.util.ArrayList;
import java.util.List;
import jakarta.xml.bind.JAXBElement;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
@ -19,6 +17,9 @@ import jakarta.xml.bind.annotation.XmlElementRefs;
import jakarta.xml.bind.annotation.XmlType;
import org.w3c.dom.Element;
import java.util.ArrayList;
import java.util.List;
/**
* <p>Java class for X509DataType complex type.
@ -43,8 +44,6 @@ import org.w3c.dom.Element;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "X509DataType", propOrder = {
@ -87,8 +86,6 @@ public class X509DataType {
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
* {@link Element }
* {@link JAXBElement }{@code <}{@link byte[]}{@code >}
*
*
*/
public List<Object> getX509IssuerSerialOrX509SKIOrX509SubjectName() {
if (x509IssuerSerialOrX509SKIOrX509SubjectName == null) {

View File

@ -8,11 +8,14 @@
package hirs.utils.xjc;
import java.math.BigInteger;
import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import lombok.Getter;
import lombok.Setter;
import java.math.BigInteger;
/**
@ -32,67 +35,18 @@ import jakarta.xml.bind.annotation.XmlType;
* &lt;/complexContent>
* &lt;/complexType>
* </pre>
*
*
*/
@Getter
@Setter
@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

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output indent="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">

View File

@ -1,19 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd"
xmlns:swid="http://standards.iso.org/iso/19770/-2/2015/schema.xsd"
xmlns:jaxb="https://jakarta.ee/xml/ns/jaxb"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
xmlns:xml="http://www.w3.org/XML/1998/namespace"
xmlns="http://standards.iso.org/iso/19770/-2/2015/schema.xsd"
targetNamespace="http://standards.iso.org/iso/19770/-2/2015/schema.xsd"
elementFormDefault="qualified">
<xs:annotation>
<xs:documentation>
This is the XML Schema for the Jakarta XML Binding binding customization descriptor. All binding customization descriptors must indicate the descriptor schema by using the Jakarta XML Binding namespace: https://jakarta.ee/xml/ns/jaxb and by indicating the version of the schema by using the version element as shown below:
<bindings xmlns="https://jakarta.ee/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jaxb https://jakarta.ee/xml/ns/jaxb/bindingschema_3_0.xsd" version="3.0"> ... </bindings>
The instance documents may indicate the published version of the schema using the xsi:schemaLocation attribute for Jakarta XML Binding namespace with the following location: https://jakarta.ee/xml/ns/jaxb/bindingschema_3_0.xsd
This is the XML Schema for the Jakarta XML Binding binding customization descriptor. All binding
customization descriptors must indicate the descriptor schema by using the Jakarta XML Binding namespace:
https://jakarta.ee/xml/ns/jaxb and by indicating the version of the schema by using the version element as
shown below:
<bindings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="https://jakarta.ee/xml/ns/jaxb"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jaxb https://jakarta.ee/xml/ns/jaxb/bindingschema_3_0.xsd"
version="3.0">...
</bindings>
The instance documents may indicate the published version of the schema using the xsi:schemaLocation
attribute for Jakarta XML Binding namespace with the following location:
https://jakarta.ee/xml/ns/jaxb/bindingschema_3_0.xsd
</xs:documentation>
</xs:annotation>
<xs:import

View File

@ -1,12 +1,10 @@
package hirs.data.persist;
import hirs.attestationca.persist.entity.Policy;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
* <code>PolicyTest</code> is a unit test class for the <code>Policy</code>

View File

@ -111,10 +111,7 @@
<!-- Checks for Naming Conventions. -->
<!-- See https://checkstyle.org/checks/naming/index.html -->
<module name="ConstantName">
<property name="format"
value="[A-Z_][A-Z0-9]*(_[A-Z0-9]+)*$"/>
</module>
<module name="ConstantName"/>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>