diff --git a/HIRS_Utils/src/main/java/hirs/utils/digest/Digest.java b/HIRS_Utils/src/main/java/hirs/utils/digest/Digest.java index f4be05a5..5f094020 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/digest/Digest.java +++ b/HIRS_Utils/src/main/java/hirs/utils/digest/Digest.java @@ -58,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; /** diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TcgTpmtHa.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TcgTpmtHa.java index d525c98a..614acda8 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TcgTpmtHa.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TcgTpmtHa.java @@ -21,62 +21,76 @@ 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; + /** * buffer to hold the structure. */ @@ -111,27 +125,14 @@ public class TcgTpmtHa { * @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; + 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"; + }; } /** @@ -143,25 +144,13 @@ public class TcgTpmtHa { * @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; + 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; + }; } /** @@ -173,25 +162,13 @@ public class TcgTpmtHa { * @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; + 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; + }; } /** diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvPostCode.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvPostCode.java index ae105c24..5fb8c920 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvPostCode.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvPostCode.java @@ -25,10 +25,12 @@ public class EvPostCode { * Event Description. */ private String codeInfo = ""; + /** * String type flag. */ private boolean bisString = false; + /** * Firmware object. */ diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiSignatureList.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiSignatureList.java index 2d9f9825..7b76b762 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiSignatureList.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/uefi/UefiSignatureList.java @@ -63,6 +63,10 @@ import static hirs.utils.tpm.eventlog.uefi.UefiConstants.FILESTATUS_NOT_ACCESSIB * \ |-------------------------| */ public class UefiSignatureList { + /** + * Array List of Signature found in the list. + */ + private final ArrayList sigList = new ArrayList<>(); /** * Size of the signature list. */ @@ -93,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 final ArrayList sigList = new ArrayList(); /** * Input Stream for processing. */ private ByteArrayInputStream efiSigDataIS = null; + /** * Type of signature. */ private UefiGuid signatureType = null; + /** * Track status of vendor-table.json. */ @@ -212,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; + }; } /** diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/CanonicalizationMethodType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/CanonicalizationMethodType.java index 0b4e6ac7..33d09ea8 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/CanonicalizationMethodType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/CanonicalizationMethodType.java @@ -50,8 +50,8 @@ public class CanonicalizationMethodType { @XmlAnyElement(lax = true) protected List content; - @Setter @Getter + @Setter @XmlAttribute(name = "Algorithm", required = true) @XmlSchemaType(name = "anyURI") protected String algorithm; diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/DSAKeyValueType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/DSAKeyValueType.java index 36814225..89a037cc 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/DSAKeyValueType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/DSAKeyValueType.java @@ -43,8 +43,8 @@ import lombok.Setter; * </complexType> * */ -@Setter @Getter +@Setter @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "DSAKeyValueType", propOrder = { "p", @@ -58,7 +58,7 @@ import lombok.Setter; public class DSAKeyValueType { @XmlElement(name = "P") protected byte[] p; - + @XmlElement(name = "Q") protected byte[] q; diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/DigestMethodType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/DigestMethodType.java index 9eb59c29..296cf589 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/DigestMethodType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/DigestMethodType.java @@ -51,8 +51,8 @@ public class DigestMethodType { @XmlAnyElement(lax = true) protected List content; - @Setter @Getter + @Setter @XmlAttribute(name = "Algorithm", required = true) @XmlSchemaType(name = "anyURI") protected String algorithm; diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/Entity.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Entity.java index a7e04ec8..03adfadf 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/Entity.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/Entity.java @@ -53,8 +53,8 @@ public class Entity @XmlElement(name = "Meta") protected List meta; - @Setter @Getter + @Setter @XmlAttribute(name = "name", required = true) protected String name; diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/Evidence.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Evidence.java index 3f92e5bc..d9690e78 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/Evidence.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/Evidence.java @@ -36,8 +36,8 @@ import javax.xml.datatype.XMLGregorianCalendar; * </complexType> * */ -@Setter @Getter +@Setter @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Evidence", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") public class Evidence diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/File.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/File.java index b31e003c..5b17d597 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/File.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/File.java @@ -35,8 +35,8 @@ import java.math.BigInteger; * </complexType> * */ -@Setter @Getter +@Setter @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "File", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") public class File diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyInfoType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyInfoType.java index edf9385e..b1b6c0ad 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyInfoType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyInfoType.java @@ -73,8 +73,8 @@ public class KeyInfoType { @XmlAnyElement(lax = true) protected List content; - @Setter @Getter + @Setter @XmlAttribute(name = "Id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyValueType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyValueType.java index 8985b710..28351480 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyValueType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/KeyValueType.java @@ -81,7 +81,7 @@ public class KeyValueType { */ public List getContent() { if (content == null) { - content = new ArrayList(); + content = new ArrayList<>(); } return this.content; } diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectFactory.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectFactory.java index fc9ba074..931083bc 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectFactory.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectFactory.java @@ -364,7 +364,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKIData") public JAXBElement createSPKIData(SPKIDataType value) { - return new JAXBElement(_SPKIData_QNAME, SPKIDataType.class, null, value); + return new JAXBElement<>(_SPKIData_QNAME, SPKIDataType.class, null, value); } /** @@ -372,7 +372,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyInfo") public JAXBElement createKeyInfo(KeyInfoType value) { - return new JAXBElement(_KeyInfo_QNAME, KeyInfoType.class, null, value); + return new JAXBElement<>(_KeyInfo_QNAME, KeyInfoType.class, null, value); } /** @@ -380,7 +380,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureValue") public JAXBElement createSignatureValue(SignatureValueType value) { - return new JAXBElement(_SignatureValue_QNAME, SignatureValueType.class, null, + return new JAXBElement<>(_SignatureValue_QNAME, SignatureValueType.class, null, value); } @@ -389,7 +389,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyValue") public JAXBElement createKeyValue(KeyValueType value) { - return new JAXBElement(_KeyValue_QNAME, KeyValueType.class, null, value); + return new JAXBElement<>(_KeyValue_QNAME, KeyValueType.class, null, value); } /** @@ -397,7 +397,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Transforms") public JAXBElement createTransforms(TransformsType value) { - return new JAXBElement(_Transforms_QNAME, TransformsType.class, null, value); + return new JAXBElement<>(_Transforms_QNAME, TransformsType.class, null, value); } /** @@ -405,7 +405,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestMethod") public JAXBElement createDigestMethod(DigestMethodType value) { - return new JAXBElement(_DigestMethod_QNAME, DigestMethodType.class, null, value); + return new JAXBElement<>(_DigestMethod_QNAME, DigestMethodType.class, null, value); } /** @@ -413,7 +413,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509Data") public JAXBElement createX509Data(X509DataType value) { - return new JAXBElement(_X509Data_QNAME, X509DataType.class, null, value); + return new JAXBElement<>(_X509Data_QNAME, X509DataType.class, null, value); } /** @@ -421,7 +421,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureProperty") public JAXBElement createSignatureProperty(SignaturePropertyType value) { - return new JAXBElement(_SignatureProperty_QNAME, SignaturePropertyType.class, + return new JAXBElement<>(_SignatureProperty_QNAME, SignaturePropertyType.class, null, value); } @@ -430,7 +430,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "KeyName") public JAXBElement createKeyName(String value) { - return new JAXBElement(_KeyName_QNAME, String.class, null, value); + return new JAXBElement<>(_KeyName_QNAME, String.class, null, value); } /** @@ -438,7 +438,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "RSAKeyValue") public JAXBElement createRSAKeyValue(RSAKeyValueType value) { - return new JAXBElement(_RSAKeyValue_QNAME, RSAKeyValueType.class, null, value); + return new JAXBElement<>(_RSAKeyValue_QNAME, RSAKeyValueType.class, null, value); } /** @@ -446,7 +446,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "SoftwareIdentity") public JAXBElement createSoftwareIdentity(SoftwareIdentity value) { - return new JAXBElement(_SoftwareIdentity_QNAME, SoftwareIdentity.class, null, + return new JAXBElement<>(_SoftwareIdentity_QNAME, SoftwareIdentity.class, null, value); } @@ -455,7 +455,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Signature") public JAXBElement createSignature(SignatureType value) { - return new JAXBElement(_Signature_QNAME, SignatureType.class, null, value); + return new JAXBElement<>(_Signature_QNAME, SignatureType.class, null, value); } /** @@ -463,7 +463,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "MgmtData") public JAXBElement createMgmtData(String value) { - return new JAXBElement(_MgmtData_QNAME, String.class, null, value); + return new JAXBElement<>(_MgmtData_QNAME, String.class, null, value); } /** @@ -471,7 +471,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureMethod") public JAXBElement createSignatureMethod(SignatureMethodType value) { - return new JAXBElement(_SignatureMethod_QNAME, SignatureMethodType.class, null, + return new JAXBElement<>(_SignatureMethod_QNAME, SignatureMethodType.class, null, value); } @@ -480,7 +480,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Object") public JAXBElement createObject(ObjectType value) { - return new JAXBElement(_Object_QNAME, ObjectType.class, null, value); + return new JAXBElement<>(_Object_QNAME, ObjectType.class, null, value); } /** @@ -488,7 +488,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignatureProperties") public JAXBElement createSignatureProperties(SignaturePropertiesType value) { - return new JAXBElement(_SignatureProperties_QNAME, + return new JAXBElement<>(_SignatureProperties_QNAME, SignaturePropertiesType.class, null, value); } @@ -497,7 +497,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Transform") public JAXBElement createTransform(TransformType value) { - return new JAXBElement(_Transform_QNAME, TransformType.class, null, value); + return new JAXBElement<>(_Transform_QNAME, TransformType.class, null, value); } /** @@ -505,7 +505,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPData") public JAXBElement createPGPData(PGPDataType value) { - return new JAXBElement(_PGPData_QNAME, PGPDataType.class, null, value); + return new JAXBElement<>(_PGPData_QNAME, PGPDataType.class, null, value); } /** @@ -513,7 +513,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Reference") public JAXBElement createReference(ReferenceType value) { - return new JAXBElement(_Reference_QNAME, ReferenceType.class, null, value); + return new JAXBElement<>(_Reference_QNAME, ReferenceType.class, null, value); } /** @@ -521,7 +521,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "RetrievalMethod") public JAXBElement createRetrievalMethod(RetrievalMethodType value) { - return new JAXBElement(_RetrievalMethod_QNAME, RetrievalMethodType.class, null, + return new JAXBElement<>(_RetrievalMethod_QNAME, RetrievalMethodType.class, null, value); } @@ -530,7 +530,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DSAKeyValue") public JAXBElement createDSAKeyValue(DSAKeyValueType value) { - return new JAXBElement(_DSAKeyValue_QNAME, DSAKeyValueType.class, null, value); + return new JAXBElement<>(_DSAKeyValue_QNAME, DSAKeyValueType.class, null, value); } /** @@ -538,7 +538,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "DigestValue") public JAXBElement createDigestValue(byte[] value) { - return new JAXBElement(_DigestValue_QNAME, byte[].class, null, value); + return new JAXBElement<>(_DigestValue_QNAME, byte[].class, null, value); } /** @@ -547,7 +547,7 @@ public class ObjectFactory { @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "CanonicalizationMethod") public JAXBElement createCanonicalizationMethod( CanonicalizationMethodType value) { - return new JAXBElement(_CanonicalizationMethod_QNAME, + return new JAXBElement<>(_CanonicalizationMethod_QNAME, CanonicalizationMethodType.class, null, value); } @@ -556,7 +556,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SignedInfo") public JAXBElement createSignedInfo(SignedInfoType value) { - return new JAXBElement(_SignedInfo_QNAME, SignedInfoType.class, null, value); + return new JAXBElement<>(_SignedInfo_QNAME, SignedInfoType.class, null, value); } /** @@ -564,7 +564,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "Manifest") public JAXBElement createManifest(ManifestType value) { - return new JAXBElement(_Manifest_QNAME, ManifestType.class, null, value); + return new JAXBElement<>(_Manifest_QNAME, ManifestType.class, null, value); } /** @@ -572,7 +572,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "XPath", scope = TransformType.class) public JAXBElement createTransformTypeXPath(String value) { - return new JAXBElement(_TransformTypeXPath_QNAME, String.class, TransformType.class, value); + return new JAXBElement<>(_TransformTypeXPath_QNAME, String.class, TransformType.class, value); } /** @@ -580,7 +580,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509IssuerSerial", scope = X509DataType.class) public JAXBElement createX509DataTypeX509IssuerSerial(X509IssuerSerialType value) { - return new JAXBElement(_X509DataTypeX509IssuerSerial_QNAME, + return new JAXBElement<>(_X509DataTypeX509IssuerSerial_QNAME, X509IssuerSerialType.class, X509DataType.class, value); } @@ -589,7 +589,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509CRL", scope = X509DataType.class) public JAXBElement createX509DataTypeX509CRL(byte[] value) { - return new JAXBElement(_X509DataTypeX509CRL_QNAME, byte[].class, X509DataType.class, + return new JAXBElement<>(_X509DataTypeX509CRL_QNAME, byte[].class, X509DataType.class, value); } @@ -598,7 +598,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509SubjectName", scope = X509DataType.class) public JAXBElement createX509DataTypeX509SubjectName(String value) { - return new JAXBElement(_X509DataTypeX509SubjectName_QNAME, String.class, X509DataType.class, + return new JAXBElement<>(_X509DataTypeX509SubjectName_QNAME, String.class, X509DataType.class, value); } @@ -607,7 +607,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509SKI", scope = X509DataType.class) public JAXBElement createX509DataTypeX509SKI(byte[] value) { - return new JAXBElement(_X509DataTypeX509SKI_QNAME, byte[].class, X509DataType.class, + return new JAXBElement<>(_X509DataTypeX509SKI_QNAME, byte[].class, X509DataType.class, value); } @@ -616,7 +616,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "X509Certificate", scope = X509DataType.class) public JAXBElement createX509DataTypeX509Certificate(byte[] value) { - return new JAXBElement(_X509DataTypeX509Certificate_QNAME, byte[].class, X509DataType.class, + return new JAXBElement<>(_X509DataTypeX509Certificate_QNAME, byte[].class, X509DataType.class, value); } @@ -625,7 +625,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Link", scope = SoftwareIdentity.class) public JAXBElement createSoftwareIdentityLink(Link value) { - return new JAXBElement(_SoftwareIdentityLink_QNAME, Link.class, SoftwareIdentity.class, value); + return new JAXBElement<>(_SoftwareIdentityLink_QNAME, Link.class, SoftwareIdentity.class, value); } /** @@ -633,7 +633,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Evidence", scope = SoftwareIdentity.class) public JAXBElement createSoftwareIdentityEvidence(Evidence value) { - return new JAXBElement(_SoftwareIdentityEvidence_QNAME, Evidence.class, + return new JAXBElement<>(_SoftwareIdentityEvidence_QNAME, Evidence.class, SoftwareIdentity.class, value); } @@ -642,7 +642,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Payload", scope = SoftwareIdentity.class) public JAXBElement createSoftwareIdentityPayload(ResourceCollection value) { - return new JAXBElement(_SoftwareIdentityPayload_QNAME, ResourceCollection.class, + return new JAXBElement<>(_SoftwareIdentityPayload_QNAME, ResourceCollection.class, SoftwareIdentity.class, value); } @@ -651,7 +651,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Directory", scope = ResourceCollection.class) public JAXBElement createPayloadDirectory(FilesystemItem value) { - return new JAXBElement(_PayloadDirectory_QNAME, FilesystemItem.class, + return new JAXBElement<>(_PayloadDirectory_QNAME, FilesystemItem.class, ResourceCollection.class, value); } @@ -660,7 +660,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "File", scope = ResourceCollection.class) public JAXBElement createDirectoryFile(FilesystemItem value) { - return new JAXBElement(_DirectoryFile_QNAME, FilesystemItem.class, + return new JAXBElement<>(_DirectoryFile_QNAME, FilesystemItem.class, ResourceCollection.class, value); } @@ -669,7 +669,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Entity", scope = SoftwareIdentity.class) public JAXBElement createSoftwareIdentityEntity(Entity value) { - return new JAXBElement(_SoftwareIdentityEntity_QNAME, Entity.class, SoftwareIdentity.class, + return new JAXBElement<>(_SoftwareIdentityEntity_QNAME, Entity.class, SoftwareIdentity.class, value); } @@ -678,7 +678,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd", name = "Meta", scope = SoftwareIdentity.class) public JAXBElement createSoftwareIdentityMeta(SoftwareMeta value) { - return new JAXBElement(_SoftwareIdentityMeta_QNAME, SoftwareMeta.class, + return new JAXBElement<>(_SoftwareIdentityMeta_QNAME, SoftwareMeta.class, SoftwareIdentity.class, value); } @@ -687,7 +687,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "HMACOutputLength", scope = SignatureMethodType.class) public JAXBElement createSignatureMethodTypeHMACOutputLength(BigInteger value) { - return new JAXBElement(_SignatureMethodTypeHMACOutputLength_QNAME, BigInteger.class, + return new JAXBElement<>(_SignatureMethodTypeHMACOutputLength_QNAME, BigInteger.class, SignatureMethodType.class, value); } @@ -696,7 +696,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "SPKISexp", scope = SPKIDataType.class) public JAXBElement createSPKIDataTypeSPKISexp(byte[] value) { - return new JAXBElement(_SPKIDataTypeSPKISexp_QNAME, byte[].class, SPKIDataType.class, + return new JAXBElement<>(_SPKIDataTypeSPKISexp_QNAME, byte[].class, SPKIDataType.class, value); } @@ -705,7 +705,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPKeyID", scope = PGPDataType.class) public JAXBElement createPGPDataTypePGPKeyID(byte[] value) { - return new JAXBElement(_PGPDataTypePGPKeyID_QNAME, byte[].class, PGPDataType.class, + return new JAXBElement<>(_PGPDataTypePGPKeyID_QNAME, byte[].class, PGPDataType.class, value); } @@ -714,8 +714,7 @@ public class ObjectFactory { */ @XmlElementDecl(namespace = "http://www.w3.org/2000/09/xmldsig#", name = "PGPKeyPacket", scope = PGPDataType.class) public JAXBElement createPGPDataTypePGPKeyPacket(byte[] value) { - return new JAXBElement(_PGPDataTypePGPKeyPacket_QNAME, byte[].class, PGPDataType.class, + return new JAXBElement<>(_PGPDataTypePGPKeyPacket_QNAME, byte[].class, PGPDataType.class, value); } - } diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectType.java index d045034c..c7e5afa0 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/ObjectType.java @@ -18,6 +18,7 @@ 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; @@ -46,31 +47,29 @@ import java.util.List; * </complexType> * */ +@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 content; - @Getter - @Setter @XmlAttribute(name = "Id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @XmlSchemaType(name = "ID") protected String id; - @Getter - @Setter @XmlAttribute(name = "MimeType") protected String mimeType; - @Getter - @Setter @XmlAttribute(name = "Encoding") @XmlSchemaType(name = "anyURI") protected String encoding; @@ -99,7 +98,7 @@ public class ObjectType { */ public List getContent() { if (content == null) { - content = new ArrayList(); + content = new ArrayList<>(); } return this.content; } diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/Process.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Process.java index ef04a7f4..a7555bd2 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/Process.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/Process.java @@ -35,17 +35,15 @@ import java.math.BigInteger; * </complexType> * */ -@Setter @Getter +@Setter @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "Process", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") public class Process extends Meta { - @XmlAttribute(name = "name", required = true) protected String name; - @XmlAttribute(name = "pid") protected BigInteger pid; } diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/Resource.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/Resource.java index 3913da9a..274f700c 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/Resource.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/Resource.java @@ -38,7 +38,6 @@ import lombok.Setter; @XmlType(name = "Resource", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") public class Resource extends Meta { - @XmlAttribute(name = "type", required = true) protected String type; } diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertyType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertyType.java index f06f9800..07b44af0 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertyType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignaturePropertyType.java @@ -18,6 +18,7 @@ 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; @@ -45,24 +46,24 @@ import java.util.List; * </complexType> * */ +@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 content; - @Getter - @Setter @XmlAttribute(name = "Target", required = true) @XmlSchemaType(name = "anyURI") protected String target; - @Getter - @Setter @XmlAttribute(name = "Id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID @@ -93,7 +94,7 @@ public class SignaturePropertyType { */ public List getContent() { if (content == null) { - content = new ArrayList(); + content = new ArrayList<>(); } return this.content; } diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureValueType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureValueType.java index b1432301..2fd4d545 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureValueType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/SignatureValueType.java @@ -43,11 +43,9 @@ import lombok.Setter; "value" }) public class SignatureValueType { - @XmlValue protected byte[] value; - @XmlAttribute(name = "Id") @XmlJavaTypeAdapter(CollapsedStringAdapter.class) @XmlID diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareMeta.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareMeta.java index 342fe601..ec3f5a5d 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareMeta.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/SoftwareMeta.java @@ -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; /** @@ -44,340 +46,54 @@ import jakarta.xml.bind.annotation.XmlType; * </complexType> * */ +@Getter +@Setter @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "SoftwareMeta", namespace = "http://standards.iso.org/iso/19770/-2/2015/schema.xsd") public class SoftwareMeta extends Meta { - @XmlAttribute(name = "activationStatus") protected String activationStatus; + @XmlAttribute(name = "channelType") protected String channelType; + @XmlAttribute(name = "colloquialVersion") protected String colloquialVersion; + @XmlAttribute(name = "description") protected String description; + @XmlAttribute(name = "edition") protected String edition; + @XmlAttribute(name = "entitlementDataRequired") protected Boolean entitlementDataRequired; + @XmlAttribute(name = "entitlementKey") protected String entitlementKey; + @XmlAttribute(name = "generator") protected String generator; + @XmlAttribute(name = "persistentId") protected String persistentId; + @XmlAttribute(name = "product") protected String product; + @XmlAttribute(name = "productFamily") protected String productFamily; + @XmlAttribute(name = "revision") protected String revision; + @XmlAttribute(name = "summary") protected String summary; + @XmlAttribute(name = "unspscCode") protected String unspscCode; + @XmlAttribute(name = "unspscVersion") protected String unspscVersion; - - /** - * Gets the value of the activationStatus property. - * - * @return possible object is - * {@link String } - */ - public String getActivationStatus() { - return activationStatus; - } - - /** - * Sets the value of the activationStatus property. - * - * @param value allowed object is - * {@link String } - */ - public void setActivationStatus(String value) { - this.activationStatus = value; - } - - /** - * Gets the value of the channelType property. - * - * @return possible object is - * {@link String } - */ - public String getChannelType() { - return channelType; - } - - /** - * Sets the value of the channelType property. - * - * @param value allowed object is - * {@link String } - */ - public void setChannelType(String value) { - this.channelType = value; - } - - /** - * Gets the value of the colloquialVersion property. - * - * @return possible object is - * {@link String } - */ - public String getColloquialVersion() { - return colloquialVersion; - } - - /** - * Sets the value of the colloquialVersion property. - * - * @param value allowed object is - * {@link String } - */ - public void setColloquialVersion(String value) { - this.colloquialVersion = value; - } - - /** - * Gets the value of the description property. - * - * @return possible object is - * {@link String } - */ - public String getDescription() { - return description; - } - - /** - * Sets the value of the description property. - * - * @param value allowed object is - * {@link String } - */ - public void setDescription(String value) { - this.description = value; - } - - /** - * Gets the value of the edition property. - * - * @return possible object is - * {@link String } - */ - public String getEdition() { - return edition; - } - - /** - * Sets the value of the edition property. - * - * @param value allowed object is - * {@link String } - */ - public void setEdition(String value) { - this.edition = value; - } - - /** - * Gets the value of the entitlementDataRequired property. - * - * @return possible object is - * {@link Boolean } - */ - public Boolean isEntitlementDataRequired() { - return entitlementDataRequired; - } - - /** - * Sets the value of the entitlementDataRequired property. - * - * @param value allowed object is - * {@link Boolean } - */ - public void setEntitlementDataRequired(Boolean value) { - this.entitlementDataRequired = value; - } - - /** - * Gets the value of the entitlementKey property. - * - * @return possible object is - * {@link String } - */ - public String getEntitlementKey() { - return entitlementKey; - } - - /** - * Sets the value of the entitlementKey property. - * - * @param value allowed object is - * {@link String } - */ - public void setEntitlementKey(String value) { - this.entitlementKey = value; - } - - /** - * Gets the value of the generator property. - * - * @return possible object is - * {@link String } - */ - public String getGenerator() { - return generator; - } - - /** - * Sets the value of the generator property. - * - * @param value allowed object is - * {@link String } - */ - public void setGenerator(String value) { - this.generator = value; - } - - /** - * Gets the value of the persistentId property. - * - * @return possible object is - * {@link String } - */ - public String getPersistentId() { - return persistentId; - } - - /** - * Sets the value of the persistentId property. - * - * @param value allowed object is - * {@link String } - */ - public void setPersistentId(String value) { - this.persistentId = value; - } - - /** - * Gets the value of the product property. - * - * @return possible object is - * {@link String } - */ - public String getProduct() { - return product; - } - - /** - * Sets the value of the product property. - * - * @param value allowed object is - * {@link String } - */ - public void setProduct(String value) { - this.product = value; - } - - /** - * Gets the value of the productFamily property. - * - * @return possible object is - * {@link String } - */ - public String getProductFamily() { - return productFamily; - } - - /** - * Sets the value of the productFamily property. - * - * @param value allowed object is - * {@link String } - */ - public void setProductFamily(String value) { - this.productFamily = value; - } - - /** - * Gets the value of the revision property. - * - * @return possible object is - * {@link String } - */ - public String getRevision() { - return revision; - } - - /** - * Sets the value of the revision property. - * - * @param value allowed object is - * {@link String } - */ - public void setRevision(String value) { - this.revision = value; - } - - /** - * Gets the value of the summary property. - * - * @return possible object is - * {@link String } - */ - public String getSummary() { - return summary; - } - - /** - * Sets the value of the summary property. - * - * @param value allowed object is - * {@link String } - */ - public void setSummary(String value) { - this.summary = value; - } - - /** - * Gets the value of the unspscCode property. - * - * @return possible object is - * {@link String } - */ - public String getUnspscCode() { - return unspscCode; - } - - /** - * Sets the value of the unspscCode property. - * - * @param value allowed object is - * {@link String } - */ - public void setUnspscCode(String value) { - this.unspscCode = value; - } - - /** - * Gets the value of the unspscVersion property. - * - * @return possible object is - * {@link String } - */ - public String getUnspscVersion() { - return unspscVersion; - } - - /** - * Sets the value of the unspscVersion property. - * - * @param value allowed object is - * {@link String } - */ - public void setUnspscVersion(String value) { - this.unspscVersion = value; - } - } diff --git a/HIRS_Utils/src/main/java/hirs/utils/xjc/X509IssuerSerialType.java b/HIRS_Utils/src/main/java/hirs/utils/xjc/X509IssuerSerialType.java index 78c8f2c3..5c02eea6 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/xjc/X509IssuerSerialType.java +++ b/HIRS_Utils/src/main/java/hirs/utils/xjc/X509IssuerSerialType.java @@ -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; import java.math.BigInteger; @@ -34,56 +36,17 @@ import java.math.BigInteger; * </complexType> * */ +@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; - } - }