public static StreamingAead create(LegacyProtoKey key) throws GeneralSecurityException {
    /* Here we don't check that the key is RAW since, for legacy reasons,
     * StreamingAeadWrapper / KeyTypeManager don't. */
    ProtoKeySerialization protoKeySerialization =
        key.getSerialization(InsecureSecretKeyAccess.get());
    KeyData keyData =
        KeyData.newBuilder()
            .setTypeUrl(protoKeySerialization.getTypeUrl())
            .setValue(protoKeySerialization.getValue())
            .setKeyMaterialType(protoKeySerialization.getKeyMaterialType())
            .build();
    return new LegacyFullStreamingAead(Registry.getPrimitive(keyData, StreamingAead.class));
  }
Covers the cases where users created their own streaming AEAD / key classes.
java_src/src/main/java/com/google/crypto/tink/streamingaead/internal/LegacyFullStreamingAead.java