Example #1
0
 /// <summary>
 /// Converts low level CK_SESSION_INFO structure to high level SessionInfo class
 /// </summary>
 /// <param name="sessionId">PKCS#11 handle of session</param>
 /// <param name="ck_session_info">Low level CK_SESSION_INFO structure</param>
 protected internal SessionInfo(NativeULong sessionId, CK_SESSION_INFO ck_session_info)
 {
     _sessionId    = sessionId;
     _slotId       = ck_session_info.SlotId;
     _state        = (CKS)ck_session_info.State;
     _sessionFlags = new SessionFlags(ck_session_info.Flags);
     _deviceError  = ck_session_info.DeviceError;
 }
 /// <summary>
 /// Converts low level CK_SESSION_INFO structure to high level SessionInfo class
 /// </summary>
 /// <param name="sessionId">PKCS#11 handle of session</param>
 /// <param name="ck_session_info">Low level CK_SESSION_INFO structure</param>
 internal SessionInfo(uint sessionId, LowLevelAPI.CK_SESSION_INFO ck_session_info)
 {
     _sessionId    = sessionId;
     _slotId       = ck_session_info.SlotId;
     _state        = (CKS)ck_session_info.State;
     _sessionFlags = new SessionFlags(ck_session_info.Flags);
     _deviceError  = ck_session_info.DeviceError;
 }
 /// <summary>
 /// Converts low level CK_SESSION_INFO structure to high level SessionInfo class
 /// </summary>
 /// <param name="sessionId">PKCS#11 handle of session</param>
 /// <param name="ck_session_info">Low level CK_SESSION_INFO structure</param>
 internal SessionInfo(ulong sessionId, CK_SESSION_INFO ck_session_info)
 {
     _sessionId = sessionId;
     _slotId = ck_session_info.SlotId;
     _state = (CKS)ck_session_info.State;
     _sessionFlags = new SessionFlags(ck_session_info.Flags);
     _deviceError = ck_session_info.DeviceError;
 }
Example #4
0
 /// <summary>
 /// Converts CKS to UInt64
 /// </summary>
 /// <param name="value">CKS that should be converted</param>
 /// <returns>UInt64 with value from CKS</returns>
 public static UInt64 UInt64FromCKS(CKS value)
 {
     return(Convert.ToUInt64(value));
 }
Example #5
0
 /// <summary>
 /// Converts CKS to UInt32
 /// </summary>
 /// <param name="value">CKS that should be converted</param>
 /// <returns>UInt32 with value from CKS</returns>
 public static UInt32 UInt32FromCKS(CKS value)
 {
     return(Convert.ToUInt32(value));
 }