The is missing the following:
private Object writeReplace() throws java.io.ObjectStreamException {
return new KeyRep(KeyRep.Type.PUBLIC, getAlgorithm(), getFormat(), getEncoded());
}
That all the other Public keys have.
Also, change getCause is not getting anything for exceptions through from the JNI.
Additionally the PQC tests can have the JRE target removed from the tests. Given that our tests are maintained for each branch no need to designate some of them running on 17 and higher. The following lines could be removed in the PQC tests on Java 21 and higher:
@EnabledForJreRange(min = JRE.JAVA_17)