private void writeObject(ObjectOutputStream stream) throws IOException {
        if (key.isHardwareBacked()) {
            throw new NotSerializableException("Hardware backed keys cannot be serialized");
        }
        stream.defaultWriteObject();
        stream.writeObject(getEncoded());
    }
An implementation of a {@link java.security.PublicKey} for EC keys based on BoringSSL.
common/src/main/java/org/conscrypt/OpenSSLECPublicKey.java