newObject = new HardwareFeature(session, objectHandle); newObject = new HardwareFeature(session, objectHandle);
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); value = new ByteArrayAttribute(Attribute.VALUE); putAttributesInTable(this); }
/** * Compares all member variables of this object with the other object. * Returns only true, if all are equal in both objects. * * @param otherObject * The other object to compare to. * @return True, if other is an instance of Info and all member variables of * both objects are equal. False, otherwise. * @preconditions * @postconditions */ @Override public boolean equals(Object otherObject) { if (this == otherObject) { return true; } else if (!(otherObject instanceof Clock)) { return false; } Clock other = (Clock) otherObject; return super.equals(other) && this.value.equals(other.value); }
getAttributeValue(session, objectHandle, hardwareFeatureTypeAttribute); newObject = getUnknownHardwareFeature(session, objectHandle); } else if ((hardwareFeatureType.longValue() & FeatureType.VENDOR_DEFINED.longValue()) != 0L) { newObject = getUnknownHardwareFeature(session, objectHandle); } else { newObject = getUnknownHardwareFeature(session, objectHandle); newObject = getUnknownHardwareFeature(session, objectHandle);
/** * Read the values of the attributes of this object from the token. * * @param session * The session to use for reading attributes. This session must * have the appropriate rights; i.e. it must be a user-session, if * it is a private object. * @exception TokenException * If getting the attributes failed. * @preconditions (session <> null) * @postconditions */ @Override public void readAttributes(Session session) throws TokenException { super.readAttributes(session); PKCS11Object.getAttributeValue(session, objectHandle, value); }
/** * Returns a string representation of the current object. The * output is only for debugging purposes and should not be used for other * purposes. * * @return A string presentation of this object for debugging output. * @preconditions * @postconditions (result <> null) */ @Override public String toString() { String superToString = super.toString(); return Util.concatObjectsCap(superToString.length() + 100, superToString, "\n Reset on Initialization: ", resetOnInit, "\n Has been reset: ", hasReset, "\n Value (hex): ", value); }
/** * Get a string representation of the value of this attribute. * * @return A string representation of the value of this attribute. * @preconditions * @postconditions (result <> null) */ @SuppressWarnings("restriction") @Override protected String getValueString() { if ((ckAttribute != null) && (ckAttribute.pValue != null)) { return HardwareFeature .getHardwareFeatureTypeName((Long) ckAttribute.pValue); } else { return "<NULL_PTR>"; } }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); hardwareFeatureType = new HardwareFeatureTypeAttribute(); putAttributesInTable(this); }
newObject = Mechanism.getInstance(session, objectHandle); } else if (objectClass.equals(ObjectClass.HW_FEATURE)) { newObject = HardwareFeature.getInstance(session, objectHandle); } else if ((objectClass.longValue() & ObjectClass.VENDOR_DEFINED.longValue()) != 0L) {
/** * Read the values of the attributes of this object from the token. * * @param session * The session to use for reading attributes. This session must * have the appropriate rights; i.e. it must be a user-session, if * it is a private object. * @exception TokenException * If getting the attributes failed. */ @Override public void readAttributes(Session session) throws TokenException { super.readAttributes(session); PKCS11Object.getAttributeValues(session, objectHandle, new Attribute[] { pixelX, pixelY, resolution, charRows, charColumns, color, bitsPerPixel, charSets, encodingMethods, mimeTypes }); }
/** * Returns a string representation of the current object. The * output is only for debugging purposes and should not be used for other * purposes. * * @return A string presentation of this object for debugging output. * @preconditions * @postconditions (result <> null) */ @Override public String toString() { StringBuilder sb = new StringBuilder(super.toString()); sb.append("\nValue: "); try { sb.append(new String(value.getByteArrayValue(), "ASCII")); } catch (UnsupportedEncodingException ex) { sb.append(new String(value.getByteArrayValue())); } return sb.toString(); }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); resetOnInit = new BooleanAttribute(Attribute.RESET_ON_INIT); hasReset = new BooleanAttribute(Attribute.HAS_RESET); value = new ByteArrayAttribute(Attribute.VALUE); putAttributesInTable(this); }
/** * Read the values of the attributes of this object from the token. * * @param session * The session to use for reading attributes. This session must * have the appropriate rights; i.e. it must be a user-session, if * it is a private object. * @exception TokenException * If getting the attributes failed. * @preconditions (session <> null) * @postconditions */ @Override public void readAttributes(Session session) throws TokenException { super.readAttributes(session); PKCS11Object.getAttributeValues(session, objectHandle, new Attribute[] { resetOnInit, hasReset, value }); }
/** * Returns a string representation of the current object. The * output is only for debugging purposes and should not be used for other * purposes. * * @return A string presentation of this object for debugging output. */ @Override public String toString() { String superToString = super.toString(); return Util.concatObjectsCap(superToString.length() + 100, superToString, "\n Pixel X: ", pixelX.getValueString(), "\n Pixel Y: ", pixelY.getValueString(), "\n Resolution: ", resolution.getValueString(), "\n Char Rows: ", charRows.getValueString(), "\n Char Columns: ", charColumns.getValueString(), "\n Color: ", color.getValueString(), "\n Bits per Pixel: ", bitsPerPixel.getValueString(), "\n Char sets:", toString(charSets), "\n Encoding methods: ", toString(encodingMethods), "\n Mime Types: ", toString(mimeTypes)); }
/** * Compares all member variables of this object with the other object. * Returns only true, if all are equal in both objects. * * @param otherObject * The other object to compare to. * @return True, if other is an instance of this class and all member * variables of both objects are equal. False, otherwise. * @preconditions * @postconditions */ @Override public boolean equals(Object otherObject) { if (this == otherObject) { return true; } else if (!(otherObject instanceof MonotonicCounter)) { return false; } MonotonicCounter other = (MonotonicCounter) otherObject; return super.equals(other) && this.resetOnInit.equals(other.resetOnInit) && this.hasReset.equals(other.hasReset) && this.value.equals(other.value); }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. */ @Override protected void allocateAttributes() { super.allocateAttributes(); pixelX = new LongAttribute(Attribute.PIXEL_X); pixelY = new LongAttribute(Attribute.PIXEL_Y); resolution = new LongAttribute(Attribute.RESOLUTION); charRows = new LongAttribute(Attribute.CHAR_ROWS); charColumns = new LongAttribute(Attribute.CHAR_COLUMNS); color = new BooleanAttribute(Attribute.COLOR); bitsPerPixel = new LongAttribute(Attribute.BITS_PER_PIXEL); charSets = new ByteArrayAttribute(Attribute.CHAR_SETS); encodingMethods = new ByteArrayAttribute(Attribute.ENCODING_METHODS); mimeTypes = new ByteArrayAttribute(Attribute.MIME_TYPES); putAttributesInTable(this); }
@Override public boolean equals(Object otherObject) { if (this == otherObject) { return true; } else if (!super.equals(otherObject)) { return false; } else if (getClass() != otherObject.getClass()) { return false; } UserInterface other = (UserInterface) otherObject; return Util.objEquals(this.bitsPerPixel, other.bitsPerPixel) && Util.objEquals(this.charColumns, other.charColumns) && Util.objEquals(this.charRows, other.charRows) && Util.objEquals(this.charSets, other.charSets) && Util.objEquals(this.color, other.color) && Util.objEquals(this.encodingMethods, other.encodingMethods) && Util.objEquals(this.mimeTypes, other.mimeTypes) && Util.objEquals(this.mimeTypes, other.mimeTypes) && Util.objEquals(this.pixelX, other.pixelX) && Util.objEquals(this.pixelY, other.pixelY) && Util.objEquals(this.resolution, other.resolution); }