private static JwtEcdsaParameters.Algorithm toAlgorithm(JwtEcdsaAlgorithm algorithm)
      throws GeneralSecurityException {
    switch (algorithm) {
      case ES256:
        return JwtEcdsaParameters.Algorithm.ES256;
      case ES384:
        return JwtEcdsaParameters.Algorithm.ES384;
      case ES512:
        return JwtEcdsaParameters.Algorithm.ES512;
      default:
        throw new GeneralSecurityException("Unable to parse algorithm: " + algorithm.getNumber());
    }
  }
Methods to serialize and parse {@link JwtEcdsaPrivateKey}, {@link JwtEcdsaPublicKey}, and {@link
JwtEcdsaParameters} objects.
java_src/src/main/java/com/google/crypto/tink/jwt/JwtEcdsaProtoSerialization.java