|
|
# Signing CoAP requests with jRECMA
|
|
|
# Welcome to the jRECMA Wiki
|
|
|
With the Web being its most prominent and important technical implementation, REST (Representational State Transfer) [1] has been established as an lightweight approach for designing distributed-systems that scale at large. Therefore, the architectural principles has gained traction in the Internet of Things (IoT) domain likewise.
|
|
|
|
|
|
CoAP is an standardized REST-based protocol for constrained nodes and networks which is based on HTTP. As with HTTP, the communication in REST-based CoAP applications are mostly secured by transport-oriented protection, i.e. (D)TLS. In high-scalable distributed systems which contains multiple intermediaries, e.g., load balancer, cache server or proxies to promote scalability, transport security is not a sufficient safeguard. Hence, application layer security mechanism providing end-to-end protection are mandatory.
|
|
|
|
|
|
The project jRECMA provides an integrity and authenticity protection for CoAP at the application layer. This is realized by signing CoAP messages as a whole.
|
|
|
|
|
|
## Signing CoAP requests with jRECMA
|
|
|
This an example showing how to sign a CoAP request with HMAC-SHA256.
|
|
|
```java
|
|
|
byte[] key = Base64.getMimeDecoder().decode(base64Key);
|
|
|
|
... | ... | |