C# Class Net.Pkcs11Interop.LowLevelAPI40.CkaUtils

Utility class that helps to manage CK_ATTRIBUTE structure
显示文件 Open project: Pkcs11Interop/Pkcs11Interop Class Usage Examples

Public Methods

Method Description
ConvertValue ( CK_ATTRIBUTE &attribute, CKM &value ) : void

Reads value of attribute and returns it as mechanism array

ConvertValue ( CK_ATTRIBUTE &attribute, CK_ATTRIBUTE &value ) : void

Reads value of attribute and returns it as attribute array

ConvertValue ( CK_ATTRIBUTE &attribute, System.DateTime &value ) : void

Reads value of attribute and returns it as DateTime (CK_DATE)

ConvertValue ( CK_ATTRIBUTE &attribute, bool &value ) : void

Reads value of attribute and returns it as bool

ConvertValue ( CK_ATTRIBUTE &attribute, byte &value ) : void

Reads value of attribute and returns it as byte array

ConvertValue ( CK_ATTRIBUTE &attribute, string &value ) : void

Reads value of attribute and returns it as string

ConvertValue ( CK_ATTRIBUTE &attribute, uint &value ) : void

Reads value of attribute and returns it as uint

CreateAttribute ( CKA type ) : CK_ATTRIBUTE

Creates attribute of given type with no value

CreateAttribute ( CKA type, CKC value ) : CK_ATTRIBUTE

Creates attribute of given type with CKC value

CreateAttribute ( CKA type, CKK value ) : CK_ATTRIBUTE

Creates attribute of given type with CKK value

CreateAttribute ( CKA type, CKM value ) : CK_ATTRIBUTE

Creates attribute of given type with mechanism array value

CreateAttribute ( CKA type, CKO value ) : CK_ATTRIBUTE

Creates attribute of given type with CKO value

CreateAttribute ( CKA type, CK_ATTRIBUTE value ) : CK_ATTRIBUTE

Creates attribute of given type with attribute array value

CreateAttribute ( CKA type, System.DateTime value ) : CK_ATTRIBUTE

Creates attribute of given type with DateTime (CK_DATE) value

CreateAttribute ( CKA type, bool value ) : CK_ATTRIBUTE

Creates attribute of given type with bool value

CreateAttribute ( CKA type, byte value ) : CK_ATTRIBUTE

Creates attribute of given type with byte array value

CreateAttribute ( CKA type, string value ) : CK_ATTRIBUTE

Creates attribute of given type with string value

CreateAttribute ( CKA type, uint value ) : CK_ATTRIBUTE

Creates attribute of given type with uint value

CreateAttribute ( uint type ) : CK_ATTRIBUTE

Creates attribute of given type with no value

CreateAttribute ( uint type, CKM value ) : CK_ATTRIBUTE

Creates attribute of given type with mechanism array value

CreateAttribute ( uint type, CK_ATTRIBUTE value ) : CK_ATTRIBUTE

Creates attribute of given type with attribute array value

CreateAttribute ( uint type, System.DateTime value ) : CK_ATTRIBUTE

Creates attribute of given type with DateTime (CK_DATE) value

CreateAttribute ( uint type, bool value ) : CK_ATTRIBUTE

Creates attribute of given type with bool value

CreateAttribute ( uint type, byte value ) : CK_ATTRIBUTE

Creates attribute of given type with byte array value

CreateAttribute ( uint type, string value ) : CK_ATTRIBUTE

Creates attribute of given type with string value

CreateAttribute ( uint type, uint value ) : CK_ATTRIBUTE

Creates attribute of given type with uint value

Private Methods

Method Description
ConvertValue ( CK_ATTRIBUTE &attribute ) : byte[]

Copies attribute value from unmanaged memory to managed byte array

_CreateAttribute ( uint type, byte value ) : CK_ATTRIBUTE

Creates attribute of given type with value copied from managed byte array to the newly allocated unmanaged memory

Method Details

ConvertValue() public static method

Reads value of attribute and returns it as mechanism array
public static ConvertValue ( CK_ATTRIBUTE &attribute, CKM &value ) : void
attribute CK_ATTRIBUTE Attribute whose value should be read
value CKM Location that receives attribute value
return void

ConvertValue() public static method

Reads value of attribute and returns it as attribute array
public static ConvertValue ( CK_ATTRIBUTE &attribute, CK_ATTRIBUTE &value ) : void
attribute CK_ATTRIBUTE Attribute whose value should be read
value CK_ATTRIBUTE Location that receives attribute value
return void

