This work investigates the use of self-supervised learning for ECG-based affective computing. We propose a novel self-supervised ECG representation learning framework to address the limitations of fully-supervised learning. Our proposed framework is developed using four popular ECG-affect datasets that contain a wide variety of emotional attributes such as arousal, valence, stress, and others, collected in different experimental settings. Our proposed solution achieves promising results and sets new state-of-the-art in classifying affect in all four datasets. We present interesting insights regarding our proposed framework and analyze the relationship between the self-supervised tasks and emotion recognition. Further, we explore the concept of self-supervised affective computing and utilize the framework in an applied setting. To this end, we collect ECG and affect data from medical practitioners during a trauma simulation study, and utilize our proposed self-supervised framework for classification of cognitive load and levels of expertise, achieving great results and outperform fully supervised solutions.