HMAC-SHA256 Signature Verification of Request-Response (2024)

The RMS Cloud LM (server) uses HMAC-SHA256-based message signing to authenticate client requests (users/devices consuming licenses) while using the login, refresh, and logout calls. Only these REST APIs require message signing, as they facilitate license authorization.

For clients using the REST APIs, it is the software vendor's responsibility to compute a message signature and send it in the x-sntl-signature HTTP header. If a correct signature is not passed in the header for the login, refresh, and logout calls, these APIs will fail. Similarly, messages from the server should be validated on the client end using the value in the x-sntl-signature header sent by the server.

TIP The SCP-integrated library automatically handles the end-to-end process of message signing. Refer to the table below for detailed workflow.

HMAC-SHA256 Signature Verification of Request-Response (1)

Message Signing Workflow

The workflow for message signing between the client and server is as follows:

Workflow Entity Responsible
For SCP-integrated Library For RMS Cloud LM REST API

Client computes the signature of request data using the steps described below.

SCP-integrated Library To be done by the software vendor
Client sends the computed signature in the x-sntl-signature request header to the server. SCP-integrated Library To be done by the software vendor
Server authorizes the client request upon successful signature verification. Server Server
The server computes the signature of response data using the steps described below. Server Server
Server sends the computed signature in the x-sntl-signature response header to the client. Server Server

Client verifies the signature received from the server.

SCP-integrated Library To be done by the software vendor

Steps for Computing a Message Signature

Step 1: Calculate x-sntl-content-sha256

Calculate the SHA256 content of a request body, which is used as a value for x-sntl-content-sha256 in the stringToSign.

Step 2: Create stringToSign

Concatenate the selected elements of the request to form stringToSign.

Rules to Construct stringToSign

Follow the rules below to construct stringToSign:

>All participating elements must be separated by a newline character.

>Thefirst element is the HTTP verb in uppercase.

NOTE Message signing is only needed for POST methods (such as login, refresh, and logout), so the value is always POST.

>The last element is the canonicalized resource. This is the string containing the resource as used in the request URI. For example: /rmslm/licenseSessions

>Between the first and the last elements are the participating headers listed below (also described here) and their values in the format <header-name>:<header-value>:

Content-Length

Content-Type

x-sntl-content-sha256

x-sntl-epoch

x-sntl-message-id<![CDATA[]]>

NOTE The headers and their values must be concatenated in the order listed above.

>For all the header values, all the leading and trailing spaces must be trimmed before adding to the stringToSign

>All the header names should be converted to lower case before adding to the stringToSign.

An example of stringToSign:

POST\n // HTTP-Verbcontent-length:400\n // Content-Length header valuecontent-type:application/json\n // Content-Type header valuex-sntl-content-sha256:7ba7bf9d4819f6f9892edc7aab6432566265cb69ef3acd2fc1f35fbf8758a2c6\n // SHA256 of HTTP bodyx-sntl-epoch:1540054530\n // epoch header valuex-sntl-message-id:C1EC68F7-9661-4580-94A8-8F0E0CC67D84\n // message-id header value/rmslm/licenseSessions // canonicalized resource

Step 3: Calculate HMAC-SHA256 of stringToSign

Compute the HMAC-SHA256 of stringToSign using the Secret Key.

NOTE Both the Secret Key and Secret Key ID (used in step 4) are provided in the Sentinel order email.

HMAC-SHA256 is an algorithm defined by RFC 2104 (RFC 2104—Keyed-Hashing for Message Authentication). The algorithm takes two byte-strings as input: a key and a message. The output of HMAC-SHA256 is a byte string, called the digest. You must perform the Base64 encoding of this digest to calculate the signature.

The pseudo-grammar that illustrates the construction of a signature is shown below:

Signature = Base64( HMAC-SHA256( YourSecretKey, StringToSign ) )

Step 4: Form the x-sntl-signature Header

Form the x-sntl-signature header by using the signature computed in the step above.

The x-sntl-signature header has the following format:

[YourSecretKeyId]:[Signature]

For response verification, the signature calculated in Step 3 is verified against the value received from the server in the x-sntl-signature header.

HMAC-SHA256 Signature Verification of Request-Response (2024)

FAQs

What is the HMAC signature of the request? ›

HMAC Signing is an access token method that adds another level of security by forcing the requesting client to also send along a signature that identifies the request temporally to ensure that the request is from the requesting user, using a secret key that is never broadcast over the wire.

What are the key requirements for HMAC SHA256? ›

The secret key for HMACSHA256 encryption. The key can be any length. However, the recommended size is 64 bytes. If the key is more than 64 bytes long, it is hashed (using SHA-256) to derive a 64-byte key.

How to decode HMAC SHA256? ›

You can't decode it as it's a one way encryption. To validate you need to recreate the the HMAC_SHA256 on your side from the data that has been passed and a shared secret key. You then compare your calculated value to one provided and if they match you know the data hasn't been tampered with.

How do I check my SHA-256 signature? ›

Using Power Shell
  1. Press Windows+R to open the Run box.
  2. Type powershell and click OK.
  3. The Windows PowerShell window will open.
  4. Run the following command: Get-FileHash C:\file\path\my_file.exe -Algorithm SHA256. ...
  5. Compare the generated value to the checksum of the file in Rublon Downloads.
Feb 8, 2024

How does HMAC verification work? ›

Hash-based message authentication code (or HMAC) is a cryptographic authentication technique that uses a hash function and a secret key. With HMAC, you can achieve authentication and verify that data is correct and authentic with shared secrets, as opposed to approaches that use signatures and asymmetric cryptography.

