@Override public void setValue(Object value) { setLongValue((Long) value); }
sb.append("\n Secondary Authentication: ").append(secondaryAuth); sb.append("\n Secondary Authentication PIN Flags: "); if (authPinFlags.isPresent() && !authPinFlags.isSensitive() && (authPinFlags.getLongValue() != null)) { long authFlagsValue = authPinFlags.getLongValue().longValue();
/** * 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); }
/** * 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 Value (hex): ", value, (valueLen.isPresent() ? "\n Value Length (dec): " : valueLen.toString(10))); }
/** * 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. */ @Override public boolean equals(Object otherObject) { if (this == otherObject) { return true; } else if (!(otherObject instanceof Mechanism)) { return false; } Mechanism other = (Mechanism) otherObject; return super.equals(other) && this.mechanismType.equals(other.mechanismType); }
/** * 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 Prime (hex): ", prime, "\n Base (hex): ", base, "\n Subprime (hex): ", subprime, "\n Prime Bits (dec): ", primeBits.toString(10), "\n Subprime Bits (dec): ", subprimeBits.toString(10)); }
long keyType = privateKey.getKeyType().getLongValue().longValue();
/** * The overriding of this method should ensure that the objects of this * class work correctly in a hashtable. * * @return The hash code of this object. */ @Override public int hashCode() { return mechanismType.hashCode(); } }
/** * Get a string representation of this attribute. The radix for the * presentation of the value can be specified; e.g. 16 for hex, 10 for * decimal. * * @param radix * The radix for the representation of the value. * @return A string representation of the value of this attribute. * @preconditions * @postconditions (result <> null) */ public String toString(int radix) { if (present) { if (sensitive) { return "<Value is sensitive>"; } else { return getValueString(radix); } } else { return "<Attribute not present>"; } }
/** * 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 ValuedSecretKey)) { return false; } ValuedSecretKey other = (ValuedSecretKey) otherObject; return super.equals(other) && this.value.equals(other.value) && this.valueLen.equals(other.valueLen); }
/** * 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 Modulus (hex): ", modulus, "\n Public Exponent (hex): ", publicExponent, "\n Modulus Bits (dec): ", modulusBits.toString(10)); }
/** * The overriding of this method should ensure that the objects of this * class work correctly in a hashtable. * * @return The hash code of this object. */ @Override public int hashCode() { return pixelX.hashCode() ^ pixelY.hashCode() ^ resolution.hashCode() ^ charRows.hashCode() ^ charColumns.hashCode() ^ color.hashCode() ^ bitsPerPixel.hashCode() ^ charSets.hashCode() ^ encodingMethods.hashCode() ^ mimeTypes.hashCode(); }
/** * 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)); }
@Override protected P11Identity generateRSAKeypair0(final int keysize, final BigInteger publicExponent, final String label, P11NewKeyControl control) throws P11TokenException { RSAPrivateKey privateKey = new RSAPrivateKey(); RSAPublicKey publicKey = new RSAPublicKey(); setKeyAttributes(label, PKCS11Constants.CKK_RSA, control, publicKey, privateKey); publicKey.getModulusBits().setLongValue((long) keysize); if (publicExponent != null) { publicKey.getPublicExponent().setByteArrayValue(publicExponent.toByteArray()); } return generateKeyPair(PKCS11Constants.CKM_RSA_PKCS_KEY_PAIR_GEN, privateKey, publicKey); }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. */ @Override protected void allocateAttributes() { super.allocateAttributes(); mechanismType = new LongAttribute(Attribute.MECHANISM_TYPE); 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 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 X942DHParams)) { return false; } X942DHParams other = (X942DHParams) otherObject; return super.equals(other) && this.prime.equals(other.prime) && this.base.equals(other.base) && this.subprime.equals(other.subprime) && this.primeBits.equals(other.primeBits) && this.subprimeBits.equals(other.subprimeBits); }
/** * 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 Prime (hex): ", prime, "\n Base (hex): ", base, "\n Prime Bits (dec): ", primeBits.toString(10)); }
@Override protected P11Identity generateRSAKeypair0(int keysize, BigInteger publicExponent, P11NewKeyControl control) throws P11TokenException { long mech = PKCS11Constants.CKM_RSA_PKCS_KEY_PAIR_GEN; assertMechanismSupported(mech); RSAPrivateKey privateKey = new RSAPrivateKey(); RSAPublicKey publicKey = new RSAPublicKey(); setKeyAttributes(control, publicKey, privateKey); publicKey.getModulusBits().setLongValue((long) keysize); if (publicExponent != null) { publicKey.getPublicExponent().setByteArrayValue(publicExponent.toByteArray()); } return generateKeyPair(mech, control.getId(), privateKey, publicKey); }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); prime = new ByteArrayAttribute(Attribute.PRIME); base = new ByteArrayAttribute(Attribute.BASE); subprime = new ByteArrayAttribute(Attribute.SUBPRIME); primeBits = new LongAttribute(Attribute.PRIME_BITS); subprimeBits = new LongAttribute(Attribute.SUB_PRIME_BITS); 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 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 DHParams)) { return false; } DHParams other = (DHParams) otherObject; return super.equals(other) && this.prime.equals(other.prime) && this.base.equals(other.base) && this.primeBits.equals(other.primeBits); }