* 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)
| 918 | * @returns {string} |
| 919 | */ |
| 920 | function 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…