Aminopeptidase that plays a central role in peptide trimming, a step required for the generation of most HLA class I-binding peptides. Peptide trimming is essential to customize longer precursor peptides to fit them to the correct length required for presentation on MHC class I molecules. Preferentially hydrolyzes the basic residues Arg and Lys. {ECO:0000269|PubMed:12799365, ECO:0000269|PubMed:15908954, ECO:0000269|PubMed:16286653}. This is the function of ENSG00000164308 (ERAP2, endoplasmic reticulum aminopeptidase 2).