Verify.verify method | Node.js crypto module | Bun
BuildDocsReferenceGuidesBlogDiscord/
node:crypto/
Verify/
verifyMverify
Search the reference...
/
BuildDocsReferenceGuidesBlogDiscord/
node:crypto/
Verify/
verifyMverify
method
crypto.Verify.verifyverify(object:
KeyLike |
VerifyKeyObjectInput |
VerifyPublicKeyInput |
VerifyJsonWebKeyInput,signature: ArrayBufferView): boolean;
Verifies the provided data using the given object and signature.
If object is not a KeyObject, this function behaves as if object had been passed to createPublicKey. If it is an object, the following additional properties can be passed:
The signature argument is the previously calculated signature for the data, in the signatureEncoding. If a signatureEncoding is specified, the signature is expected to be a string; otherwise signature is expected to be a Buffer, TypedArray, or DataView.
The verify object can not be used again after verify.verify() has been called. Multiple calls to verify.verify() will result in an error being thrown.
Because public keys can be derived from private keys, a private key may be passed instead of a public key.
verify(object:
KeyLike |
VerifyKeyObjectInput |
VerifyPublicKeyInput |
VerifyJsonWebKeyInput,signature: string,signature_format?:
BinaryToTextEncoding): boolean;
Verifies the provided data using the given object and signature.
If object is not a KeyObject, this function behaves as if object had been passed to createPublicKey. If it is an object, the following additional properties can be passed:
The signature argument is the previously calculated signature for the data, in the signatureEncoding. If a signatureEncoding is specified, the signature is expected to be a string; otherwise signature is expected to be a Buffer, TypedArray, or DataView.
The verify object can not be used again after verify.verify() has been called. Multiple calls to verify.verify() will result in an error being thrown.
Because public keys can be derived from private keys, a private key may be passed instead of a public key.
Referenced typestype
KeyLike = string |
Buffer |
KeyObjectinterface
VerifyKeyObjectInputcontext?:
ArrayBuffer | ArrayBufferViewArrayBufferLike>
dsaEncoding?:
DSAEncodingkey:
KeyObjectpadding?: number
saltLength?: numberinterface
VerifyPublicKeyInputcontext?:
ArrayBuffer | ArrayBufferViewArrayBufferLike>
dsaEncoding?:
DSAEncodingencoding?: string
format?:
KeyFormatkey: string |
BufferArrayBufferLike>
padding?: number
saltLength?: number
type?:
PublicKeyExportTypeinterface
VerifyJsonWebKeyInputcontext?:
ArrayBuffer | ArrayBufferViewArrayBufferLike>
dsaEncoding?:
DSAEncodingformat: 'jwk'
key:
JsonWebKeypadding?: number
saltLength?: numbertype
BinaryToTextEncoding = 'base64' | 'base64url' | 'hex' | 'binary'
Resources
ReferenceDocsGuidesDiscordMerch StoreGitHubBlog Toolkit
RuntimePackage managerTest runnerBundlerPackage runnerProject
Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco
We're hiring →