public List<String> getExtensionOIds() {
        return getExtensions()
                .map(extensions -> Arrays.stream(extensions.getExtensionOIDs())
                        .map(ASN1ObjectIdentifier::getId)
                        .toList())
                .orElse(List.of());

    }
@Test
    void can_read_extensions() {
        X500Principal subject = new X500Principal("CN=subject");
        KeyPair keypair = KeyUtils.generateKeypair(KeyAlgorithm.EC, 256);
        Pkcs10Csr csr = Pkcs10CsrBuilder.fromKeypair(subject, keypair, SignatureAlgorithm.SHA512_WITH_ECDSA)
                .addSubjectAlternativeName("san")
                .setBasicConstraints(true, true)
                .build();
        List<String> expected = List.of(Extension.BASIC_CONSTRAINTS.getOId(), Extension.SUBJECT_ALTERNATIVE_NAMES.getOId());
        List<String> actual = csr.getExtensionOIds();
        assertEquals(expected, actual);
    }