public void SetAttributeValue(ObjectHandle objectHandle, List<ObjectAttribute> attributes)
{
if (this._disposed)
throw new ObjectDisposedException(this.GetType().FullName);
if (objectHandle == null)
throw new ArgumentNullException("objectHandle");
if (attributes == null)
throw new ArgumentNullException("attributes");
if (attributes.Count < 1)
throw new ArgumentException("No attributes specified", "attributes");
CK_ATTRIBUTE[] template = new CK_ATTRIBUTE[attributes.Count];
for (int i = 0; i < attributes.Count; i++)
template[i] = attributes[i].CkAttribute;
CKR rv = _p11.C_SetAttributeValue(_sessionId, objectHandle.ObjectId, template, Convert.ToUInt64(template.Length));
if (rv != CKR.CKR_OK)
throw new Pkcs11Exception("C_SetAttributeValue", rv);
}