code: def _ScanEncryptedVolume(self, scan_context, scan_node):
      
      if not scan_node or not scan_node.path_spec:
        raise errors.SourceScannerError('Invalid or missing scan node.')
  
      credentials = credentials_manager.CredentialsManager.GetCredentials(
          scan_node.path_spec)
      if not credentials:
        raise errors.SourceScannerError('Missing credentials for scan node.')
  
      credentials_dict = {
          credential_type: credential_data
          for credential_type, credential_data in self._credentials}
  
      is_unlocked = False
      for credential_type in credentials.CREDENTIALS:
        credential_data = credentials_dict.get(credential_type, None)
        if not credential_data:
          continue
  
        is_unlocked = self._source_scanner.Unlock(
            scan_context, scan_node.path_spec, credential_type, credential_data)
        if is_unlocked:
          break
  
      if not is_unlocked:
        is_unlocked = self._PromptUserForEncryptedVolumeCredential(
            scan_context, scan_node, credentials)
  
      if is_unlocked:
        self._source_scanner.Scan(
            scan_context, scan_path_spec=scan_node.path_spec)
docs: Scans an encrypted volume scan node for volume and file systems.
  
      Args:
        scan_context (SourceScannerContext): source scanner context.
        scan_node (SourceScanNode): volume scan node.
  
      Raises:
        SourceScannerError: if the format of or within the source is not
            supported, the scan node is invalid or there are no credentials
            defined for the format.