use of iso.std.iso_iec._24727.tech.schema.SecurityConditionType in project open-ecard by ecsec.
the class AccessRuleCreator method create.
public AccessRuleType create() {
AccessRuleType art = new AccessRuleType();
art.setCardApplicationServiceName(serviceName);
art.setAction(actionNameType);
SecurityConditionType security = new SecurityConditionType();
if (securityConditionAlways != null) {
security.setAlways(securityConditionAlways);
}
if (securityConditionNever != null) {
security.setNever(securityConditionNever);
}
art.setSecurityCondition(security);
return art;
}
use of iso.std.iso_iec._24727.tech.schema.SecurityConditionType in project open-ecard by ecsec.
the class CardStateEntry method checkDataSetSecurityCondition.
public boolean checkDataSetSecurityCondition(byte[] cardApplication, String dataSetName, Enum<?> serviceAction) {
CardApplicationWrapper application = this.infoObject.getCardApplications().get(new ByteArrayWrapper(cardApplication));
DataSetInfoWrapper dataSetInfo = application.getDataSetInfo(dataSetName);
SecurityConditionType securityCondition = dataSetInfo.getSecurityCondition(serviceAction);
if (securityCondition != null) {
return checkSecurityCondition(securityCondition);
} else {
return false;
}
}
use of iso.std.iso_iec._24727.tech.schema.SecurityConditionType in project open-ecard by ecsec.
the class CardStateEntry method checkApplicationSecurityCondition.
public boolean checkApplicationSecurityCondition(byte[] applicationIdentifier, Enum<?> serviceAction) {
if (applicationIdentifier == null) {
applicationIdentifier = infoObject.getImplicitlySelectedApplication();
}
CardApplicationWrapper application = this.infoObject.getCardApplications().get(new ByteArrayWrapper(applicationIdentifier));
SecurityConditionType securityCondition = application.getSecurityCondition(serviceAction);
if (securityCondition != null) {
return checkSecurityCondition(securityCondition);
} else {
return false;
}
}
use of iso.std.iso_iec._24727.tech.schema.SecurityConditionType in project open-ecard by ecsec.
the class AndroidMarshaller method parseSecurityCondition.
private SecurityConditionType parseSecurityCondition(XmlPullParser parser) throws XmlPullParserException, IOException {
SecurityConditionType securityCondition = new SecurityConditionType();
int eventType;
do {
parser.next();
eventType = parser.getEventType();
if (eventType == XmlPullParser.START_TAG) {
if (parser.getName().equals("always")) {
securityCondition.setAlways(true);
} else if (parser.getName().equals("never")) {
securityCondition.setNever(false);
} else if (parser.getName().equals("DIDAuthentication")) {
securityCondition.setDIDAuthentication(this.parseDIDAuthenticationState(parser));
} else if (parser.getName().equals("not")) {
securityCondition.setNot(this.parseSecurityCondition(parser));
} else if (parser.getName().equals("and")) {
securityCondition.setAnd(this.parseSecurityConditionTypeAnd(parser));
} else if (parser.getName().equals("or")) {
securityCondition.setOr(this.parseSecurityConditionTypeOr(parser));
} else {
throw new IOException(parser.getName() + " not yet implemented");
}
}
} while (!(eventType == XmlPullParser.END_TAG && parser.getName().equals("SecurityCondition")));
return securityCondition;
}
use of iso.std.iso_iec._24727.tech.schema.SecurityConditionType in project open-ecard by ecsec.
the class CIFCreator method createTrueCond.
private SecurityConditionType createTrueCond() {
SecurityConditionType cond = new SecurityConditionType();
cond.setAlways(true);
return cond;
}
Aggregations