code: def init(**config):
      
      global _implementation
      global _validate_implementations
  
      if config.get('crypto_backend') == 'gpg':
          _implementation = gpg
      else:
          _implementation = x509
  
      _validate_implementations = []
      for mod in config.get('crypto_validate_backends', []):
          if mod == 'gpg':
              _validate_implementations.append(gpg)
          elif mod == 'x509':
              _validate_implementations.append(x509)
          else:
              raise ValueError("%r is not a valid crypto backend" % mod)
  
      if not _validate_implementations:
          _validate_implementations.append(_implementation)
docs: Initialize the crypto backend.
  
      The backend can be one of two plugins:
  
          - 'x509' - Uses x509 certificates.
          - 'gpg' - Uses GnuPG keys.