public List<SubjectAlternativeName> getSubjectAlternativeNames() {
        return getExtensions()
                .map(extensions -> GeneralNames.fromExtensions(extensions, Extension.subjectAlternativeName))
                .map(SubjectAlternativeName::fromGeneralNames)
                .orElse(List.of());
    }
@Test
    void can_read_subject_alternative_names() {
        X500Principal subject = new X500Principal("CN=subject");
        KeyPair keypair = KeyUtils.generateKeypair(KeyAlgorithm.EC, 256);
        SubjectAlternativeName san1 = new SubjectAlternativeName(DNS, "san1.com");
        SubjectAlternativeName san2 = new SubjectAlternativeName(DNS, "san2.com");
        Pkcs10Csr csr = Pkcs10CsrBuilder.fromKeypair(subject, keypair, SignatureAlgorithm.SHA512_WITH_ECDSA)
                .addSubjectAlternativeName(san1)
                .addSubjectAlternativeName(san2)
                .build();
        assertEquals(List.of(san1, san2), csr.getSubjectAlternativeNames());
    }