mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-03-11 15:04:15 +00:00
Removed changes because the PC is not loading URIReference
This commit is contained in:
parent
3197f4a818
commit
c6dcf36e04
@ -176,7 +176,6 @@ public class CommonCriteriaMeasures {
|
|||||||
private ASN1ObjectIdentifier targetOid;
|
private ASN1ObjectIdentifier targetOid;
|
||||||
private URIReference profileUri;
|
private URIReference profileUri;
|
||||||
private URIReference targetUri;
|
private URIReference targetUri;
|
||||||
private ASN1Sequence sequence;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
@ -261,41 +260,8 @@ public class CommonCriteriaMeasures {
|
|||||||
+ "invalid tagged object.");
|
+ "invalid tagged object.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sequence = ASN1Sequence.getInstance(sequence);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public URIReference getProfileUri() {
|
|
||||||
if (profileUri != null) {
|
|
||||||
return new URIReference(profileUri.getSequence());
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProfileUri(final URIReference profileUri) {
|
|
||||||
if (profileUri != null) {
|
|
||||||
this.profileUri = new URIReference(profileUri.getSequence());
|
|
||||||
} else {
|
|
||||||
this.profileUri = new URIReference();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public URIReference getTargetUri() {
|
|
||||||
if (targetUri != null) {
|
|
||||||
return new URIReference(targetUri.getSequence());
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTargetUri(final URIReference targetUri) {
|
|
||||||
if (targetUri != null) {
|
|
||||||
this.targetUri = new URIReference(targetUri.getSequence());
|
|
||||||
} else {
|
|
||||||
this.targetUri = new URIReference();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
package hirs.attestationca.persist.entity.userdefined.certificate.attributes;
|
package hirs.attestationca.persist.entity.userdefined.certificate.attributes;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -8,10 +12,13 @@ import java.util.List;
|
|||||||
* Abstract class that provides base info for Platform Configuration of
|
* Abstract class that provides base info for Platform Configuration of
|
||||||
* the Platform Certificate Attribute.
|
* the Platform Certificate Attribute.
|
||||||
*/
|
*/
|
||||||
|
@AllArgsConstructor
|
||||||
public abstract class PlatformConfiguration {
|
public abstract class PlatformConfiguration {
|
||||||
private ArrayList<ComponentIdentifier> componentIdentifier = new ArrayList<>();
|
private ArrayList<ComponentIdentifier> componentIdentifier = new ArrayList<>();
|
||||||
|
@Getter @Setter
|
||||||
private URIReference componentIdentifierUri;
|
private URIReference componentIdentifierUri;
|
||||||
private ArrayList<PlatformProperty> platformProperties = new ArrayList<>();
|
private ArrayList<PlatformProperty> platformProperties = new ArrayList<>();
|
||||||
|
@Getter @Setter
|
||||||
private URIReference platformPropertiesUri;
|
private URIReference platformPropertiesUri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,22 +30,6 @@ public abstract class PlatformConfiguration {
|
|||||||
this.platformProperties = new ArrayList<>();
|
this.platformProperties = new ArrayList<>();
|
||||||
this.platformPropertiesUri = null;
|
this.platformPropertiesUri = null;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Constructor given the Platform Configuration values.
|
|
||||||
*
|
|
||||||
* @param componentIdentifier list containing all the components inside the
|
|
||||||
* Platform Configuration.
|
|
||||||
* @param platformProperties list containing all the properties inside the
|
|
||||||
* Platform Configuration.
|
|
||||||
* @param platformPropertiesUri object containing the URI Reference
|
|
||||||
*/
|
|
||||||
public PlatformConfiguration(final List<ComponentIdentifier> componentIdentifier,
|
|
||||||
final List<PlatformProperty> platformProperties,
|
|
||||||
final URIReference platformPropertiesUri,
|
|
||||||
final URIReference componentIdentifierUri) {
|
|
||||||
this(componentIdentifier, platformProperties, platformPropertiesUri);
|
|
||||||
this.componentIdentifierUri = new URIReference(componentIdentifierUri.getSequence());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor given the Platform Configuration values.
|
* Constructor given the Platform Configuration values.
|
||||||
@ -54,39 +45,7 @@ public abstract class PlatformConfiguration {
|
|||||||
final URIReference platformPropertiesUri) {
|
final URIReference platformPropertiesUri) {
|
||||||
this.componentIdentifier = new ArrayList<>(componentIdentifier);
|
this.componentIdentifier = new ArrayList<>(componentIdentifier);
|
||||||
this.platformProperties = new ArrayList<>(platformProperties);
|
this.platformProperties = new ArrayList<>(platformProperties);
|
||||||
this.platformPropertiesUri = new URIReference(platformPropertiesUri.getSequence());
|
this.platformPropertiesUri = platformPropertiesUri;
|
||||||
}
|
|
||||||
|
|
||||||
public URIReference getComponentIdentifierUri() {
|
|
||||||
if (componentIdentifierUri != null) {
|
|
||||||
return new URIReference(componentIdentifierUri.getSequence());
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setComponentIdentifierUri(final URIReference componentIdentifierUri) {
|
|
||||||
if (componentIdentifierUri != null) {
|
|
||||||
this.componentIdentifierUri = new URIReference(componentIdentifierUri.getSequence());
|
|
||||||
} else {
|
|
||||||
this.componentIdentifierUri = new URIReference();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public URIReference getPlatformPropertiesUri() {
|
|
||||||
if (platformPropertiesUri != null) {
|
|
||||||
return new URIReference(platformPropertiesUri.getSequence());
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPlatformPropertiesUri(final URIReference platformPropertiesUri) {
|
|
||||||
if (platformPropertiesUri != null) {
|
|
||||||
this.platformPropertiesUri = new URIReference(platformPropertiesUri.getSequence());
|
|
||||||
} else {
|
|
||||||
this.platformPropertiesUri = new URIReference();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +27,6 @@ public class URIReference {
|
|||||||
private AlgorithmIdentifier hashAlgorithm;
|
private AlgorithmIdentifier hashAlgorithm;
|
||||||
@JsonIgnore
|
@JsonIgnore
|
||||||
private DERBitString hashValue;
|
private DERBitString hashValue;
|
||||||
private ASN1Sequence sequence;
|
|
||||||
|
|
||||||
private static final int PLATFORM_PROPERTIES_URI_MAX = 3;
|
private static final int PLATFORM_PROPERTIES_URI_MAX = 3;
|
||||||
private static final int PLATFORM_PROPERTIES_URI_MIN = 1;
|
private static final int PLATFORM_PROPERTIES_URI_MIN = 1;
|
||||||
@ -48,9 +47,6 @@ public class URIReference {
|
|||||||
* @throws IllegalArgumentException if there was an error on the parsing
|
* @throws IllegalArgumentException if there was an error on the parsing
|
||||||
*/
|
*/
|
||||||
public URIReference(final ASN1Sequence sequence) throws IllegalArgumentException {
|
public URIReference(final ASN1Sequence sequence) throws IllegalArgumentException {
|
||||||
if (sequence == null) {
|
|
||||||
return ;
|
|
||||||
}
|
|
||||||
//Check if the sequence contains the two values required
|
//Check if the sequence contains the two values required
|
||||||
if (sequence.size() > PLATFORM_PROPERTIES_URI_MAX
|
if (sequence.size() > PLATFORM_PROPERTIES_URI_MAX
|
||||||
|| sequence.size() < PLATFORM_PROPERTIES_URI_MIN) {
|
|| sequence.size() < PLATFORM_PROPERTIES_URI_MIN) {
|
||||||
@ -73,8 +69,6 @@ public class URIReference {
|
|||||||
+ sequence.getObjectAt(j).getClass().getName() + " found at index " + j + ".");
|
+ sequence.getObjectAt(j).getClass().getName() + " found at index " + j + ".");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.sequence = ASN1Sequence.getInstance(sequence);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -96,11 +96,7 @@ public class ComponentIdentifierV2 extends ComponentIdentifier {
|
|||||||
this.componentClass = componentClass;
|
this.componentClass = componentClass;
|
||||||
// additional optional component identifiers
|
// additional optional component identifiers
|
||||||
this.certificateIdentifier = certificateIdentifier;
|
this.certificateIdentifier = certificateIdentifier;
|
||||||
if (componentPlatformUri != null) {
|
this.componentPlatformUri = componentPlatformUri;
|
||||||
this.componentPlatformUri = new URIReference(componentPlatformUri.getSequence());
|
|
||||||
} else {
|
|
||||||
this.componentPlatformUri = new URIReference();
|
|
||||||
}
|
|
||||||
this.attributeStatus = attributeStatus;
|
this.attributeStatus = attributeStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,28 +163,6 @@ public class ComponentIdentifierV2 extends ComponentIdentifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return the componentPlatformUri.
|
|
||||||
*/
|
|
||||||
public URIReference getComponentPlatformUri() {
|
|
||||||
if (this.componentPlatformUri != null) {
|
|
||||||
return new URIReference(componentPlatformUri.getSequence());
|
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param componentPlatformUri the componentPlatformUri to set.
|
|
||||||
*/
|
|
||||||
public void setComponentPlatformUri(final URIReference componentPlatformUri) {
|
|
||||||
if (componentPlatformUri != null) {
|
|
||||||
this.componentPlatformUri = new URIReference(componentPlatformUri.getSequence());
|
|
||||||
} else {
|
|
||||||
this.componentPlatformUri = new URIReference();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the component has been modified.
|
* @return true if the component has been modified.
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user