BuildDocsReferenceGuidesBlogDiscordnode:cryptoKeyObjectPasymmetricKeyDetailsPasymmetricKeyTypeMequalsMexportMfromPsymmetricKeySizeMtoCryptoKeyPtypeBuildDocsReferenceGuidesBlogDiscordnode:cryptoKeyObjectPasymmetricKeyDetailsPasymmetricKeyTypeMequalsMexportMfromPsymmetricKeySizeMtoCryptoKeyPtypecrypto.KeyObjectKeyObjectasymmetricKeyDetailsAsymmetricKeyDetailsasymmetricKeyTypeAsymmetricKeyTypeasymmetric key typessymmetricKeySizetypeKeyObjectTypeequalsKeyObjectconstant timeexportKeyExportOptionsKeyExportResultJWKJWKRFC 5208RFC 1421toCryptoKeyAlgorithmIdentifierRsaHashedImportParamsEcKeyImportParamsHmacImportParamsKeyUsageCryptoKeyfromCryptoKeyKeyObjectReferenceDocsGuidesDiscordMerch StoreGitHubBlogRuntimePackage managerTest runnerBundlerPackage runnerBun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseWe're hiring →
Node crypto.KeyObject class | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引
- Node.js uses a `KeyObject` class to represent a symmetric or asymmetric key,
and each kind of key exposes different functions. The createSecretKey, createPublicKey and createPrivateKey methods are used to create `KeyObject`instances. `KeyObject`
objects are not to be created directly using the `new`keyword.
Most applications should consider using the new `KeyObject` API instead of
passing keys as strings or `Buffer`s due to improved security features.
`KeyObject` instances can be passed to other threads via `postMessage()`.
The receiver obtains a cloned `KeyObject`, and the `KeyObject` does not need to
be listed in the `transferList` argument.