本文整理汇总了C#中ObjectHandle类的典型用法代码示例。如果您正苦于以下问题:C# ObjectHandle类的具体用法?C# ObjectHandle怎么用?C# ObjectHandle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ObjectHandle类属于命名空间,在下文中一共展示了ObjectHandle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EntityEquipmentSensorCBRNAP2Ce
public EntityEquipmentSensorCBRNAP2Ce(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = transactionHandle;
}
示例2: EntityEquipment
public EntityEquipment(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = TransactionHandle.None;
}
示例3: CkKipParams
/// <summary>
/// Initializes a new instance of the CkKipParams class.
/// </summary>
/// <param name='mechanism'>Underlying cryptographic mechanism (CKM)</param>
/// <param name='key'>Handle to a key that will contribute to the entropy of the derived key (CKM_KIP_DERIVE) or will be used in the MAC operation (CKM_KIP_MAC)</param>
/// <param name='seed'>Input seed</param>
public CkKipParams(ulong? mechanism, ObjectHandle key, byte[] seed)
{
_lowLevelStruct.Mechanism = IntPtr.Zero;
_lowLevelStruct.Key = 0;
_lowLevelStruct.Seed = IntPtr.Zero;
_lowLevelStruct.SeedLen = 0;
if (mechanism != null)
{
byte[] bytes = ConvertUtils.ULongToBytes(mechanism.Value);
_lowLevelStruct.Mechanism = UnmanagedMemory.Allocate(bytes.Length);
UnmanagedMemory.Write(_lowLevelStruct.Mechanism, bytes);
}
if (key == null)
throw new ArgumentNullException("key");
_lowLevelStruct.Key = key.ObjectId;
if (seed != null)
{
_lowLevelStruct.Seed = UnmanagedMemory.Allocate(seed.Length);
UnmanagedMemory.Write(_lowLevelStruct.Seed, seed);
_lowLevelStruct.SeedLen = Convert.ToUInt64(seed.Length);
}
}
示例4: WISEObject
public WISEObject(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = transactionHandle;
}
示例5: EntityGroundVehicle
public EntityGroundVehicle(INETWISEDriverSink2 WISE, DatabaseHandle databaseHandle, ObjectHandle objectHandle, TransactionHandle transactionHandle)
{
this.WISE = WISE;
this.Database = databaseHandle;
this.Object = objectHandle;
this.Transaction = transactionHandle;
}
示例6: CkCmsSigParams
/// <summary>
/// Initializes a new instance of the CkCmsSigParams class.
/// </summary>
/// <param name='certificateHandle'>Object handle for a certificate associated with the signing key</param>
/// <param name='signingMechanism'>Mechanism to use when signing a constructed CMS SignedAttributes value</param>
/// <param name='digestMechanism'>Mechanism to use when digesting the data</param>
/// <param name='contentType'>String indicating complete MIME Content-type of message to be signed or null if the message is a MIME object</param>
/// <param name='requestedAttributes'>DER-encoded list of CMS Attributes the caller requests to be included in the signed attributes</param>
/// <param name='requiredAttributes'>DER-encoded list of CMS Attributes (with accompanying values) required to be included in the resulting signed attributes</param>
public CkCmsSigParams(ObjectHandle certificateHandle, ulong? signingMechanism, ulong? digestMechanism, string contentType, byte[] requestedAttributes, byte[] requiredAttributes)
{
_lowLevelStruct.CertificateHandle = CK.CK_INVALID_HANDLE;
_lowLevelStruct.SigningMechanism = IntPtr.Zero;
_lowLevelStruct.DigestMechanism = IntPtr.Zero;
_lowLevelStruct.ContentType = IntPtr.Zero;
_lowLevelStruct.RequestedAttributes = IntPtr.Zero;
_lowLevelStruct.RequestedAttributesLen = 0;
_lowLevelStruct.RequiredAttributes = IntPtr.Zero;
_lowLevelStruct.RequiredAttributesLen = 0;
if (certificateHandle == null)
throw new ArgumentNullException("certificateHandle");
_lowLevelStruct.CertificateHandle = certificateHandle.ObjectId;
if (signingMechanism != null)
{
byte[] bytes = ConvertUtils.ULongToBytes(signingMechanism.Value);
_lowLevelStruct.SigningMechanism = UnmanagedMemory.Allocate(bytes.Length);
UnmanagedMemory.Write(_lowLevelStruct.SigningMechanism, bytes);
}
if (digestMechanism != null)
{
byte[] bytes = ConvertUtils.ULongToBytes(digestMechanism.Value);
_lowLevelStruct.DigestMechanism = UnmanagedMemory.Allocate(bytes.Length);
UnmanagedMemory.Write(_lowLevelStruct.DigestMechanism, bytes);
}
if (contentType != null)
{
byte[] bytes = ConvertUtils.Utf8StringToBytes(contentType);
Array.Resize(ref bytes, bytes.Length + 1);
bytes[bytes.Length - 1] = 0;
_lowLevelStruct.ContentType = UnmanagedMemory.Allocate(bytes.Length);
UnmanagedMemory.Write(_lowLevelStruct.ContentType, bytes);
}
if (requestedAttributes != null)
{
_lowLevelStruct.RequestedAttributes = UnmanagedMemory.Allocate(requestedAttributes.Length);
UnmanagedMemory.Write(_lowLevelStruct.RequestedAttributes, requestedAttributes);
_lowLevelStruct.RequestedAttributesLen = Convert.ToUInt64(requestedAttributes.Length);
}
if (requiredAttributes != null)
{
_lowLevelStruct.RequiredAttributes = UnmanagedMemory.Allocate(requiredAttributes.Length);
UnmanagedMemory.Write(_lowLevelStruct.RequiredAttributes, requiredAttributes);
_lowLevelStruct.RequiredAttributesLen = Convert.ToUInt64(requiredAttributes.Length);
}
}
示例7: CreateObject
public WISEObject CreateObject(SensorTypes sensorType, ObjectHandle hObject)
{
switch (sensorType)
{
case SensorTypes.lcd: return new EntityEquipmentSensorCBRNLCD(_sink, _hDatabase, hObject);
case SensorTypes.ap2ce: return new EntityEquipmentSensorCBRNAP2Ce(_sink, _hDatabase, hObject);
case SensorTypes.raid: return new EntityEquipmentSensorCBRNRAID(_sink, _hDatabase, hObject);
case SensorTypes.i28: return new EntityEquipmentSensorCBRNI28(_sink, _hDatabase, hObject);
case SensorTypes.i27: return new EntityEquipmentSensorCBRNI27(_sink, _hDatabase, hObject);
}
throw new NotImplementedException();
}
示例8: CkX942MqvDeriveParams
/// <summary>
/// Initializes a new instance of the CkX942MqvDeriveParams class.
/// </summary>>
/// <param name='kdf'>Key derivation function used on the shared secret value (CKD)</param>
/// <param name='otherInfo'>Some data shared between the two parties</param>
/// <param name='publicData'>Other party's first X9.42 Diffie-Hellman public key value</param>
/// <param name='privateDataLen'>The length in bytes of the second X9.42 Diffie-Hellman private key</param>
/// <param name='privateData'>Key handle for second X9.42 Diffie-Hellman private key value</param>
/// <param name='publicData2'>Other party's second X9.42 Diffie-Hellman public key value</param>
/// <param name='publicKey'>Handle to the first party's ephemeral public key</param>
public CkX942MqvDeriveParams(ulong kdf, byte[] otherInfo, byte[] publicData, ulong privateDataLen, ObjectHandle privateData, byte[] publicData2, ObjectHandle publicKey)
{
_lowLevelStruct.Kdf = 0;
_lowLevelStruct.OtherInfoLen = 0;
_lowLevelStruct.OtherInfo = IntPtr.Zero;
_lowLevelStruct.PublicDataLen = 0;
_lowLevelStruct.PublicData = IntPtr.Zero;
_lowLevelStruct.PrivateDataLen = 0;
_lowLevelStruct.PrivateData = 0;
_lowLevelStruct.PublicDataLen2 = 0;
_lowLevelStruct.PublicData2 = IntPtr.Zero;
_lowLevelStruct.PublicKey = 0;
_lowLevelStruct.Kdf = kdf;
if (otherInfo != null)
{
_lowLevelStruct.OtherInfo = UnmanagedMemory.Allocate(otherInfo.Length);
UnmanagedMemory.Write(_lowLevelStruct.OtherInfo, otherInfo);
_lowLevelStruct.OtherInfoLen = Convert.ToUInt64(otherInfo.Length);
}
if (publicData != null)
{
_lowLevelStruct.PublicData = UnmanagedMemory.Allocate(publicData.Length);
UnmanagedMemory.Write(_lowLevelStruct.PublicData, publicData);
_lowLevelStruct.PublicDataLen = Convert.ToUInt64(publicData.Length);
}
_lowLevelStruct.PrivateDataLen = privateDataLen;
if (privateData == null)
throw new ArgumentNullException("privateData");
_lowLevelStruct.PrivateData = privateData.ObjectId;
if (publicData2 != null)
{
_lowLevelStruct.PublicData2 = UnmanagedMemory.Allocate(publicData2.Length);
UnmanagedMemory.Write(_lowLevelStruct.PublicData2, publicData2);
_lowLevelStruct.PublicDataLen2 = Convert.ToUInt64(publicData2.Length);
}
if (publicKey == null)
throw new ArgumentNullException("publicKey");
_lowLevelStruct.PublicKey = publicKey.ObjectId;
}
示例9: CkEcmqvDeriveParams
/// <summary>
/// Initializes a new instance of the CkEcmqvDeriveParams class.
/// </summary>>
/// <param name='kdf'>Key derivation function used on the shared secret value (CKD)</param>
/// <param name='sharedData'>Some data shared between the two parties</param>
/// <param name='publicData'>Other party's first EC public key value</param>
/// <param name='privateDataLen'>The length in bytes of the second EC private key</param>
/// <param name='privateData'>Key handle for second EC private key value</param>
/// <param name='publicData2'>Other party's second EC public key value</param>
/// <param name='publicKey'>Handle to the first party's ephemeral public key</param>
public CkEcmqvDeriveParams(uint kdf, byte[] sharedData, byte[] publicData, uint privateDataLen, ObjectHandle privateData, byte[] publicData2, ObjectHandle publicKey)
{
_lowLevelStruct.Kdf = 0;
_lowLevelStruct.SharedDataLen = 0;
_lowLevelStruct.SharedData = IntPtr.Zero;
_lowLevelStruct.PublicDataLen = 0;
_lowLevelStruct.PublicData = IntPtr.Zero;
_lowLevelStruct.PrivateDataLen = 0;
_lowLevelStruct.PrivateData = 0;
_lowLevelStruct.PublicDataLen2 = 0;
_lowLevelStruct.PublicData2 = IntPtr.Zero;
_lowLevelStruct.PublicKey = 0;
_lowLevelStruct.Kdf = kdf;
if (sharedData != null)
{
_lowLevelStruct.SharedData = UnmanagedMemory.Allocate(sharedData.Length);
UnmanagedMemory.Write(_lowLevelStruct.SharedData, sharedData);
_lowLevelStruct.SharedDataLen = Convert.ToUInt32(sharedData.Length);
}
if (publicData != null)
{
_lowLevelStruct.PublicData = UnmanagedMemory.Allocate(publicData.Length);
UnmanagedMemory.Write(_lowLevelStruct.PublicData, publicData);
_lowLevelStruct.PublicDataLen = Convert.ToUInt32(publicData.Length);
}
_lowLevelStruct.PrivateDataLen = privateDataLen;
if (privateData == null)
throw new ArgumentNullException("privateData");
_lowLevelStruct.PrivateData = privateData.ObjectId;
if (publicData2 != null)
{
_lowLevelStruct.PublicData2 = UnmanagedMemory.Allocate(publicData2.Length);
UnmanagedMemory.Write(_lowLevelStruct.PublicData2, publicData2);
_lowLevelStruct.PublicDataLen2 = Convert.ToUInt32(publicData2.Length);
}
if (publicKey == null)
throw new ArgumentNullException("publicKey");
_lowLevelStruct.PublicKey = publicKey.ObjectId;
}
示例10: CkX942Dh2DeriveParams
/// <summary>
/// Initializes a new instance of the CkX942Dh2DeriveParams class.
/// </summary>
/// <param name='kdf'>Key derivation function used on the shared secret value (CKD)</param>
/// <param name='otherInfo'>Some data shared between the two parties</param>
/// <param name='publicData'>Other party's first X9.42 Diffie-Hellman public key value</param>
/// <param name='privateDataLen'>The length in bytes of the second X9.42 Diffie-Hellman private key</param>
/// <param name='privateData'>Key handle for second X9.42 Diffie-Hellman private key value</param>
/// <param name='publicData2'>Other party's second X9.42 Diffie-Hellman public key value</param>
public CkX942Dh2DeriveParams(ulong kdf, byte[] otherInfo, byte[] publicData, ulong privateDataLen, ObjectHandle privateData, byte[] publicData2)
{
if (Platform.UnmanagedLongSize == 4)
{
if (Platform.StructPackingSize == 0)
_params40 = new HighLevelAPI40.MechanismParams.CkX942Dh2DeriveParams(Convert.ToUInt32(kdf), otherInfo, publicData, Convert.ToUInt32(privateDataLen), privateData.ObjectHandle40, publicData2);
else
_params41 = new HighLevelAPI41.MechanismParams.CkX942Dh2DeriveParams(Convert.ToUInt32(kdf), otherInfo, publicData, Convert.ToUInt32(privateDataLen), privateData.ObjectHandle41, publicData2);
}
else
{
if (Platform.StructPackingSize == 0)
_params80 = new HighLevelAPI80.MechanismParams.CkX942Dh2DeriveParams(kdf, otherInfo, publicData, privateDataLen, privateData.ObjectHandle80, publicData2);
else
_params81 = new HighLevelAPI81.MechanismParams.CkX942Dh2DeriveParams(kdf, otherInfo, publicData, privateDataLen, privateData.ObjectHandle81, publicData2);
}
}
示例11: CkEcmqvDeriveParams
/// <summary>
/// Initializes a new instance of the CkEcmqvDeriveParams class.
/// </summary>>
/// <param name='kdf'>Key derivation function used on the shared secret value (CKD)</param>
/// <param name='sharedData'>Some data shared between the two parties</param>
/// <param name='publicData'>Other party's first EC public key value</param>
/// <param name='privateDataLen'>The length in bytes of the second EC private key</param>
/// <param name='privateData'>Key handle for second EC private key value</param>
/// <param name='publicData2'>Other party's second EC public key value</param>
/// <param name='publicKey'>Handle to the first party's ephemeral public key</param>
public CkEcmqvDeriveParams(ulong kdf, byte[] sharedData, byte[] publicData, ulong privateDataLen, ObjectHandle privateData, byte[] publicData2, ObjectHandle publicKey)
{
if (Platform.UnmanagedLongSize == 4)
{
if (Platform.StructPackingSize == 0)
_params40 = new HighLevelAPI40.MechanismParams.CkEcmqvDeriveParams(Convert.ToUInt32(kdf), sharedData, publicData, Convert.ToUInt32(privateDataLen), privateData.ObjectHandle40, publicData2, publicKey.ObjectHandle40);
else
_params41 = new HighLevelAPI41.MechanismParams.CkEcmqvDeriveParams(Convert.ToUInt32(kdf), sharedData, publicData, Convert.ToUInt32(privateDataLen), privateData.ObjectHandle41, publicData2, publicKey.ObjectHandle41);
}
else
{
if (Platform.StructPackingSize == 0)
_params80 = new HighLevelAPI80.MechanismParams.CkEcmqvDeriveParams(kdf, sharedData, publicData, privateDataLen, privateData.ObjectHandle80, publicData2, publicKey.ObjectHandle80);
else
_params81 = new HighLevelAPI81.MechanismParams.CkEcmqvDeriveParams(kdf, sharedData, publicData, privateDataLen, privateData.ObjectHandle81, publicData2, publicKey.ObjectHandle81);
}
}
示例12: CkKipParams
/// <summary>
/// Initializes a new instance of the CkKipParams class.
/// </summary>
/// <param name='mechanism'>Underlying cryptographic mechanism (CKM)</param>
/// <param name='key'>Handle to a key that will contribute to the entropy of the derived key (CKM_KIP_DERIVE) or will be used in the MAC operation (CKM_KIP_MAC)</param>
/// <param name='seed'>Input seed</param>
public CkKipParams(ulong? mechanism, ObjectHandle key, byte[] seed)
{
if (Platform.UnmanagedLongSize == 4)
{
uint? uintMechanism = (mechanism == null) ? null : (uint?)Convert.ToUInt32(mechanism.Value);
if (Platform.StructPackingSize == 0)
_params40 = new HighLevelAPI40.MechanismParams.CkKipParams(uintMechanism, key.ObjectHandle40, seed);
else
_params41 = new HighLevelAPI41.MechanismParams.CkKipParams(uintMechanism, key.ObjectHandle41, seed);
}
else
{
if (Platform.StructPackingSize == 0)
_params80 = new HighLevelAPI80.MechanismParams.CkKipParams(mechanism, key.ObjectHandle80, seed);
else
_params81 = new HighLevelAPI81.MechanismParams.CkKipParams(mechanism, key.ObjectHandle81, seed);
}
}
示例13: CkCmsSigParams
/// <summary>
/// Initializes a new instance of the CkCmsSigParams class.
/// </summary>
/// <param name='certificateHandle'>Object handle for a certificate associated with the signing key</param>
/// <param name='signingMechanism'>Mechanism to use when signing a constructed CMS SignedAttributes value</param>
/// <param name='digestMechanism'>Mechanism to use when digesting the data</param>
/// <param name='contentType'>String indicating complete MIME Content-type of message to be signed or null if the message is a MIME object</param>
/// <param name='requestedAttributes'>DER-encoded list of CMS Attributes the caller requests to be included in the signed attributes</param>
/// <param name='requiredAttributes'>DER-encoded list of CMS Attributes (with accompanying values) required to be included in the resulting signed attributes</param>
public CkCmsSigParams(ObjectHandle certificateHandle, ulong? signingMechanism, ulong? digestMechanism, string contentType, byte[] requestedAttributes, byte[] requiredAttributes)
{
if (Platform.UnmanagedLongSize == 4)
{
uint? uintSigningMechanism = (signingMechanism == null) ? null : (uint?)Convert.ToUInt32(signingMechanism.Value);
uint? uintDigestMechanism = (digestMechanism == null) ? null : (uint?)Convert.ToUInt32(digestMechanism.Value);
if (Platform.StructPackingSize == 0)
_params40 = new HighLevelAPI40.MechanismParams.CkCmsSigParams(certificateHandle.ObjectHandle40, uintSigningMechanism, uintDigestMechanism, contentType, requestedAttributes, requiredAttributes);
else
_params41 = new HighLevelAPI41.MechanismParams.CkCmsSigParams(certificateHandle.ObjectHandle41, uintSigningMechanism, uintDigestMechanism, contentType, requestedAttributes, requiredAttributes);
}
else
{
if (Platform.StructPackingSize == 0)
_params80 = new HighLevelAPI80.MechanismParams.CkCmsSigParams(certificateHandle.ObjectHandle80, signingMechanism, digestMechanism, contentType, requestedAttributes, requiredAttributes);
else
_params81 = new HighLevelAPI81.MechanismParams.CkCmsSigParams(certificateHandle.ObjectHandle81, signingMechanism, digestMechanism, contentType, requestedAttributes, requiredAttributes);
}
}
示例14: add
public static extern void add(ListHandle listHandle, ObjectHandle objectHandle, out NativeException ex);
示例15: move
public static extern IntPtr move(ListHandle listHandle, ObjectHandle objectHandle, IntPtr targetIndex, out NativeException ex);