private static ProtoKeySerialization serializeKey(
      ChaCha20Poly1305Key key, @Nullable SecretKeyAccess access) throws GeneralSecurityException {
    return ProtoKeySerialization.create(
        TYPE_URL,
        com.google.crypto.tink.proto.ChaCha20Poly1305Key.newBuilder()
            .setKeyValue(
                ByteString.copyFrom(
                    key.getKeyBytes().toByteArray(SecretKeyAccess.requireAccess(access))))
            .build()
            .toByteString(),
        KeyMaterialType.SYMMETRIC,
        toProtoOutputPrefixType(key.getParameters().getVariant()),
        key.getIdRequirementOrNull());
  }
Parse LEGACY prefix to CRUNCHY, since they act the same for this type of key
java_src/src/main/java/com/google/crypto/tink/aead/internal/ChaCha20Poly1305ProtoSerialization.java