code: def bind(self, key, **prefs):
          
          hash_algo = prefs.pop('hash', None)
  
          if self.is_primary and not key.is_primary:
              sig_type = SignatureType.Subkey_Binding
  
          elif key.is_primary and not self.is_primary:
              sig_type = SignatureType.PrimaryKey_Binding
  
          else:  # pragma: no cover
              raise PGPError
  
          sig = PGPSignature.new(sig_type, self.key_algorithm, hash_algo, self.fingerprint.keyid)
  
          if sig_type == SignatureType.Subkey_Binding:
              # signature options that only make sense in subkey binding signatures
              usage = prefs.pop('usage', None)
  
              if usage is not None:
                  sig._signature.subpackets.addnew('KeyFlags', hashed=True, flags=usage)
  
              # if possible, have the subkey create a primary key binding signature
              if key.key_algorithm.can_sign:
                  subkeyid = key.fingerprint.keyid
                  esig = None
  
                  if not key.is_public:
                      esig = key.bind(self)
  
                  elif subkeyid in self.subkeys:  # pragma: no cover
                      esig = self.subkeys[subkeyid].bind(self)
  
                  if esig is not None:
                      sig._signature.subpackets.addnew('EmbeddedSignature', hashed=False, _sig=esig._signature)
  
          return self._sign(key, sig, **prefs)
docs: Bind a subkey to this key.
  
          Valid optional keyword arguments are identical to those of self-signatures for :py:meth:`PGPkey.certify`