Java Code Examples for javacard.framework.JCSystem#isObjectDeletionSupported()

The following examples show how to use javacard.framework.JCSystem#isObjectDeletionSupported() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BerTlvFile.java    From GidsApplet with GNU General Public License v3.0 6 votes vote down vote up
/**
 * \brief Delete a DO
 *
 * This method requests garbage collection.
 *
 * \param childNum internal index
 */
protected void deleteChildren(short childNum) {

    // Fill up empty field in children array.
    if(!JCSystem.isObjectDeletionSupported()) {
        children[childNum].clearContents();
    }

    children[childNum] = null;
    currentNumChildren--; // We have one less children now.


    // The last children is one ahead, so it is at currentNumChildren.
    if(childNum < currentNumChildren) {
        children[childNum] = children[currentNumChildren];
    }

    // Clean up the old file object.
    if(JCSystem.isObjectDeletionSupported()) {
        JCSystem.requestObjectDeletion();
    }
}
 
Example 2
Source File: CRTKeyFile.java    From GidsApplet with GNU General Public License v3.0 5 votes vote down vote up
void clearContents() {
    if (symmetricKey != null) {
        symmetricKey = null;
    }
    if (keyPair != null) {
        keyPair.getPrivate().clearKey();
        keyPair = null;
    }
    if(JCSystem.isObjectDeletionSupported()) {
        JCSystem.requestObjectDeletion();
    }
}
 
Example 3
Source File: TransmitManager.java    From GidsApplet with GNU General Public License v3.0 5 votes vote down vote up
public void ClearFlashBuffer() {
    if (flash_buf != null)
    {
        if(JCSystem.isObjectDeletionSupported()) {
            flash_buf = null;
            JCSystem.requestObjectDeletion();
        } else {
            Util.arrayFillNonAtomic(flash_buf, (short)0, FLASH_BUF_SIZE, (byte)0x00);
        }
    }
}