@SuppressWarnings("UnusedException")
  private static AesCtrHmacStreamingKey parseKey(
      ProtoKeySerialization serialization, @Nullable SecretKeyAccess access)
      throws GeneralSecurityException {
    if (!serialization.getTypeUrl().equals(TYPE_URL)) {
      throw new IllegalArgumentException(
          "Wrong type URL in call to AesCtrHmacStreamingParameters.parseParameters");
    }
    try {
      com.google.crypto.tink.proto.AesCtrHmacStreamingKey protoKey =
          com.google.crypto.tink.proto.AesCtrHmacStreamingKey.parseFrom(
              serialization.getValue(), ExtensionRegistryLite.getEmptyRegistry());
      if (protoKey.getVersion() != 0) {
        throw new GeneralSecurityException("Only version 0 keys are accepted");
      }
      AesCtrHmacStreamingParameters parameters =
          toParametersObject(protoKey.getParams(), protoKey.getKeyValue().size());
      return AesCtrHmacStreamingKey.create(
          parameters,
          SecretBytes.copyFrom(
              protoKey.getKeyValue().toByteArray(), SecretKeyAccess.requireAccess(access)));
    } catch (InvalidProtocolBufferException e) {
      throw new GeneralSecurityException("Parsing AesCtrHmacStreamingKey failed");
    }
  }
Methods to serialize and parse {@link AesCtrHmacStreamingKey} objects and {@link
AesCtrHmacStreamingParameters} objects
java_src/src/main/java/com/google/crypto/tink/streamingaead/internal/AesCtrHmacStreamingProtoSerialization.java