code: def _ScanEncryptedVolume(self, scan_context, scan_node):
      
      if not scan_node or not scan_node.path_spec:
        raise errors.ScannerError('Invalid or missing scan node.')
  
      credentials = credentials_manager.CredentialsManager.GetCredentials(
          scan_node.path_spec)
      if not credentials:
        raise errors.ScannerError('Missing credentials for scan node.')
  
      if not self._mediator:
        raise errors.ScannerError(
            'Unable to proceed. Encrypted volume found but no mediator to '
            'determine how it should be unlocked.')
  
      if self._mediator.UnlockEncryptedVolume(
          self._source_scanner, scan_context, scan_node, credentials):
        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:
        ScannerError: if the format of or within the source is not supported,
            the scan node is invalid, there are no credentials defined for
            the format or no mediator is provided and a locked scan node was
            found, e.g. an encrypted volume,