From e095979514276b5c7ed428bdf0f5ae5a966e5373 Mon Sep 17 00:00:00 2001 From: Ankit Goswami Date: Thu, 17 Sep 2020 11:26:58 -0400 Subject: [PATCH 1/3] Update readme Clarify signature generation --- readme.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index f057b70..ee11006 100644 --- a/readme.md +++ b/readme.md @@ -44,12 +44,16 @@ In order to generate a signature you need the following information: Your signature generation function will look something like this: ``` -base64(rsa_sha256(PARTNER_ID + "\n" + URL + "\n" + HTTP_METHOD + "\n" + TIMESTAMP + "\n" + PAYLOAD)) +message = PARTNER_ID + "\n" + URL + "\n" + HTTP_METHOD + "\n" + TIMESTAMP + "\n" + PAYLOAD +padding = PKCS1v15 +algorithm = SHA256 +base64(private_key.sign(message, padding, algorithm)) ``` **(Note that the newline character is escaped)** - `base64` is Strict Base64 encoding (RFC 4648). No line feeds are added. -- `rsa_sha256` is the RSA-SHA256 hashing algorithm using your private key. Padding is PKCS1v15 if you need to specify. +- The hashing algorithm is SHA256 using your RSA private key. +- Padding is PKCS1v15 if you need to specify. Please check out our examples to see this done in various languages. From 9462628f799deb3d829a87d9b30b4d6b093511e1 Mon Sep 17 00:00:00 2001 From: Ankit Goswami Date: Thu, 17 Sep 2020 11:29:56 -0400 Subject: [PATCH 2/3] Remove note about newline characters --- readme.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/readme.md b/readme.md index ee11006..72f56c1 100644 --- a/readme.md +++ b/readme.md @@ -49,8 +49,6 @@ padding = PKCS1v15 algorithm = SHA256 base64(private_key.sign(message, padding, algorithm)) ``` -**(Note that the newline character is escaped)** - - `base64` is Strict Base64 encoding (RFC 4648). No line feeds are added. - The hashing algorithm is SHA256 using your RSA private key. - Padding is PKCS1v15 if you need to specify. From 230da75a9e2972f9785d85cd9a4ac0600930e5be Mon Sep 17 00:00:00 2001 From: Ankit Goswami Date: Thu, 17 Sep 2020 11:59:10 -0400 Subject: [PATCH 3/3] Fix details about the signing algorithm --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 72f56c1..1546637 100644 --- a/readme.md +++ b/readme.md @@ -50,7 +50,7 @@ algorithm = SHA256 base64(private_key.sign(message, padding, algorithm)) ``` - `base64` is Strict Base64 encoding (RFC 4648). No line feeds are added. -- The hashing algorithm is SHA256 using your RSA private key. +- The signing algorithm is SHA256 using your RSA private key. - Padding is PKCS1v15 if you need to specify. Please check out our examples to see this done in various languages.