newObject = new DomainParameters(session, objectHandle); newObject = new DomainParameters(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.getAttributeValues(session, objectHandle, new Attribute[] { prime, base, primeBits }); }
/** * 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)); }
getAttributeValue(session, objectHandle, keyTypeAttribute); } else if ((keyType.longValue() & Key.KeyType.VENDOR_DEFINED.longValue()) != 0L) { newObject = getUnknownDomainParameters(session, objectHandle); } else { newObject = getUnknownDomainParameters(session, objectHandle); newObject = getUnknownDomainParameters(session, objectHandle);
/** * 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); primeBits = new LongAttribute(Attribute.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); }
/** * 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); }
newObject = Data.getInstance(session, objectHandle); } else if (objectClass.equals(ObjectClass.DOMAIN_PARAMETERS)) { newObject = DomainParameters.getInstance(session, objectHandle); } else if (objectClass.equals(ObjectClass.MECHANISM)) { newObject = Mechanism.getInstance(session, objectHandle);
/** * 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); subprime = new ByteArrayAttribute(Attribute.SUBPRIME); base = new ByteArrayAttribute(Attribute.BASE); primeBits = new LongAttribute(Attribute.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 DSAParams)) { return false; } DSAParams other = (DSAParams) otherObject; return super.equals(other) && this.prime.equals(other.prime) && this.subprime.equals(other.subprime) && this.base.equals(other.base) && this.primeBits.equals(other.primeBits); }
/** * 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 Subprime (hex): ", subprime, "\n Base (hex): ", base, "\n Prime Bits (dec): ", primeBits.toString(10)); }
/** * 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[] { prime, subprime, base, primeBits}); }