Source file src/crypto/tls/common_string.go

     1  // Code generated by "stringer -linecomment -type=SignatureScheme,CurveID,ClientAuthType -output=common_string.go"; DO NOT EDIT.
     2  
     3  package tls
     4  
     5  import "strconv"
     6  
     7  func _() {
     8  	// An "invalid array index" compiler error signifies that the constant values have changed.
     9  	// Re-run the stringer command to generate them again.
    10  	var x [1]struct{}
    11  	_ = x[PKCS1WithSHA256-1025]
    12  	_ = x[PKCS1WithSHA384-1281]
    13  	_ = x[PKCS1WithSHA512-1537]
    14  	_ = x[PSSWithSHA256-2052]
    15  	_ = x[PSSWithSHA384-2053]
    16  	_ = x[PSSWithSHA512-2054]
    17  	_ = x[ECDSAWithP256AndSHA256-1027]
    18  	_ = x[ECDSAWithP384AndSHA384-1283]
    19  	_ = x[ECDSAWithP521AndSHA512-1539]
    20  	_ = x[Ed25519-2055]
    21  	_ = x[MLDSA44-2308]
    22  	_ = x[MLDSA65-2309]
    23  	_ = x[MLDSA87-2310]
    24  	_ = x[PKCS1WithSHA1-513]
    25  	_ = x[ECDSAWithSHA1-515]
    26  }
    27  
    28  const (
    29  	_SignatureScheme_name_0 = "PKCS1WithSHA1"
    30  	_SignatureScheme_name_1 = "ECDSAWithSHA1"
    31  	_SignatureScheme_name_2 = "PKCS1WithSHA256"
    32  	_SignatureScheme_name_3 = "ECDSAWithP256AndSHA256"
    33  	_SignatureScheme_name_4 = "PKCS1WithSHA384"
    34  	_SignatureScheme_name_5 = "ECDSAWithP384AndSHA384"
    35  	_SignatureScheme_name_6 = "PKCS1WithSHA512"
    36  	_SignatureScheme_name_7 = "ECDSAWithP521AndSHA512"
    37  	_SignatureScheme_name_8 = "PSSWithSHA256PSSWithSHA384PSSWithSHA512Ed25519"
    38  	_SignatureScheme_name_9 = "MLDSA44MLDSA65MLDSA87"
    39  )
    40  
    41  var (
    42  	_SignatureScheme_index_8 = [...]uint8{0, 13, 26, 39, 46}
    43  	_SignatureScheme_index_9 = [...]uint8{0, 7, 14, 21}
    44  )
    45  
    46  func (i SignatureScheme) String() string {
    47  	switch {
    48  	case i == 513:
    49  		return _SignatureScheme_name_0
    50  	case i == 515:
    51  		return _SignatureScheme_name_1
    52  	case i == 1025:
    53  		return _SignatureScheme_name_2
    54  	case i == 1027:
    55  		return _SignatureScheme_name_3
    56  	case i == 1281:
    57  		return _SignatureScheme_name_4
    58  	case i == 1283:
    59  		return _SignatureScheme_name_5
    60  	case i == 1537:
    61  		return _SignatureScheme_name_6
    62  	case i == 1539:
    63  		return _SignatureScheme_name_7
    64  	case 2052 <= i && i <= 2055:
    65  		i -= 2052
    66  		return _SignatureScheme_name_8[_SignatureScheme_index_8[i]:_SignatureScheme_index_8[i+1]]
    67  	case 2308 <= i && i <= 2310:
    68  		i -= 2308
    69  		return _SignatureScheme_name_9[_SignatureScheme_index_9[i]:_SignatureScheme_index_9[i+1]]
    70  	default:
    71  		return "SignatureScheme(" + strconv.FormatInt(int64(i), 10) + ")"
    72  	}
    73  }
    74  func _() {
    75  	// An "invalid array index" compiler error signifies that the constant values have changed.
    76  	// Re-run the stringer command to generate them again.
    77  	var x [1]struct{}
    78  	_ = x[CurveP256-23]
    79  	_ = x[CurveP384-24]
    80  	_ = x[CurveP521-25]
    81  	_ = x[X25519-29]
    82  	_ = x[X25519MLKEM768-4588]
    83  	_ = x[SecP256r1MLKEM768-4587]
    84  	_ = x[SecP384r1MLKEM1024-4589]
    85  	_ = x[MLKEM1024-514]
    86  }
    87  
    88  const (
    89  	_CurveID_name_0 = "CurveP256CurveP384CurveP521"
    90  	_CurveID_name_1 = "X25519"
    91  	_CurveID_name_2 = "MLKEM1024"
    92  	_CurveID_name_3 = "SecP256r1MLKEM768X25519MLKEM768SecP384r1MLKEM1024"
    93  )
    94  
    95  var (
    96  	_CurveID_index_0 = [...]uint8{0, 9, 18, 27}
    97  	_CurveID_index_3 = [...]uint8{0, 17, 31, 49}
    98  )
    99  
   100  func (i CurveID) String() string {
   101  	switch {
   102  	case 23 <= i && i <= 25:
   103  		i -= 23
   104  		return _CurveID_name_0[_CurveID_index_0[i]:_CurveID_index_0[i+1]]
   105  	case i == 29:
   106  		return _CurveID_name_1
   107  	case i == 514:
   108  		return _CurveID_name_2
   109  	case 4587 <= i && i <= 4589:
   110  		i -= 4587
   111  		return _CurveID_name_3[_CurveID_index_3[i]:_CurveID_index_3[i+1]]
   112  	default:
   113  		return "CurveID(" + strconv.FormatInt(int64(i), 10) + ")"
   114  	}
   115  }
   116  func _() {
   117  	// An "invalid array index" compiler error signifies that the constant values have changed.
   118  	// Re-run the stringer command to generate them again.
   119  	var x [1]struct{}
   120  	_ = x[NoClientCert-0]
   121  	_ = x[RequestClientCert-1]
   122  	_ = x[RequireAnyClientCert-2]
   123  	_ = x[VerifyClientCertIfGiven-3]
   124  	_ = x[RequireAndVerifyClientCert-4]
   125  }
   126  
   127  const _ClientAuthType_name = "NoClientCertRequestClientCertRequireAnyClientCertVerifyClientCertIfGivenRequireAndVerifyClientCert"
   128  
   129  var _ClientAuthType_index = [...]uint8{0, 12, 29, 49, 72, 98}
   130  
   131  func (i ClientAuthType) String() string {
   132  	idx := int(i) - 0
   133  	if i < 0 || idx >= len(_ClientAuthType_index)-1 {
   134  		return "ClientAuthType(" + strconv.FormatInt(int64(i), 10) + ")"
   135  	}
   136  	return _ClientAuthType_name[_ClientAuthType_index[idx]:_ClientAuthType_index[idx+1]]
   137  }
   138  

View as plain text