ConvertValue() public static method

Reads value of attribute and returns it as DateTime (CK_DATE)
public static ConvertValue ( CK_ATTRIBUTE &attribute, System.DateTime &value ) : void
attribute CK_ATTRIBUTE Attribute whose value should be read
value System.DateTime Location that receives attribute value
return void

ConvertValue() public static method

Reads value of attribute and returns it as bool
public static ConvertValue ( CK_ATTRIBUTE &attribute, bool &value ) : void
attribute CK_ATTRIBUTE Attribute whose value should be read
value bool Location that receives attribute value
return void

ConvertValue() public static method

Reads value of attribute and returns it as byte array
public static ConvertValue ( CK_ATTRIBUTE &attribute, byte &value ) : void
attribute CK_ATTRIBUTE Attribute whose value should be read
value byte Location that receives attribute value
return void

ConvertValue() public static method

Reads value of attribute and returns it as string
public static ConvertValue ( CK_ATTRIBUTE &attribute, string &value ) : void
attribute CK_ATTRIBUTE Attribute whose value should be read
value string Location that receives attribute value
return void

ConvertValue() public static method

Reads value of attribute and returns it as uint
public static ConvertValue ( CK_ATTRIBUTE &attribute, uint &value ) : void
attribute CK_ATTRIBUTE Attribute whose value should be read
value uint Location that receives attribute value
return void

CreateAttribute() public static method

Creates attribute of given type with no value
public static CreateAttribute ( CKA type ) : CK_ATTRIBUTE
type CKA Attribute type
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with CKC value
public static CreateAttribute ( CKA type, CKC value ) : CK_ATTRIBUTE
type CKA Attribute type
value CKC Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with CKK value
public static CreateAttribute ( CKA type, CKK value ) : CK_ATTRIBUTE
type CKA Attribute type
value CKK Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with mechanism array value
public static CreateAttribute ( CKA type, CKM value ) : CK_ATTRIBUTE
type CKA Attribute type
value CKM Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with CKO value
public static CreateAttribute ( CKA type, CKO value ) : CK_ATTRIBUTE
type CKA Attribute type
value CKO Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with attribute array value
public static CreateAttribute ( CKA type, CK_ATTRIBUTE value ) : CK_ATTRIBUTE
type CKA Attribute type
value CK_ATTRIBUTE Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with DateTime (CK_DATE) value
public static CreateAttribute ( CKA type, System.DateTime value ) : CK_ATTRIBUTE
type CKA Attribute type
value System.DateTime Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with bool value
public static CreateAttribute ( CKA type, bool value ) : CK_ATTRIBUTE
type CKA Attribute type
value bool Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with byte array value
public static CreateAttribute ( CKA type, byte value ) : CK_ATTRIBUTE
type CKA Attribute type
value byte Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with string value
public static CreateAttribute ( CKA type, string value ) : CK_ATTRIBUTE
type CKA Attribute type
value string Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with uint value
public static CreateAttribute ( CKA type, uint value ) : CK_ATTRIBUTE
type CKA Attribute type
value uint Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with no value
public static CreateAttribute ( uint type ) : CK_ATTRIBUTE
type uint Attribute type
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with mechanism array value
public static CreateAttribute ( uint type, CKM value ) : CK_ATTRIBUTE
type uint Attribute type
value CKM Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with attribute array value
public static CreateAttribute ( uint type, CK_ATTRIBUTE value ) : CK_ATTRIBUTE
type uint Attribute type
value CK_ATTRIBUTE Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with DateTime (CK_DATE) value
public static CreateAttribute ( uint type, System.DateTime value ) : CK_ATTRIBUTE
type uint Attribute type
value System.DateTime Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with bool value
public static CreateAttribute ( uint type, bool value ) : CK_ATTRIBUTE
type uint Attribute type
value bool Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with byte array value
public static CreateAttribute ( uint type, byte value ) : CK_ATTRIBUTE
type uint Attribute type
value byte Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with string value
public static CreateAttribute ( uint type, string value ) : CK_ATTRIBUTE
type uint Attribute type
value string Attribute value
return CK_ATTRIBUTE

CreateAttribute() public static method

Creates attribute of given type with uint value
public static CreateAttribute ( uint type, uint value ) : CK_ATTRIBUTE
type uint Attribute type
value uint Attribute value
return CK_ATTRIBUTE