MessageSecurityException
class MessageSecurityException(message: String, val responseCode: CoapCode = CoapCode.BAD_REQUEST, val diagnostic: String? = null, cause: Throwable? = null, errorPayload: ByteArray? = null, val contentFormat: Int? = null) : Exception(source)
A message that message security could not protect or verify.
On the server side, from ServerMessageSecurity.unprotectRequest, it describes the error response, which is sent unprotected with Max-Age 0 (RFC 8613 §8.2): responseCode, and as payload either errorPayload with contentFormat (an EDHOC error message in RFC 9668 §3.3.1, for example) or the diagnostic text.
On the client side the response fields are unused. From ClientMessageSecurity.protectRequest it says that a request that must be protected cannot be, and kcoap-coap's client fails the request with a CoapException of reason SECURITY with this as cause; from ProtectedRequest.unprotectResponse it drops the response.
Constructors
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
A structured error body to send instead of diagnostic, or null.
Link copied to clipboard