/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> public ObjectAttribute(CKA type, CKC value) { if (Platform.UnmanagedLongSize == 4) { if (Platform.StructPackingSize == 0) { _objectAttribute40 = new HighLevelAPI40.ObjectAttribute(type, value); } else { _objectAttribute41 = new HighLevelAPI41.ObjectAttribute(type, value); } } else { if (Platform.StructPackingSize == 0) { _objectAttribute80 = new HighLevelAPI80.ObjectAttribute(type, value); } else { _objectAttribute81 = new HighLevelAPI81.ObjectAttribute(type, value); } } }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of cryptoki object</returns> public IObjectAttribute CreateObjectAttribute(CKA type, CKC value) { return(new ObjectAttribute(type, value)); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> public ObjectAttribute(CKA type, CKC value) { _ckAttribute = CkaUtils.CreateAttribute(type, value); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> public ObjectAttribute(CKA type, CKC value) { if (Platform.UnmanagedLongSize == 4) { if (Platform.StructPackingSize == 0) _objectAttribute40 = new HighLevelAPI40.ObjectAttribute(type, value); else _objectAttribute41 = new HighLevelAPI41.ObjectAttribute(type, value); } else { if (Platform.StructPackingSize == 0) _objectAttribute80 = new HighLevelAPI80.ObjectAttribute(type, value); else _objectAttribute81 = new HighLevelAPI81.ObjectAttribute(type, value); } }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of given type with CKC value</returns> public static CK_ATTRIBUTE CreateAttribute(CKA type, CKC value) { return(CreateAttribute(Convert.ToUInt64((uint)type), Convert.ToUInt64((uint)value))); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of cryptoki object</returns> public IObjectAttribute Create(CKA type, CKC value) { return(_factory.Create(type, value)); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of given type with CKC value</returns> public static CK_ATTRIBUTE CreateAttribute(CKA type, CKC value) { return(CreateAttribute(ConvertUtils.UInt32FromCKA(type), ConvertUtils.UInt32FromCKC(value))); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of given type with CKC value</returns> public static CK_ATTRIBUTE CreateAttribute(CKA type, CKC value) { return(CreateAttribute(NativeLongUtils.ConvertFromCKA(type), NativeLongUtils.ConvertFromCKC(value))); }
/// <summary> /// Converts CKC to NativeULong /// </summary> /// <param name="value">CKC that should be converted</param> /// <returns>NativeULong with value from CKC</returns> public static NativeULong ConvertFromCKC(CKC value) { return(Convert.ToUInt32(value)); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of given type with CKC value</returns> public static CK_ATTRIBUTE CreateAttribute(CKA type, CKC value) { return CreateAttribute((uint)type, (uint)value); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of given type with CKC value</returns> public static CK_ATTRIBUTE CreateAttribute(CKA type, CKC value) { return CreateAttribute(Convert.ToUInt64((uint)type), Convert.ToUInt64((uint)value)); }
/// <summary> /// Creates attribute of given type with CKC value /// </summary> /// <param name="type">Attribute type</param> /// <param name="value">Attribute value</param> /// <returns>Attribute of given type with CKC value</returns> public static CK_ATTRIBUTE CreateAttribute(CKA type, CKC value) { return(CreateAttribute((uint)type, (uint)value)); }
/// <summary> /// Converts CKC to UInt64 /// </summary> /// <param name="value">CKC that should be converted</param> /// <returns>UInt64 with value from CKC</returns> public static UInt64 UInt64FromCKC(CKC value) { return(Convert.ToUInt64(value)); }
/// <summary> /// Converts CKC to UInt32 /// </summary> /// <param name="value">CKC that should be converted</param> /// <returns>UInt32 with value from CKC</returns> public static UInt32 UInt32FromCKC(CKC value) { return(Convert.ToUInt32(value)); }