diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 72d4bc78df9dde..1021e2c653f883 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -1121,6 +1121,9 @@ exposes different functions. Most applications should consider using the new `KeyObject` API instead of passing keys as strings or `Buffer`s due to improved security features. +See [`crypto.isKeyObject()`][] for checking whether a given input is +a `KeyObject` instance. + ### keyObject.asymmetricKeyType + +* `value` {any} +* Returns: {boolean} + +Returns `true` if the value is a [`KeyObject`][] instance. + +```js +const crypto = require('crypto'); +const keypair = crypto.generateKeyPairSync('ec', { namedCurve: 'P-256' }); + +crypto.isKeyObject(keypair.privateKey); // Returns true +``` + ### crypto.pbkdf2(password, salt, iterations, keylen, digest, callback)