MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / isEncryptedEnvelope

Function isEncryptedEnvelope

packages/encryption/src/keyed-envelope.ts:127–144  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

125}
126
127function isEncryptedEnvelope(value: unknown): value is EncryptedEnvelope {
128 if (value === null || typeof value !== 'object') {
129 return false;
130 }
131
132 return (
133 'algorithm' in value &&
134 value.algorithm === 'rsa-aes-256-gcm' &&
135 'version' in value &&
136 value.version === 1 &&
137 'encryptedData' in value &&
138 typeof value.encryptedData === 'string' &&
139 value.encryptedData.length > 0 &&
140 'encryptedDEK' in value &&
141 typeof value.encryptedDEK === 'string' &&
142 value.encryptedDEK.length > 0
143 );
144}

Callers 1

parseKeyedEnvelopeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected