MCPcopy Index your code
hub / github.com/nodejs/node / getCryptoKeyType

Function getCryptoKeyType

lib/internal/crypto/keys.js:1153–1163  ·  view source on GitHub ↗

* Returns the value of a CryptoKey's `[[type]]` internal slot. * @param {CryptoKey} key * @returns {'secret' | 'public' | 'private'}

(key)

Source from the content-addressed store, hash-verified

1151 * @returns {'secret' | 'public' | 'private'}
1152 */
1153function getCryptoKeyType(key) {
1154 switch (getSlots(key)[kSlotType]) {
1155 case kKeyTypeSecret: return 'secret';
1156 case kKeyTypePublic: return 'public';
1157 case kKeyTypePrivate: return 'private';
1158 default: {
1159 const assert = require('internal/assert');
1160 assert.fail('Unreachable code');
1161 }
1162 }
1163}
1164
1165/**
1166 * Returns the value of a CryptoKey's `[[extractable]]` internal slot.

Callers 15

mlDsaExportKeyFunction · 0.85
mlDsaSignVerifyFunction · 0.85
mlKemExportKeyFunction · 0.85
mlKemEncapsulateFunction · 0.85
mlKemDecapsulateFunction · 0.85
exportKeySyncFunction · 0.85
importKeySyncFunction · 0.85
getPublicKeyImplFunction · 0.85
ecdsaSignVerifyFunction · 0.85
cfrgExportKeyFunction · 0.85
eddsaSignVerifyFunction · 0.85
fromMethod · 0.85

Calls 2

requireFunction · 0.50
failMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…