nl::Weave::WeaveSecurityManager

Tóm tắt

Hàm khởi tạo và hàm phá

WeaveSecurityManager(void)

Loại công khai

KeyErrorMsgRcvdFunct)(uint16_t keyId, uint8_t encType, uint32_t messageId, uint64_t peerNodeId, WEAVE_ERROR keyErr) typedef
void(*
Loại hàm xử lý thông báo lỗi chính.
KeyExportCompleteFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, uint32_t exportedKeyId, const uint8_t *exportedKey, uint16_t exportedKeyLen) typedef
void(*
Loại hàm xử lý hoàn chỉnh giao thức xuất khoá.
KeyExportErrorFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, WEAVE_ERROR localErr, StatusReport *statusReport) typedef
void(*
Loại hàm xử lý lỗi của giao thức xuất khoá.
SessionErrorFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, WEAVE_ERROR localErr, uint64_t peerNodeId, StatusReport *statusReport) typedef
void(*
SessionEstablishedFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, uint16_t sessionKeyId, uint64_t peerNodeId, uint8_t encType) typedef
void(*
State enum

Thuộc tính công khai

CASEUseKnownECDHKey
bool
ExchangeManager
FabricState
IdleSessionTimeout
uint32_t
InitiatorAllowedCASEConfigs
uint8_t
InitiatorAllowedCASECurves
uint8_t
InitiatorAllowedKeyExportConfigs
uint8_t
InitiatorCASEConfig
uint32_t
InitiatorCASECurveId
uint32_t
InitiatorKeyExportConfig
uint8_t
OnKeyErrorMsgRcvd
Hàm callback key error.
OnSessionError
SessionErrorFunct
OnSessionEstablished
SessionEstablishedFunct
ResponderAllowedCASEConfigs
uint8_t
ResponderAllowedCASECurves
uint8_t
ResponderAllowedKeyExportConfigs
uint8_t
SessionEstablishTimeout
uint32_t
State
uint8_t
mCASEEngine
mKeyExport
mPASEEngine
mStartKeyExport_OnComplete
Giao thức xuất khoá hoàn tất hàm gọi lại.
mStartKeyExport_OnError
Hàm gọi lại lỗi của giao thức xuất khoá.
mStartKeyExport_ReqState
void *
mStartSecureSession_OnComplete
SessionEstablishedFunct
mStartSecureSession_OnError
SessionErrorFunct
mStartSecureSession_ReqState
void *
mTAKEEngine

Hàm công khai

CancelSessionEstablishment(void *reqState)
Huỷ quá trình thiết lập phiên đang tiến hành.
Init(WeaveExchangeManager & aExchangeMgr, System::Layer & aSystemLayer)
IsKeyError(WEAVE_ERROR err)
bool
Kiểm tra xem mã lỗi Weave được chỉ định có phải là một trong các mã lỗi chính không.
OnEncryptedMsgRcvd(uint16_t sessionKeyId, uint64_t peerNodeId, uint8_t encType)
void
ReleaseKey(uint64_t peerNodeId, uint16_t keyId)
void
Huỷ yêu cầu đặt trước khoá mã hoá cho tin nhắn.
ReserveKey(uint64_t peerNodeId, uint16_t keyId)
void
Đặt trước một khoá mã hoá thư.
SendKeyErrorMsg(WeaveMessageInfo *rcvdMsgInfo, const IPPacketInfo *rcvdMsgPacketInfo, WeaveConnection *con, WEAVE_ERROR keyErr)
Gửi thông báo lỗi quan trọng.
SetCASEAuthDelegate(WeaveCASEAuthDelegate *delegate)
void
SetKeyExportDelegate(WeaveKeyExportDelegate *delegate)
void
SetTAKEAuthDelegate(WeaveTAKEChallengerAuthDelegate *delegate)
void
SetTAKETokenAuthDelegate(WeaveTAKETokenAuthDelegate *delegate)
void
Shutdown(void)
StartCASESession(WeaveConnection *con, uint64_t peerNodeId, const IPAddress & peerAddr, uint16_t peerPort, WeaveAuthMode requestedAuthMode, void *reqState, SessionEstablishedFunct onComplete, SessionErrorFunct onError, WeaveCASEAuthDelegate *authDelegate, uint64_t terminatingNodeId)
Phương thức này được gọi để thiết lập phiên CASE mới hoặc tìm phiên CASE hiện có.
StartKeyExport(WeaveConnection *con, uint64_t peerNodeId, const IPAddress & peerAddr, uint16_t peerPort, uint32_t keyId, bool signMessage, void *reqState, KeyExportCompleteFunct onComplete, KeyExportErrorFunct onError, WeaveKeyExportDelegate *keyExportDelegate)
StartPASESession(WeaveConnection *con, WeaveAuthMode requestedAuthMode, void *reqState, SessionEstablishedFunct onComplete, SessionErrorFunct onError, const uint8_t *pw, uint16_t pwLen)
Phương thức này được gọi để thiết lập phiên PASE an toàn.
StartTAKESession(WeaveConnection *con, WeaveAuthMode requestedAuthMode, void *reqState, SessionEstablishedFunct onComplete, SessionErrorFunct onError, bool encryptAuthPhase, bool encryptCommPhase, bool timeLimitedIK, bool sendChallengerId, WeaveTAKEChallengerAuthDelegate *authDelegate)
Phương thức này được gọi để thiết lập phiên Take an toàn.

Loại công khai

KeyErrorMsgRcvdFunct

void(* KeyErrorMsgRcvdFunct)(uint16_t keyId, uint8_t encType, uint32_t messageId, uint64_t peerNodeId, WEAVE_ERROR keyErr)

Loại hàm xử lý thông báo lỗi chính.

Thông tin chi tiết
Các tham số
[in] keyId
Khoá mã hoá gây ra phản hồi thông báo lỗi chính của ứng dụng ngang hàng.
[in] encType
Loại mã hoá liên kết với keyId.
[in] messageId
Giá trị nhận dạng của thông báo Weave đã dẫn đến phản hồi lỗi quan trọng từ ứng dụng ngang hàng.
[in] peerNodeId
Giá trị nhận dạng của nút Weave đã gửi thông báo lỗi chính.
[in] keyErr
Mã lỗi nhận được từ ứng dụng ngang hàng.

KeyExportCompleteFunct

void(* KeyExportCompleteFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, uint32_t exportedKeyId, const uint8_t *exportedKey, uint16_t exportedKeyLen)

Loại hàm xử lý hoàn chỉnh giao thức xuất khoá.

Thông tin chi tiết
Các tham số
[in] sm
Con trỏ đến đối tượng WeaveSecurityManager.
[in] con
Con trỏ đến đối tượng WeaveConnection.
[in] reqState
Con trỏ đến trạng thái của người yêu cầu xuất khoá.
[in] keyId
Mã khoá đã xuất.
[in] exportedKey
Con trỏ đến khoá bí mật đã xuất.
[in] exportedKeyLen
Tham chiếu đến độ dài khoá bí mật đã xuất.

KeyExportErrorFunct

void(* KeyExportErrorFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, WEAVE_ERROR localErr, StatusReport *statusReport)

Loại hàm xử lý lỗi của giao thức xuất khoá.

Thông tin chi tiết
Các tham số
[in] sm
Con trỏ đến đối tượng WeaveSecurityManager.
[in] con
Con trỏ đến đối tượng WeaveConnection.
[in] reqState
Con trỏ đến trạng thái của người yêu cầu xuất khoá.
[in] localErr
Đã xảy ra WEAVE_ERROR trong giao thức xuất khoá.
[in] statusReport
Con trỏ tới đối tượng StatusReport nếu nhận được trạng thái lỗi từ ứng dụng ngang hàng.

SessionErrorFunct

void(* SessionErrorFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, WEAVE_ERROR localErr, uint64_t peerNodeId, StatusReport *statusReport)

SessionEstablishedFunct

void(* SessionEstablishedFunct)(WeaveSecurityManager *sm, WeaveConnection *con, void *reqState, uint16_t sessionKeyId, uint64_t peerNodeId, uint8_t encType)

Tiểu bang

 State

Thuộc tính công khai

Trường hợp sử dụng đã biếtECDHKey

bool CASEUseKnownECDHKey

ExchangeManager

WeaveExchangeManager * ExchangeManager

FabricState

WeaveFabricState * FabricState

IdleSessionTimeout

uint32_t IdleSessionTimeout

InitiatorAllowedCASEConfigs

uint8_t InitiatorAllowedCASEConfigs

InitiatorAllowedCASECurves

uint8_t InitiatorAllowedCASECurves

InitiatorAllowedKeyExportConfigs

uint8_t InitiatorAllowedKeyExportConfigs

InitiatorCASEConfig

uint32_t InitiatorCASEConfig

InitiatorCASECurveId

uint32_t InitiatorCASECurveId

InitiatorKeyExportConfig

uint8_t InitiatorKeyExportConfig

OnKeyErrorMsgRcvd

KeyErrorMsgRcvdFunct OnKeyErrorMsgRcvd

Hàm callback key error.

Hàm này được gọi khi nhận được một thông báo lỗi chính.

OnSessionError

SessionErrorFunct OnSessionError

OnSessionEstablished

SessionEstablishedFunct OnSessionEstablished

ResponderAllowedCASEConfigs

uint8_t ResponderAllowedCASEConfigs

ResponderAllowedCASECurves

uint8_t ResponderAllowedCASECurves

ResponderAllowedKeyExportConfigs

uint8_t ResponderAllowedKeyExportConfigs

SessionEstablishTimeout

uint32_t SessionEstablishTimeout

Tiểu bang

uint8_t State

mCASEEngine

WeaveCASEEngine * mCASEEngine

mKeyExport

WeaveKeyExport * mKeyExport

mPASEEngine

WeavePASEEngine * mPASEEngine

mStartKeyExport_OnComplete

KeyExportCompleteFunct mStartKeyExport_OnComplete

Giao thức xuất khoá hoàn tất hàm gọi lại.

Hàm này được gọi khi quá trình xuất khoá bí mật hoàn tất.

mStartKeyExport_OnError

KeyExportErrorFunct mStartKeyExport_OnError

Hàm gọi lại lỗi của giao thức xuất khoá.

Hàm này được gọi khi xảy ra lỗi trong quá trình xuất khoá.

mStartKeyExport_ReqState

void * mStartKeyExport_ReqState

mStartSecureSession_OnComplete

SessionEstablishedFunct mStartSecureSession_OnComplete

mStartSecureSession_OnError

SessionErrorFunct mStartSecureSession_OnError

mStartSecureSession_ReqState

void * mStartSecureSession_ReqState

mTAKEEngine

WeaveTAKEEngine * mTAKEEngine

Hàm công khai

CancelSessionEstablishment

WEAVE_ERROR CancelSessionEstablishment(
  void *reqState
)

Huỷ quá trình thiết lập phiên đang tiến hành.

Thông tin chi tiết
Các tham số
[in] reqState
Một giá trị con trỏ khớp với giá trị do ứng dụng cung cấp khi phiên bắt đầu.
Giá trị trả về
WEAVE_NO_ERROR
Nếu hệ thống phát hiện và huỷ một quá trình thiết lập phiên đang xử lý trùng khớp.
WEAVE_ERROR_INCORRECT_STATE
Nếu không có quá trình thiết lập phiên nào đang diễn ra hoặc phiên đang diễn ra không khớp với con trỏ trạng thái yêu cầu đã cung cấp.

Bắt đầu

WEAVE_ERROR Init(
  WeaveExchangeManager & aExchangeMgr,
  System::Layer & aSystemLayer
)

IsKeyError

bool IsKeyError(
  WEAVE_ERROR err
)

Kiểm tra xem mã lỗi Weave được chỉ định có phải là một trong các mã lỗi chính không.

Hàm này được gọi để xác định xem có nên gửi thông báo lỗi chính đến trình tạo thông báo không tìm thấy khoá chính xác trong quá trình giải mã hay không.

Thông tin chi tiết
Các tham số
[in] err
Mã lỗi Weave.
Giá trị trả về
true
Nếu được chỉ định, mã lỗi Weave là một lỗi quan trọng.
false
Nếu không.

OnEncryptedMsgRcvd

void OnEncryptedMsgRcvd(
  uint16_t sessionKeyId,
  uint64_t peerNodeId,
  uint8_t encType
)

ReleaseKey

void ReleaseKey(
  uint64_t peerNodeId,
  uint16_t keyId
)

Huỷ yêu cầu đặt trước khoá mã hoá cho tin nhắn.

Huỷ yêu cầu đặt trước đã đặt trước đó trên khoá mã hoá thư.

Đối với mọi yêu cầu đặt trước trên một khoá cụ thể, phương thức ReleaseKey() chỉ được gọi một lần.

Phương thức này chấp nhận mọi dạng mã nhận dạng khoá, kể cả Không có. Những mã nhận dạng khoá không đặt tên cho khoá thực tế sẽ bị bỏ qua.

Thông tin chi tiết
Các tham số
[in] peerNodeId
Mã nút Weave của ứng dụng ngang hàng mà khoá dùng chung.
[in] keyId
Mã của khoá cần huỷ đặt trước.

ReserveKey

void ReserveKey(
  uint64_t peerNodeId,
  uint16_t keyId
)

Đặt trước một khoá mã hoá thư.

Đặt trước khoá dùng để báo hiệu rằng một khoá cụ thể đang được sử dụng và sẽ được giữ lại. Lưu ý rằng việc đặt trước trên khoá không đảm bảo rằng khoá sẽ không bị xoá do một thao tác rõ ràng (chẳng hạn như nhận được thông báo KeyError).

Đối với mọi giao dịch đặt trước trên một khoá cụ thể, bạn phải thực hiện lệnh gọi tương ứng đến ReleaseKey().

Phương thức này chấp nhận mọi dạng mã nhận dạng khoá, kể cả Không có. Những mã nhận dạng khoá không đặt tên cho khoá thực tế sẽ bị bỏ qua.

Thông tin chi tiết
Các tham số
[in] peerNodeId
Mã nút Weave của ứng dụng ngang hàng mà khoá dùng chung.
[in] keyId
Mã của khoá cần đặt trước.

SendKeyErrorMsg

WEAVE_ERROR SendKeyErrorMsg(
  WeaveMessageInfo *rcvdMsgInfo,
  const IPPacketInfo *rcvdMsgPacketInfo,
  WeaveConnection *con,
  WEAVE_ERROR keyErr
)

Gửi thông báo lỗi quan trọng.

Hàm này được gọi khi không giải mã được thông báo Weave do lỗi khoá.

Thông tin chi tiết
Các tham số
[in] rcvdMsgInfo
Con trỏ đến thông tin thông báo của thông báo Weave đã nhận.
[in] rcvdMsgPacketInfo
Con trỏ đến đối tượng IPPacketInfo của thông báo Weave đã nhận.
[in] con
Con trỏ đến đối tượng WeaveConnection.
[in] keyErr
Mã lỗi khoá kiểu dệt.
Giá trị trả về
WEAVE_ERROR_NO_MEMORY
Trường hợp không thể phân bổ bộ nhớ cho ngữ cảnh trao đổi mới hoặc vùng đệm thông báo mới.
WEAVE_ERROR_BUFFER_TOO_SMALL
Nếu bộ đệm quá nhỏ
WEAVE_NO_ERROR
Nếu phương thức thành công.

SetCASEAuthDelegate

void SetCASEAuthDelegate(
  WeaveCASEAuthDelegate *delegate
)

SetKeyExportDelegate

void SetKeyExportDelegate(
  WeaveKeyExportDelegate *delegate
)

SetTAKEAuthDelegate

void SetTAKEAuthDelegate(
  WeaveTAKEChallengerAuthDelegate *delegate
)

SetTAKETokenAuthDelegate

void SetTAKETokenAuthDelegate(
  WeaveTAKETokenAuthDelegate *delegate
)

Tắt

WEAVE_ERROR Shutdown(
  void
)

StartCASESession

WEAVE_ERROR StartCASESession(
  WeaveConnection *con,
  uint64_t peerNodeId,
  const IPAddress & peerAddr,
  uint16_t peerPort,
  WeaveAuthMode requestedAuthMode,
  void *reqState,
  SessionEstablishedFunct onComplete,
  SessionErrorFunct onError,
  WeaveCASEAuthDelegate *authDelegate,
  uint64_t terminatingNodeId
)

Phương thức này được gọi để thiết lập phiên CASE mới hoặc tìm phiên CASE hiện có.

Thông tin chi tiết
Các tham số
[in] con
Con trỏ đến đối tượng WeaveConnection.
[in] peerNodeId
Giá trị nhận dạng nút của ứng dụng ngang hàng.
[in] peerAddr
Địa chỉ IP của nút ngang hàng.
[in] peerPort
Cổng của nút ngang hàng.
[in] requestedAuthMode
Phương pháp mong muốn để xác thực kết nối ngang hàng. Đây phải là một trong các chế độ xác thực CASE.
[in] reqState
Con trỏ đến trạng thái của người yêu cầu.
[in] onComplete
Con trỏ đến hàm callback, được gọi sau khi phiên bảo mật yêu cầu được thiết lập.
[in] onError
Con trỏ đến hàm callback, hàm này sẽ được gọi nếu quá trình thiết lập phiên được yêu cầu không thành công.
[in] authDelegate
Con trỏ đến đối tượng uỷ quyền xác thực CASE.
[in] terminatingNodeId
Giá trị nhận dạng nút của nút kết thúc phiên. Khi dữ liệu đầu vào này khác với kNodeIdNotSpecified cho biết rằng phiên bảo mật dùng chung đã được yêu cầu.
Giá trị trả về
WEAVE_NO_ERROR
Khi thành công.

StartKeyExport

WEAVE_ERROR StartKeyExport(
  WeaveConnection *con,
  uint64_t peerNodeId,
  const IPAddress & peerAddr,
  uint16_t peerPort,
  uint32_t keyId,
  bool signMessage,
  void *reqState,
  KeyExportCompleteFunct onComplete,
  KeyExportErrorFunct onError,
  WeaveKeyExportDelegate *keyExportDelegate
)

StartPASESession

WEAVE_ERROR StartPASESession(
  WeaveConnection *con,
  WeaveAuthMode requestedAuthMode,
  void *reqState,
  SessionEstablishedFunct onComplete,
  SessionErrorFunct onError,
  const uint8_t *pw,
  uint16_t pwLen
)

Phương thức này được gọi để thiết lập phiên PASE an toàn.

Thông tin chi tiết
Các tham số
[in] con
Con trỏ đến đối tượng WeaveConnection.
[in] requestedAuthMode
Phương pháp mong muốn để xác thực kết nối ngang hàng. Đây phải là một trong các chế độ xác thực PASE.
[in] reqState
Con trỏ đến trạng thái của người yêu cầu.
[in] onComplete
Con trỏ đến hàm callback, được gọi sau khi phiên bảo mật yêu cầu được thiết lập.
[in] onError
Con trỏ đến hàm callback, hàm này sẽ được gọi nếu quá trình thiết lập phiên được yêu cầu không thành công.
[in] pw
Con trỏ tới mật khẩu bí mật PASE.
[in] pwLen
Độ dài của mật khẩu bí mật PASE.
Giá trị trả về
WEAVE_NO_ERROR
Khi thành công.

StartTAKESession

WEAVE_ERROR StartTAKESession(
  WeaveConnection *con,
  WeaveAuthMode requestedAuthMode,
  void *reqState,
  SessionEstablishedFunct onComplete,
  SessionErrorFunct onError,
  bool encryptAuthPhase,
  bool encryptCommPhase,
  bool timeLimitedIK,
  bool sendChallengerId,
  WeaveTAKEChallengerAuthDelegate *authDelegate
)

Phương thức này được gọi để thiết lập phiên Take an toàn.

Thông tin chi tiết
Các tham số
[in] con
Con trỏ đến đối tượng WeaveConnection.
[in] requestedAuthMode
Phương pháp mong muốn để xác thực kết nối ngang hàng. Đây phải là một trong các chế độ xác thực Take.
[in] reqState
Con trỏ đến trạng thái của người yêu cầu.
[in] onComplete
Con trỏ đến hàm callback, được gọi sau khi phiên bảo mật yêu cầu được thiết lập.
[in] onError
Con trỏ đến hàm callback, hàm này sẽ được gọi nếu quá trình thiết lập phiên được yêu cầu không thành công.
[in] encryptAuthPhase
Một cờ boolean cho biết giai đoạn xác thực giao thức có cần được mã hoá hay không.
[in] encryptCommPhase
Một cờ boolean cho biết giai đoạn giao tiếp giao thức có cần được mã hoá hay không.
[in] timeLimitedIK
Một cờ boolean cho biết liệu Khoá nhận dạng (IK) có bị giới hạn thời gian hay không.
[in] sendChallengerId
Một cờ boolean cho biết liệu có cần đưa thông tin nhận dạng người thách thức vào thông báo hay không. Nếu mã này không được bao gồm, giá trị mã nhận dạng nút Weave sẽ được dùng làm mã nhận dạng người thách thức.
[in] authDelegate
Con trỏ đến đối tượng uỷ quyền xác thực của người xác thực.
Giá trị trả về
WEAVE_NO_ERROR
Khi thành công.

WeaveSecurityManager

 WeaveSecurityManager(
  void
)