Search in sources :

Example 1 with ByteArrayWrapper

use of org.openecard.common.util.ByteArrayWrapper 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;
    }
}
Also used : ByteArrayWrapper(org.openecard.common.util.ByteArrayWrapper) CardApplicationWrapper(org.openecard.common.sal.state.cif.CardApplicationWrapper) SecurityConditionType(iso.std.iso_iec._24727.tech.schema.SecurityConditionType) DataSetInfoWrapper(org.openecard.common.sal.state.cif.DataSetInfoWrapper)

Example 2 with ByteArrayWrapper

use of org.openecard.common.util.ByteArrayWrapper 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;
    }
}
Also used : ByteArrayWrapper(org.openecard.common.util.ByteArrayWrapper) CardApplicationWrapper(org.openecard.common.sal.state.cif.CardApplicationWrapper) SecurityConditionType(iso.std.iso_iec._24727.tech.schema.SecurityConditionType)

Example 3 with ByteArrayWrapper

use of org.openecard.common.util.ByteArrayWrapper in project open-ecard by ecsec.

the class CardInfoWrapper method getDataSet.

/**
 * @param dataSetName
 *            name of the data set to get the datasetinfo for
 * @param applicationIdentifier
 *            identifier of the application containing the data set
 * @return the DataSetInfo for the specified data set or null, if no such data set exists in the specified
 *         application
 */
public DataSetInfoType getDataSet(String dataSetName, byte[] applicationIdentifier) {
    CardApplicationWrapper application = cardApplications.get(new ByteArrayWrapper(applicationIdentifier));
    if (application == null) {
        return null;
    }
    DataSetInfoWrapper dataSet = application.getDataSetInfo(dataSetName);
    if (dataSet == null) {
        return null;
    } else {
        return dataSet.getDataSetInfo();
    }
}
Also used : ByteArrayWrapper(org.openecard.common.util.ByteArrayWrapper)

Example 4 with ByteArrayWrapper

use of org.openecard.common.util.ByteArrayWrapper in project open-ecard by ecsec.

the class CardInfoWrapper method getDIDInfo.

/**
 * @param didName name of the did to get the DIDInfo for
 * @param applicationIdentifier identifier of the application the DID belongs to
 * @return the DIDInfo of the specified DID or null, if either the card application or the DID do not exist
 */
public DIDInfoType getDIDInfo(String didName, byte[] applicationIdentifier) {
    CardApplicationWrapper application = this.getCardApplications().get(new ByteArrayWrapper(applicationIdentifier));
    if (application == null) {
        return null;
    }
    DIDInfoWrapper didInfo = application.getDIDInfo(didName);
    if (didInfo == null) {
        return null;
    } else {
        return didInfo.getDIDInfo();
    }
}
Also used : ByteArrayWrapper(org.openecard.common.util.ByteArrayWrapper)

Example 5 with ByteArrayWrapper

use of org.openecard.common.util.ByteArrayWrapper in project open-ecard by ecsec.

the class CardStateEntry method checkDIDSecurityCondition.

public boolean checkDIDSecurityCondition(byte[] cardApplication, String didName, Enum<?> serviceAction) {
    CardApplicationWrapper application = this.infoObject.getCardApplications().get(new ByteArrayWrapper(cardApplication));
    DIDInfoWrapper dataSetInfo = application.getDIDInfo(didName);
    SecurityConditionType securityCondition = dataSetInfo.getSecurityCondition(serviceAction);
    if (securityCondition != null) {
        return checkSecurityCondition(securityCondition);
    } else {
        return false;
    }
}
Also used : DIDInfoWrapper(org.openecard.common.sal.state.cif.DIDInfoWrapper) ByteArrayWrapper(org.openecard.common.util.ByteArrayWrapper) CardApplicationWrapper(org.openecard.common.sal.state.cif.CardApplicationWrapper) SecurityConditionType(iso.std.iso_iec._24727.tech.schema.SecurityConditionType)

Aggregations

ByteArrayWrapper (org.openecard.common.util.ByteArrayWrapper)5 SecurityConditionType (iso.std.iso_iec._24727.tech.schema.SecurityConditionType)3 CardApplicationWrapper (org.openecard.common.sal.state.cif.CardApplicationWrapper)3 DIDInfoWrapper (org.openecard.common.sal.state.cif.DIDInfoWrapper)1 DataSetInfoWrapper (org.openecard.common.sal.state.cif.DataSetInfoWrapper)1