/** * Default Constructor. * * @preconditions * @postconditions */ public DHPublicKey() { keyType.setLongValue(KeyType.DH); }
Util.requireNonNull("session", session); KeyTypeAttribute keyTypeAttribute = new KeyTypeAttribute(); getAttributeValue(session, objectHandle, keyTypeAttribute); Long keyType = keyTypeAttribute.getLongValue(); if (keyTypeAttribute.isPresent() && (keyType != null)) { newObject = ValuedSecretKey.getInstance(session, objectHandle, keyType.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. * @preconditions * @postconditions */ @Override public int hashCode() { return keyType.hashCode() ^ local.hashCode(); }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); keyType = new KeyTypeAttribute(); local = new BooleanAttribute(Attribute.LOCAL); 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 DomainParameters)) { return false; } DomainParameters other = (DomainParameters) otherObject; return super.equals(other) && this.keyType.equals(other.keyType) && this.local.equals(other.local); }
/** * 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 Key Type: ", ((keyType != null) ? keyType.toString() : "<unavailable>"), "\n ID: ", id, "\n Start Date: ", startDate, "\n End Date: ", endDate, "\n Derive: ", derive, "\n Local: ", local, "\n Key Generation Mechanism: ", keyGenMechanism, "\n Allowed Mechanisms: ", allowedMechanisms); }
Util.requireNonNull("session", session); KeyTypeAttribute keyTypeAttribute = new KeyTypeAttribute(); getAttributeValue(session, objectHandle, keyTypeAttribute); Long keyType = keyTypeAttribute.getLongValue(); if (keyTypeAttribute.isPresent() && (keyType != null)) { if (keyType.equals(Key.KeyType.DSA)) { newObject = DSAParams.getInstance(session, objectHandle);
/** * 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. * @preconditions * @postconditions */ @Override public int hashCode() { return keyType.hashCode() ^ id.hashCode(); }
/** * Allocates the attribute objects for this class and adds them to the * attribute table. * * @preconditions * @postconditions */ @Override protected void allocateAttributes() { super.allocateAttributes(); keyType = new KeyTypeAttribute(); id = new ByteArrayAttribute(Attribute.ID); startDate = new DateAttribute(Attribute.START_DATE); endDate = new DateAttribute(Attribute.END_DATE); derive = new BooleanAttribute(Attribute.DERIVE); local = new BooleanAttribute(Attribute.LOCAL); keyGenMechanism = new MechanismAttribute(Attribute.KEY_GEN_MECHANISM); allowedMechanisms = new MechanismArrayAttribute( Attribute.ALLOWED_MECHANISMS); 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 Key)) { return false; } Key other = (Key) otherObject; return super.equals(other) && this.keyType.equals(other.keyType) && this.id.equals(other.id) && this.startDate.equals(other.startDate) && this.endDate.equals(other.endDate) && this.derive.equals(other.derive) && this.local.equals(other.local) && this.keyGenMechanism.equals(other.keyGenMechanism) && this.allowedMechanisms.equals(other.allowedMechanisms); }
Util.requireNonNull("session", session); KeyTypeAttribute keyTypeAttribute = new KeyTypeAttribute(); getAttributeValue(session, objectHandle, keyTypeAttribute); Long keyType = keyTypeAttribute.getLongValue(); if (keyTypeAttribute.isPresent() && (keyType != null)) { if (keyType.equals(Key.KeyType.RSA)) { newObject = RSAPublicKey.getInstance(session, objectHandle);
/** * Default Constructor. * * @preconditions * @postconditions */ public RSAPublicKey() { super(); keyType.setLongValue(KeyType.RSA); }
Util.requireNonNull("session", session); KeyTypeAttribute keyTypeAttribute = new KeyTypeAttribute(); getAttributeValue(session, objectHandle, keyTypeAttribute); Long keyType = keyTypeAttribute.getLongValue(); if (keyTypeAttribute.isPresent() && (keyType != null)) { if (keyType.equals(Key.KeyType.RSA)) { newObject = RSAPrivateKey.getInstance(session, objectHandle);
/** * Default Constructor. * * @preconditions * @postconditions */ public KEAPrivateKey() { keyType.setLongValue(KeyType.KEA); }
/** * Default Constructor. * * @preconditions * @postconditions */ public X942DHPublicKey() { keyType.setLongValue(KeyType.X9_42_DH); }
/** * Default Constructor. * * @preconditions * @postconditions */ public DHPrivateKey() { keyType.setLongValue(KeyType.DH); }
/** * Default Constructor. * * @preconditions * @postconditions */ public DHParams() { keyType.setLongValue(Key.KeyType.DH); }
/** * Default Constructor. * * @preconditions * @postconditions */ public KEAPublicKey() { keyType.setLongValue(KeyType.KEA); }
/** * Default Constructor. * * @preconditions * @postconditions */ public RSAPrivateKey() { super(); keyType.setLongValue(KeyType.RSA); }
/** * Default Constructor. * * @preconditions * @postconditions */ public DSAPrivateKey() { keyType.setLongValue(KeyType.DSA); }