/** * Returns the PKCS#11 attributes of an object. The array * contains CK_ATTRIBUTE objects, one for each set attribute of this object; * e.g. for each attribute that is not null. * The array can be used directly as input for the PKCS#11 wrapper. The * Session class uses this method for various object operations. * * @param object * The iaik.pkcs.pkcs11.object.Object object to get the attributes * from. * @return An array of CK_ATTRIBUTE objects. null, if the given object is * null. * @exception PKCS11Exception * If setting the attribute values. * @preconditions * @postconditions */ public static CK_ATTRIBUTE[] getSetAttributes(PKCS11Object object) throws PKCS11Exception { Vector<CK_ATTRIBUTE> setAttributes = (object != null) ? object.getSetAttributes() : null; CK_ATTRIBUTE[] ckAttributes = (setAttributes != null) ? Util.convertAttributesVectorToArray(setAttributes) : null; return ckAttributes; }