code: func (s *MSPMessageCryptoService) GetPKIidOfCert(peerIdentity api.PeerIdentityType) common.PKIidType {
  	// Validate arguments
  	if len(peerIdentity) == 0 {
  		mcsLogger.Error("Invalid Peer Identity. It must be different from nil.")
  
  		return nil
  	}
  
  	sid, err := s.deserializer.Deserialize(peerIdentity)
  	if err != nil {
  		mcsLogger.Errorf("Failed getting validated identity from peer identity [% x]: [%s]", peerIdentity, err)
  
  		return nil
  	}
  
  	// concatenate msp-id and idbytes
  	// idbytes is the low-level representation of an identity.
  	// it is supposed to be already in its minimal representation
  
  	mspIdRaw := []byte(sid.Mspid)
  	raw := append(mspIdRaw, sid.IdBytes...)
  
  	// Hash
  	digest, err := factory.GetDefault().Hash(raw, &bccsp.SHA256Opts{})
  	if err != nil {
  		mcsLogger.Errorf("Failed computing digest of serialized identity [% x]: [%s]", peerIdentity, err)
  
  		return nil
  	}
  
  	return digest
  }
docs: // GetPKIidOfCert returns the PKI-ID of a peer's identity
  // If any error occurs, the method return nil
  // The PKid of a peer is computed as the SHA2-256 of peerIdentity which
  // is supposed to be the serialized version of MSP identity.
  // This method does not validate peerIdentity.
  // This validation is supposed to be done appropriately during the execution flow.