CtrContextBuilder
Provides support for building CTR (Counter) mode cipher contexts.
Extends
Accessors
count
Set Signature
set count(
count
):void
Specify the initial counter value for the CTR mode.
Remarks
This parameter is mandatory.
Throws
InvalidArgumentError If the counter value is invalid.
Parameters
count
bigint
The initial counter value to use.
Returns
void
key
Set Signature
set key(
key
):void
Specify the symmetric key to be used for encryption or decryption.
Remarks
This parameter is mandatory.
Parameters
key
The symmetric key to use.
Returns
void
Inherited from
nonce
Set Signature
set nonce(
nonce
):void
Specify the nonce value for the CTR mode.
Remarks
This parameter is mandatory.
Throws
InvalidArgumentError If the nonce value is invalid.
Parameters
nonce
bigint
The nonce value to use.
Returns
void
Methods
buildDecryptionContext()
buildDecryptionContext():
DecryptionContext
Build a context that can be used for decryption operations.
Returns
A decryption context.
Throws
AccessDeniedError If the key lacks the KeyPurpose.DECRYPT purpose.
Throws
InvalidArgumentError If any mandatory parameter is missing or the key is invalid.
Inherited from
CipherContextBuilder
.buildDecryptionContext
buildEncryptionContext()
buildEncryptionContext():
EncryptionContext
Build a context that can be used for encryption operations.
Returns
An encryption context.
Throws
AccessDeniedError If the key lacks the KeyPurpose.ENCRYPT purpose.
Throws
InvalidArgumentError If any mandatory parameter is missing or the key is invalid.
Inherited from
CipherContextBuilder
.buildEncryptionContext
buildWrappingContext()
buildWrappingContext(
scheme
):WrappingContext
Build a context that can be used for wrapping keys.
Parameters
scheme
The wrapping scheme to be used.
Returns
A wrapping context.
Throws
AccessDeniedError If the key lacks the KeyPurpose.WRAP and KeyPurpose.UNWRAP purposes.
Throws
InvalidArgumentError If any mandatory parameter is missing or the key is invalid.
Throws
NotSupportedError If the implementation does not support wrapping operations.
Inherited from
CipherContextBuilder
.buildWrappingContext
Last updated: Sep 30, 2025