PublicKeyDetails.java

// Generated by the protocol buffer compiler.  DO NOT EDIT!
// NO CHECKED-IN PROTOBUF GENCODE
// source: sigstore_common.proto
// Protobuf Java Version: 4.30.2

package dev.sigstore.proto.common.v1;

/**
 * <pre>
 * Details of a specific public key, capturing the the key encoding method,
 * and signature algorithm.
 *
 * PublicKeyDetails captures the public key/hash algorithm combinations
 * recommended in the Sigstore ecosystem.
 *
 * This is modelled as a linear set as we want to provide a small number of
 * opinionated options instead of allowing every possible permutation.
 *
 * Any changes to this enum MUST be reflected in the algorithm registry.
 *
 * See: &lt;https://github.com/sigstore/architecture-docs/blob/main/algorithm-registry.md&gt;
 *
 * To avoid the possibility of contradicting formats such as PKCS1 with
 * ED25519 the valid permutations are listed as a linear set instead of a
 * cartesian set (i.e one combined variable instead of two, one for encoding
 * and one for the signature algorithm).
 * </pre>
 *
 * Protobuf enum {@code dev.sigstore.common.v1.PublicKeyDetails}
 */
@javax.annotation.Generated(value="protoc", comments="annotations:PublicKeyDetails.java.pb.meta")
public enum PublicKeyDetails
    implements com.google.protobuf.ProtocolMessageEnum {
  /**
   * <code>PUBLIC_KEY_DETAILS_UNSPECIFIED = 0;</code>
   */
  PUBLIC_KEY_DETAILS_UNSPECIFIED(0),
  /**
   * <pre>
   * RSA
   * </pre>
   *
   * <code>PKCS1_RSA_PKCS1V5 = 1 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  PKCS1_RSA_PKCS1V5(1),
  /**
   * <pre>
   * See RFC8017
   * </pre>
   *
   * <code>PKCS1_RSA_PSS = 2 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  PKCS1_RSA_PSS(2),
  /**
   * <code>PKIX_RSA_PKCS1V5 = 3 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  PKIX_RSA_PKCS1V5(3),
  /**
   * <code>PKIX_RSA_PSS = 4 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  PKIX_RSA_PSS(4),
  /**
   * <pre>
   * RSA public key in PKIX format, PKCS#1v1.5 signature
   * </pre>
   *
   * <code>PKIX_RSA_PKCS1V15_2048_SHA256 = 9;</code>
   */
  PKIX_RSA_PKCS1V15_2048_SHA256(9),
  /**
   * <code>PKIX_RSA_PKCS1V15_3072_SHA256 = 10;</code>
   */
  PKIX_RSA_PKCS1V15_3072_SHA256(10),
  /**
   * <code>PKIX_RSA_PKCS1V15_4096_SHA256 = 11;</code>
   */
  PKIX_RSA_PKCS1V15_4096_SHA256(11),
  /**
   * <pre>
   * RSA public key in PKIX format, RSASSA-PSS signature
   * </pre>
   *
   * <code>PKIX_RSA_PSS_2048_SHA256 = 16;</code>
   */
  PKIX_RSA_PSS_2048_SHA256(16),
  /**
   * <code>PKIX_RSA_PSS_3072_SHA256 = 17;</code>
   */
  PKIX_RSA_PSS_3072_SHA256(17),
  /**
   * <code>PKIX_RSA_PSS_4096_SHA256 = 18;</code>
   */
  PKIX_RSA_PSS_4096_SHA256(18),
  /**
   * <pre>
   * ECDSA
   * </pre>
   *
   * <code>PKIX_ECDSA_P256_HMAC_SHA_256 = 6 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  PKIX_ECDSA_P256_HMAC_SHA_256(6),
  /**
   * <pre>
   * See NIST FIPS 186-4
   * </pre>
   *
   * <code>PKIX_ECDSA_P256_SHA_256 = 5;</code>
   */
  PKIX_ECDSA_P256_SHA_256(5),
  /**
   * <code>PKIX_ECDSA_P384_SHA_384 = 12;</code>
   */
  PKIX_ECDSA_P384_SHA_384(12),
  /**
   * <code>PKIX_ECDSA_P521_SHA_512 = 13;</code>
   */
  PKIX_ECDSA_P521_SHA_512(13),
  /**
   * <pre>
   * Ed 25519
   * </pre>
   *
   * <code>PKIX_ED25519 = 7;</code>
   */
  PKIX_ED25519(7),
  /**
   * <code>PKIX_ED25519_PH = 8;</code>
   */
  PKIX_ED25519_PH(8),
  /**
   * <pre>
   * These algorithms are deprecated and should not be used, but they
   * were/are being used by most Sigstore clients implementations.
   * </pre>
   *
   * <code>PKIX_ECDSA_P384_SHA_256 = 19 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  PKIX_ECDSA_P384_SHA_256(19),
  /**
   * <code>PKIX_ECDSA_P521_SHA_256 = 20 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  PKIX_ECDSA_P521_SHA_256(20),
  /**
   * <pre>
   * LMS and LM-OTS
   *
   * These algorithms are deprecated and should not be used.
   * Keys and signatures MAY be used by private Sigstore
   * deployments, but will not be supported by the public
   * good instance.
   *
   * USER WARNING: LMS and LM-OTS are both stateful signature schemes.
   * Using them correctly requires discretion and careful consideration
   * to ensure that individual secret keys are not used more than once.
   * In addition, LM-OTS is a single-use scheme, meaning that it
   * MUST NOT be used for more than one signature per LM-OTS key.
   * If you cannot maintain these invariants, you MUST NOT use these
   * schemes.
   * </pre>
   *
   * <code>LMS_SHA256 = 14 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  LMS_SHA256(14),
  /**
   * <code>LMOTS_SHA256 = 15 [deprecated = true];</code>
   */
  @java.lang.Deprecated
  LMOTS_SHA256(15),
  /**
   * <pre>
   * ML-DSA
   *
   * These ML_DSA_65 and ML-DSA_87 algorithms are the pure variants that
   * take data to sign rather than the prehash variants (HashML-DSA), which
   * take digests.  While considered quantum-resistant, their usage
   * involves tradeoffs in that signatures and keys are much larger, and
   * this makes deployments more costly.
   *
   * USER WARNING: ML_DSA_65 and ML_DSA_87 are experimental algorithms.  
   * In the future they MAY be used by private Sigstore deployments, but
   * they are not yet fully functional.  This warning will be removed when 
   * these algorithms are widely supported by Sigstore clients and servers, 
   * but care should still be taken for production environments.
   * </pre>
   *
   * <code>ML_DSA_65 = 21;</code>
   */
  ML_DSA_65(21),
  /**
   * <code>ML_DSA_87 = 22;</code>
   */
  ML_DSA_87(22),
  UNRECOGNIZED(-1),
  ;

  static {
    com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion(
      com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC,
      /* major= */ 4,
      /* minor= */ 30,
      /* patch= */ 2,
      /* suffix= */ "",
      PublicKeyDetails.class.getName());
  }
  /**
   * <code>PUBLIC_KEY_DETAILS_UNSPECIFIED = 0;</code>
   */
  public static final int PUBLIC_KEY_DETAILS_UNSPECIFIED_VALUE = 0;
  /**
   * <pre>
   * RSA
   * </pre>
   *
   * <code>PKCS1_RSA_PKCS1V5 = 1 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int PKCS1_RSA_PKCS1V5_VALUE = 1;
  /**
   * <pre>
   * See RFC8017
   * </pre>
   *
   * <code>PKCS1_RSA_PSS = 2 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int PKCS1_RSA_PSS_VALUE = 2;
  /**
   * <code>PKIX_RSA_PKCS1V5 = 3 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int PKIX_RSA_PKCS1V5_VALUE = 3;
  /**
   * <code>PKIX_RSA_PSS = 4 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int PKIX_RSA_PSS_VALUE = 4;
  /**
   * <pre>
   * RSA public key in PKIX format, PKCS#1v1.5 signature
   * </pre>
   *
   * <code>PKIX_RSA_PKCS1V15_2048_SHA256 = 9;</code>
   */
  public static final int PKIX_RSA_PKCS1V15_2048_SHA256_VALUE = 9;
  /**
   * <code>PKIX_RSA_PKCS1V15_3072_SHA256 = 10;</code>
   */
  public static final int PKIX_RSA_PKCS1V15_3072_SHA256_VALUE = 10;
  /**
   * <code>PKIX_RSA_PKCS1V15_4096_SHA256 = 11;</code>
   */
  public static final int PKIX_RSA_PKCS1V15_4096_SHA256_VALUE = 11;
  /**
   * <pre>
   * RSA public key in PKIX format, RSASSA-PSS signature
   * </pre>
   *
   * <code>PKIX_RSA_PSS_2048_SHA256 = 16;</code>
   */
  public static final int PKIX_RSA_PSS_2048_SHA256_VALUE = 16;
  /**
   * <code>PKIX_RSA_PSS_3072_SHA256 = 17;</code>
   */
  public static final int PKIX_RSA_PSS_3072_SHA256_VALUE = 17;
  /**
   * <code>PKIX_RSA_PSS_4096_SHA256 = 18;</code>
   */
  public static final int PKIX_RSA_PSS_4096_SHA256_VALUE = 18;
  /**
   * <pre>
   * ECDSA
   * </pre>
   *
   * <code>PKIX_ECDSA_P256_HMAC_SHA_256 = 6 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int PKIX_ECDSA_P256_HMAC_SHA_256_VALUE = 6;
  /**
   * <pre>
   * See NIST FIPS 186-4
   * </pre>
   *
   * <code>PKIX_ECDSA_P256_SHA_256 = 5;</code>
   */
  public static final int PKIX_ECDSA_P256_SHA_256_VALUE = 5;
  /**
   * <code>PKIX_ECDSA_P384_SHA_384 = 12;</code>
   */
  public static final int PKIX_ECDSA_P384_SHA_384_VALUE = 12;
  /**
   * <code>PKIX_ECDSA_P521_SHA_512 = 13;</code>
   */
  public static final int PKIX_ECDSA_P521_SHA_512_VALUE = 13;
  /**
   * <pre>
   * Ed 25519
   * </pre>
   *
   * <code>PKIX_ED25519 = 7;</code>
   */
  public static final int PKIX_ED25519_VALUE = 7;
  /**
   * <code>PKIX_ED25519_PH = 8;</code>
   */
  public static final int PKIX_ED25519_PH_VALUE = 8;
  /**
   * <pre>
   * These algorithms are deprecated and should not be used, but they
   * were/are being used by most Sigstore clients implementations.
   * </pre>
   *
   * <code>PKIX_ECDSA_P384_SHA_256 = 19 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int PKIX_ECDSA_P384_SHA_256_VALUE = 19;
  /**
   * <code>PKIX_ECDSA_P521_SHA_256 = 20 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int PKIX_ECDSA_P521_SHA_256_VALUE = 20;
  /**
   * <pre>
   * LMS and LM-OTS
   *
   * These algorithms are deprecated and should not be used.
   * Keys and signatures MAY be used by private Sigstore
   * deployments, but will not be supported by the public
   * good instance.
   *
   * USER WARNING: LMS and LM-OTS are both stateful signature schemes.
   * Using them correctly requires discretion and careful consideration
   * to ensure that individual secret keys are not used more than once.
   * In addition, LM-OTS is a single-use scheme, meaning that it
   * MUST NOT be used for more than one signature per LM-OTS key.
   * If you cannot maintain these invariants, you MUST NOT use these
   * schemes.
   * </pre>
   *
   * <code>LMS_SHA256 = 14 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int LMS_SHA256_VALUE = 14;
  /**
   * <code>LMOTS_SHA256 = 15 [deprecated = true];</code>
   */
  @java.lang.Deprecated public static final int LMOTS_SHA256_VALUE = 15;
  /**
   * <pre>
   * ML-DSA
   *
   * These ML_DSA_65 and ML-DSA_87 algorithms are the pure variants that
   * take data to sign rather than the prehash variants (HashML-DSA), which
   * take digests.  While considered quantum-resistant, their usage
   * involves tradeoffs in that signatures and keys are much larger, and
   * this makes deployments more costly.
   *
   * USER WARNING: ML_DSA_65 and ML_DSA_87 are experimental algorithms.  
   * In the future they MAY be used by private Sigstore deployments, but
   * they are not yet fully functional.  This warning will be removed when 
   * these algorithms are widely supported by Sigstore clients and servers, 
   * but care should still be taken for production environments.
   * </pre>
   *
   * <code>ML_DSA_65 = 21;</code>
   */
  public static final int ML_DSA_65_VALUE = 21;
  /**
   * <code>ML_DSA_87 = 22;</code>
   */
  public static final int ML_DSA_87_VALUE = 22;


  public final int getNumber() {
    if (this == UNRECOGNIZED) {
      throw new java.lang.IllegalArgumentException(
          "Can't get the number of an unknown enum value.");
    }
    return value;
  }

  /**
   * @param value The numeric wire value of the corresponding enum entry.
   * @return The enum associated with the given numeric wire value.
   * @deprecated Use {@link #forNumber(int)} instead.
   */
  @java.lang.Deprecated
  public static PublicKeyDetails valueOf(int value) {
    return forNumber(value);
  }

  /**
   * @param value The numeric wire value of the corresponding enum entry.
   * @return The enum associated with the given numeric wire value.
   */
  public static PublicKeyDetails forNumber(int value) {
    switch (value) {
      case 0: return PUBLIC_KEY_DETAILS_UNSPECIFIED;
      case 1: return PKCS1_RSA_PKCS1V5;
      case 2: return PKCS1_RSA_PSS;
      case 3: return PKIX_RSA_PKCS1V5;
      case 4: return PKIX_RSA_PSS;
      case 9: return PKIX_RSA_PKCS1V15_2048_SHA256;
      case 10: return PKIX_RSA_PKCS1V15_3072_SHA256;
      case 11: return PKIX_RSA_PKCS1V15_4096_SHA256;
      case 16: return PKIX_RSA_PSS_2048_SHA256;
      case 17: return PKIX_RSA_PSS_3072_SHA256;
      case 18: return PKIX_RSA_PSS_4096_SHA256;
      case 6: return PKIX_ECDSA_P256_HMAC_SHA_256;
      case 5: return PKIX_ECDSA_P256_SHA_256;
      case 12: return PKIX_ECDSA_P384_SHA_384;
      case 13: return PKIX_ECDSA_P521_SHA_512;
      case 7: return PKIX_ED25519;
      case 8: return PKIX_ED25519_PH;
      case 19: return PKIX_ECDSA_P384_SHA_256;
      case 20: return PKIX_ECDSA_P521_SHA_256;
      case 14: return LMS_SHA256;
      case 15: return LMOTS_SHA256;
      case 21: return ML_DSA_65;
      case 22: return ML_DSA_87;
      default: return null;
    }
  }

  public static com.google.protobuf.Internal.EnumLiteMap<PublicKeyDetails>
      internalGetValueMap() {
    return internalValueMap;
  }
  private static final com.google.protobuf.Internal.EnumLiteMap<
      PublicKeyDetails> internalValueMap =
        new com.google.protobuf.Internal.EnumLiteMap<PublicKeyDetails>() {
          public PublicKeyDetails findValueByNumber(int number) {
            return PublicKeyDetails.forNumber(number);
          }
        };

  public final com.google.protobuf.Descriptors.EnumValueDescriptor
      getValueDescriptor() {
    if (this == UNRECOGNIZED) {
      throw new java.lang.IllegalStateException(
          "Can't get the descriptor of an unrecognized enum value.");
    }
    return getDescriptor().getValues().get(ordinal());
  }
  public final com.google.protobuf.Descriptors.EnumDescriptor
      getDescriptorForType() {
    return getDescriptor();
  }
  public static final com.google.protobuf.Descriptors.EnumDescriptor
      getDescriptor() {
    return dev.sigstore.proto.common.v1.CommonProto.getDescriptor().getEnumTypes().get(1);
  }

  private static final PublicKeyDetails[] VALUES = values();

  public static PublicKeyDetails valueOf(
      com.google.protobuf.Descriptors.EnumValueDescriptor desc) {
    if (desc.getType() != getDescriptor()) {
      throw new java.lang.IllegalArgumentException(
        "EnumValueDescriptor is not for this type.");
    }
    if (desc.getIndex() == -1) {
      return UNRECOGNIZED;
    }
    return VALUES[desc.getIndex()];
  }

  private final int value;

  private PublicKeyDetails(int value) {
    this.value = value;
  }

  // @@protoc_insertion_point(enum_scope:dev.sigstore.common.v1.PublicKeyDetails)
}