def METHOD_NAME(self, mapping: Mapping[str, Any]) -> Mapping[str, Any]:
    encrypted_mapping: Dict[str, Any] = {}
    for secret_or_identity, credentials_component in mapping.items():
        if credentials_component is None:
            encrypted_component = None
        else:
            encrypted_component = {
                key: self._repository_encryptor.encrypt(value.encode())
                if value is not None
                else value
                for key, value in credentials_component.items()
            }
        encrypted_mapping[secret_or_identity] = encrypted_component
    return encrypted_mapping