Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encoding Uint8Array to message string #49

Open
elliotsayes opened this issue Aug 3, 2022 · 1 comment
Open

Encoding Uint8Array to message string #49

elliotsayes opened this issue Aug 3, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@elliotsayes
Copy link

elliotsayes commented Aug 3, 2022

Hi, I'm having a little trouble converting my data to use in the RSA.signPSS function. I've worked out that the signature parameter should be a base64 string, but I can't work out how to encode the message parameter when trying to sign arbitrary Uint8Array data. I've tried Buffer.from(messageBytes).toString() and B64js.fromByteArray(messageBytes) but neither seem to work.

TL;DR Could someone help me with handling signing of Uint8Array messages?

@jerson jerson added the enhancement New feature or request label Aug 8, 2022
@Vadko
Copy link

Vadko commented Sep 24, 2024

@jerson @elliotsayes Uint8Array type should be supported by default when signing - calculation of message offset in both signPSS and signPKCS1v15 is based on flatbuffer instance with createString method, which accepts and processes Uint8Array correctly - in my case just passing it to function returned correct signing to me, the only change which is required there to make it work properly is to just add Uint8Array type to message parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants