private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException {
        stream.defaultReadObject();

        byte[] encoded = (byte[]) stream.readObject();

        try {
            key = new OpenSSLKey(NativeCrypto.EVP_parse_public_key(encoded));
        } catch (ParsingException e) {
            throw new IOException(e);
        }
        group = new OpenSSLECGroupContext(new NativeRef.EC_GROUP(
                NativeCrypto.EC_KEY_get1_group(key.getNativeRef())));
    }
An implementation of a {@link java.security.PublicKey} for EC keys based on BoringSSL.
common/src/main/java/org/conscrypt/OpenSSLECPublicKey.java