constructor()

in modules/material-management/src/encrypted_data_key.ts [47:70]


  constructor(edkInput: IEncryptedDataKey) {
    const { providerInfo, providerId, encryptedDataKey, rawInfo } = edkInput
    needs(
      typeof providerInfo === 'string' &&
        providerInfo &&
        typeof providerId === 'string' &&
        providerId &&
        encryptedDataKey instanceof Uint8Array &&
        encryptedDataKey.byteLength,
      'Malformed encrypted data key'
    )

    readOnlyProperty(this, 'providerInfo', providerInfo)
    readOnlyProperty(this, 'providerId', providerId)
    readOnlyBinaryProperty(this, 'encryptedDataKey', encryptedDataKey)
    if (rawInfo instanceof Uint8Array) {
      readOnlyBinaryProperty(this, 'rawInfo', rawInfo)
    } else {
      readOnlyProperty(this, 'rawInfo', undefined)
    }

    Object.setPrototypeOf(this, EncryptedDataKey.prototype)
    Object.freeze(this)
  }