@Test
public void testExtractX509CSRSubjectFieldNull() {

    PKCS10CertificationRequest certReq = mock(PKCS10CertificationRequest.class);
    when(certReq.getSubject()).thenReturn(null);
    assertNull(Crypto.extractX509CSRSubjectField(certReq, null));
    X500Name x500Name = mock(X500Name.class);
    when(certReq.getSubject()).thenReturn(x500Name);
    RDN[] rdns = new RDN[2];
    when(x500Name.getRDNs(null)).thenReturn(rdns);
    assertThrows(CryptoException.class, () -> {
        Crypto.extractX509CSRSubjectField(certReq, null);
    });
}