Rearrange

This commit is contained in:
Manav Rathi
2024-08-17 17:13:16 +05:30
parent f3e947f47e
commit 153be4990a

View File

@@ -1,3 +1,8 @@
/**
* Data provided either as bytes ({@link Uint8Array}) or their base64 string representation.
*/
export type BytesOrB64 = Uint8Array | string;
/**
* An encryption request with the data to encrypt provided as bytes.
*/
@@ -43,6 +48,29 @@ export interface EncryptJSON {
keyB64: string;
}
/**
* The result of encryption using the secretbox APIs.
*
* It contains an encrypted data and a randomly generated nonce that was used
* during encryption. Both these values are needed to decrypt the data. The
* nonce does not need to be secret.
*
* See: [Note: 3 forms of encryption (Box | Blob | Stream)].
*/
export interface EncryptedBox2 {
/**
* The data to decrypt.
*/
encryptedData: BytesOrB64;
/**
* The nonce that was used during encryption.
*
* The nonce is required to decrypt the data, but it does not need to be
* kept secret.
*/
nonce: BytesOrB64;
}
/**
* The result of encryption using the secretbox APIs.
*
@@ -149,30 +177,6 @@ export interface DecryptBoxBytes {
keyB64: string;
}
/**
* Data provided either as bytes ({@link Uint8Array}) or their base64 string representation.
*/
export type BytesOrB64 = Uint8Array | string;
/**
* A decryption request to decrypt data encrypted using the secretbox APIs.
*
* See: [Note: 3 forms of encryption (Box | Blob | Stream)].
*/
export interface EncryptedBox2 {
/**
* The data to decrypt.
*/
encryptedData: BytesOrB64;
/**
* The nonce that was used during encryption.
*
* The nonce is required to decrypt the data, but it does not need to be
* kept secret.
*/
nonce: BytesOrB64;
}
/**
* A variant of {@link DecryptBoxBytes} with the encrypted Blob's data as a
* base64 encoded string.