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

Support GetRandomBytes in Key Client #15875

Closed
maorleger opened this issue Jun 21, 2021 · 2 comments
Closed

Support GetRandomBytes in Key Client #15875

maorleger opened this issue Jun 21, 2021 · 2 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Milestone

Comments

@maorleger
Copy link
Member

maorleger commented Jun 21, 2021

As per https://github.com/Azure/azure-rest-api-specs/blob/c2dce10efdbaffe9358eadb14791a0bcbcabbcb5/specification/keyvault/data-plane/Microsoft.KeyVault/preview/7.3-preview/keys.json#L1223-L1266

I believe the current proposed API is

const bytes: UInt8Array = await keyClient.getRandomBytes(count /* number of bytes */)

Questions:

  • Does this return a buffer / byte array or a base64 encoded string?
@maorleger maorleger added Client This issue points to a problem in the data-plane of the library. KeyVault labels Jun 21, 2021
@maorleger maorleger added this to the [2021] July milestone Jun 21, 2021
@maorleger maorleger self-assigned this Jun 21, 2021
@chradek
Copy link
Contributor

chradek commented Jun 21, 2021

Does this return a buffer / byte array or a base64 encoded string?

For what it's worth, I like that it currently returns a Uint8Array, since that is an array of bytes and roughly matches browser's getRandomValues() which returns a TypedArray and node.js' randomBytes which returns a Buffer (which extends Uint8Array).

I'd expect that operations that needed to use the output of getRandomBytes would use the byte array, not the base64 string but open to hearing how it's meant to be used if that's not the case.

@maorleger
Copy link
Member Author

Closed via #15955

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. KeyVault
Projects
None yet
Development

No branches or pull requests

2 participants