Creates an instance of PrivSecretBuf.
the secret as a Uint8Array.
Will throw an error if the secret is not a Uint8Array or is zeroed.
Private
cfgPrivate
secretDerives a new secret from the current secret.
the subkey ID to use for derivation.
a new instance of PrivSecretBuf with the derived secret.
Will throw an error if the secret has already been zeroed or is not of length 32.
Helper class that makes securing secrets easier by hiding them in closures as additional protection against accidental exposure via debugging, etc. Note, when done with this secret, call
zero()
to clear the memory, but be warned that this is JavaScript, and that is no guarantee against exposure.