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

Function getKeyObjectAsymmetricKeyType

lib/internal/crypto/keys.js:920–931  ·  view source on GitHub ↗

* Returns the KeyObject's asymmetric key type, bypassing the public * `asymmetricKeyType` getter. The value is derived lazily from the cached * KeyObjectHandle. * @param {PublicKeyObject|PrivateKeyObject} key * @returns {string}

(key)

Source from the content-addressed store, hash-verified

918 * @returns {string}
919 */
920function getKeyObjectAsymmetricKeyType(key) {
921 const slots = getKeyObjectSlots(key);
922 if (slots[kKeyObjectSlotType] === kKeyTypeSecret)
923 throw new ERR_INVALID_THIS('AsymmetricKeyObject');
924
925 let cached = slots[kKeyObjectSlotAsymmetricKeyType];
926 if (cached === undefined) {
927 cached = slots[kKeyObjectSlotHandle].getAsymmetricKeyType();
928 slots[kKeyObjectSlotAsymmetricKeyType] = cached;
929 }
930 return cached;
931}
932
933/**
934 * Returns the KeyObject's cached asymmetric key details, bypassing the

Callers 4

asymmetricKeyTypeMethod · 0.85
exportMethod · 0.85
exportMethod · 0.85
diffieHellmanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…