All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.venafi.vcert.sdk.certificate.EllipticCurve Maven / Gradle / Ivy

Go to download

VCert is a Java library, SDK, designed to simplify key generation and enrollment of machine identities (also known as SSL/TLS certificates and keys) that comply with enterprise security policy by using the Venafi Platform or Venafi Cloud.

There is a newer version: 0.9.3
Show newest version
package com.venafi.vcert.sdk.certificate;

import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import lombok.Getter;

public enum EllipticCurve {
  EllipticCurveP224("P224", "P-224"),
  EllipticCurveP256("P256", "P-256"),
  EllipticCurveP384("P384", "P-384"),
  EllipticCurveP521("P521", "P-521");

  @Getter
  private final String value;

  @Getter
  private final String bcName;

  EllipticCurve(String value, String bcName) {
    this.value = value;
    this.bcName = bcName;
  }

  private static Map LOOKUP = new HashMap<>(EllipticCurve.values().length);

  static {
    for (EllipticCurve curve : EllipticCurve.values()) {
      LOOKUP.put(curve.value().toLowerCase(), curve);
    }
  }

  public static EllipticCurve from(String value) {
    if (LOOKUP.containsKey(value.toLowerCase())) {
      return LOOKUP.get(value.toLowerCase());
    }
    return ellipticCurveDefault();
  }

  public static EllipticCurve ellipticCurveDefault() {
    return EllipticCurveP521;
  }

  public static List allSupportedCures() {
    return Arrays.asList(EllipticCurve.values());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy