public static void GetObjectAttributes(Pkcs11Uri pkcs11Uri, out CK_ATTRIBUTE[] objectAttributes)
{
if (pkcs11Uri == null)
throw new ArgumentNullException("pkcs11Uri");
List<CK_ATTRIBUTE> attributes = null;
if (pkcs11Uri.DefinesObject)
{
attributes = new List<CK_ATTRIBUTE>();
if (pkcs11Uri.Type != null)
attributes.Add(CkaUtils.CreateAttribute(CKA.CKA_CLASS, pkcs11Uri.Type.Value));
if (pkcs11Uri.Object != null)
attributes.Add(CkaUtils.CreateAttribute(CKA.CKA_LABEL, pkcs11Uri.Object));
if (pkcs11Uri.Id != null)
attributes.Add(CkaUtils.CreateAttribute(CKA.CKA_ID, pkcs11Uri.Id));
}
objectAttributes = attributes.ToArray();
}
}