How do you generate a HMAC signature? ›

Generating a Signature

We only need two components to generate an HMAC signature: a secret-key and the data to hash. The secret-key can be a simple String of alphanumeric characters. The longer the number of characters, the better.

How does HMAC SHA-256 work? ›

The HMAC process mixes a secret key with the message data, hashes the result with the hash function, mixes that hash value with the secret key again, and then applies the hash function a second time. The output hash is 256 bits in length.

What is the best authentication for HMAC? ›

So which HMAC should you use? You would normally choose an HMAC based on its underlying hash function. So, for example, you would want to use HMAC-MD5 if performance is more critical to you than security. On the other hand, if security is more critical, then you might want to use HMAC-SHA256 instead.

What is HMAC SHA-256 format? ›

HMACSHA256 is a type of keyed hash algorithm that is constructed from the SHA-256 hash function and used as a Hash-based Message Authentication Code (HMAC).

What is the secret key in HMAC? ›

The secret cryptographic key is what enables a user to make an encrypted message readable after it has been encrypted by an algorithm. In an HMAC transaction, the client and server must agree on the secret key. This provides a way to decode messages, which must stay secret, to maintain the transaction's integrity.

How to validate HMAC SHA-256? ›

Get the raw body of the request; Extract the signature header value; Calculate the HMAC of the raw body using the SHA-256 hash function and the secret; and. Compare the calculated HMAC with the one sent in the X-Signature-SHA256 signature header, making sure that both values use the same encoding.

What is HMAC SHA-256 shared secret? ›

HMAC-SHA256 is a message authentication code that uses a shared secret between the two communicating parties. It is absolutely necessary that both ends possess the same key (and anyone with that key can both generate and validate messages).

How to get HMAC key? ›

Get HMAC key information

In the Google Cloud console, go to the Cloud Storage Settings page. Select the Interoperability tab. Service accounts that have HMAC keys associated with them appear in the Access keys for service accounts subsection of the Service account HMAC section.

How do I know if SHA-256 is valid? ›

You can use Windows Powershell to calculate the SHA-256 checksum for a file.
  1. Open Windows Powershell. ...
  2. Type Get-FileHash followed by a space.
  3. Drag the downloaded ZIP file onto the Windows Powershell window after the Get-FileHash command. ...
  4. Press Enter. ...
  5. Compare the calculated hash value with the original hash value.

How to test HMAC? ›

To build your own solution for verifying HMAC signatures, follow these steps:
  1. Step 1: Construct the payload. The values used below are from an example webhook. ...
  2. Step 2: Calculate the HMAC signature. For hints about how to calculate the signature, have a look at the library code samples above. ...
  3. Step 3: Compare signatures.

Is HMAC SHA-256 the same as SHA-256? ›

HMAC stands for "Hash-based Message Authentication Code," and SHA-256 refers to the Secure Hash Algorithm 256-bit variant. HMAC-SHA-256 combines the strength of SHA-256's cryptographic hashing with HMAC's ability to authenticate the integrity and source of a message.

Top Articles
G Fund - Global Disruption GD - EUR - LU1897556277 - Cours OPCVM
M&G Global Dividend Fund Sterling R Inc|GB00B6VRX242
Whas Golf Card
Golden Abyss - Chapter 5 - Lunar_Angel
Po Box 7250 Sioux Falls Sd
Farepay Login
Is pickleball Betts' next conquest? 'That's my jam'
Workday Latech Edu
Meer klaarheid bij toewijzing rechter
Red Wing Care Guide | Fat Buddha Store
Marist Dining Hall Menu
7543460065
J Prince Steps Over Takeoff
World of White Sturgeon Caviar: Origins, Taste & Culinary Uses
Lantana Blocc Compton Crips
Raid Guides - Hardstuck
Tokioof
Indiana Immediate Care.webpay.md
Aldi Süd Prospekt ᐅ Aktuelle Angebote online blättern
Lehmann's Power Equipment
Van Buren County Arrests.org
What Is Vioc On Credit Card Statement
Eine Band wie ein Baum
Project, Time & Expense Tracking Software for Business
Military life insurance and survivor benefits | USAGov
Scream Queens Parents Guide
Watch Your Lie in April English Sub/Dub online Free on HiAnime.to
Wnem Tv5 Obituaries
Mawal Gameroom Download
Southtown 101 Menu
The Bold and the Beautiful
Haunted Mansion Showtimes Near Cinemark Tinseltown Usa And Imax
Appleton Post Crescent Today's Obituaries
The Pretty Kitty Tanglewood
Frostbite Blaster
Smith And Wesson Nra Instructor Discount
craigslist | michigan
Insideaveritt/Myportal
The Holdovers Showtimes Near Regal Huebner Oaks
Kornerstone Funeral Tulia
craigslist: modesto jobs, apartments, for sale, services, community, and events
Craigslist Odessa Midland Texas
Below Five Store Near Me
Craigslist Minneapolis Com
Peace Sign Drawing Reference
What Is The Optavia Diet—And How Does It Work?
The Blackening Showtimes Near Ncg Cinema - Grand Blanc Trillium
Phunextra
Gear Bicycle Sales Butler Pa
Hkx File Compatibility Check Skyrim/Sse
ats: MODIFIED PETERBILT 389 [1.31.X] v update auf 1.48 Trucks Mod für American Truck Simulator
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 6578

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.