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

Function validateKeyOrCertOption

lib/internal/tls/secure-context.js:74–87  ·  view source on GitHub ↗
(name, value)

Source from the content-addressed store, hash-verified

72}
73
74function validateKeyOrCertOption(name, value) {
75 if (typeof value !== 'string' && !isArrayBufferView(value)) {
76 throw new ERR_INVALID_ARG_TYPE(
77 name,
78 [
79 'string',
80 'Buffer',
81 'TypedArray',
82 'DataView',
83 ],
84 value,
85 );
86 }
87}
88
89function setKey(context, key, passphrase, name) {
90 validateKeyOrCertOption(`${name}.key`, key);

Callers 4

addCACertsFunction · 0.85
setCertsFunction · 0.85
setKeyFunction · 0.85
configSecureContextFunction · 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…