...

Source file src/crypto/tls/common_string.go

Documentation: crypto/tls

		 1  // Code generated by "stringer -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[PKCS1WithSHA1-513]
		22  	_ = x[ECDSAWithSHA1-515]
		23  }
		24  
		25  const (
		26  	_SignatureScheme_name_0 = "PKCS1WithSHA1"
		27  	_SignatureScheme_name_1 = "ECDSAWithSHA1"
		28  	_SignatureScheme_name_2 = "PKCS1WithSHA256"
		29  	_SignatureScheme_name_3 = "ECDSAWithP256AndSHA256"
		30  	_SignatureScheme_name_4 = "PKCS1WithSHA384"
		31  	_SignatureScheme_name_5 = "ECDSAWithP384AndSHA384"
		32  	_SignatureScheme_name_6 = "PKCS1WithSHA512"
		33  	_SignatureScheme_name_7 = "ECDSAWithP521AndSHA512"
		34  	_SignatureScheme_name_8 = "PSSWithSHA256PSSWithSHA384PSSWithSHA512Ed25519"
		35  )
		36  
		37  var (
		38  	_SignatureScheme_index_8 = [...]uint8{0, 13, 26, 39, 46}
		39  )
		40  
		41  func (i SignatureScheme) String() string {
		42  	switch {
		43  	case i == 513:
		44  		return _SignatureScheme_name_0
		45  	case i == 515:
		46  		return _SignatureScheme_name_1
		47  	case i == 1025:
		48  		return _SignatureScheme_name_2
		49  	case i == 1027:
		50  		return _SignatureScheme_name_3
		51  	case i == 1281:
		52  		return _SignatureScheme_name_4
		53  	case i == 1283:
		54  		return _SignatureScheme_name_5
		55  	case i == 1537:
		56  		return _SignatureScheme_name_6
		57  	case i == 1539:
		58  		return _SignatureScheme_name_7
		59  	case 2052 <= i && i <= 2055:
		60  		i -= 2052
		61  		return _SignatureScheme_name_8[_SignatureScheme_index_8[i]:_SignatureScheme_index_8[i+1]]
		62  	default:
		63  		return "SignatureScheme(" + strconv.FormatInt(int64(i), 10) + ")"
		64  	}
		65  }
		66  func _() {
		67  	// An "invalid array index" compiler error signifies that the constant values have changed.
		68  	// Re-run the stringer command to generate them again.
		69  	var x [1]struct{}
		70  	_ = x[CurveP256-23]
		71  	_ = x[CurveP384-24]
		72  	_ = x[CurveP521-25]
		73  	_ = x[X25519-29]
		74  }
		75  
		76  const (
		77  	_CurveID_name_0 = "CurveP256CurveP384CurveP521"
		78  	_CurveID_name_1 = "X25519"
		79  )
		80  
		81  var (
		82  	_CurveID_index_0 = [...]uint8{0, 9, 18, 27}
		83  )
		84  
		85  func (i CurveID) String() string {
		86  	switch {
		87  	case 23 <= i && i <= 25:
		88  		i -= 23
		89  		return _CurveID_name_0[_CurveID_index_0[i]:_CurveID_index_0[i+1]]
		90  	case i == 29:
		91  		return _CurveID_name_1
		92  	default:
		93  		return "CurveID(" + strconv.FormatInt(int64(i), 10) + ")"
		94  	}
		95  }
		96  func _() {
		97  	// An "invalid array index" compiler error signifies that the constant values have changed.
		98  	// Re-run the stringer command to generate them again.
		99  	var x [1]struct{}
	 100  	_ = x[NoClientCert-0]
	 101  	_ = x[RequestClientCert-1]
	 102  	_ = x[RequireAnyClientCert-2]
	 103  	_ = x[VerifyClientCertIfGiven-3]
	 104  	_ = x[RequireAndVerifyClientCert-4]
	 105  }
	 106  
	 107  const _ClientAuthType_name = "NoClientCertRequestClientCertRequireAnyClientCertVerifyClientCertIfGivenRequireAndVerifyClientCert"
	 108  
	 109  var _ClientAuthType_index = [...]uint8{0, 12, 29, 49, 72, 98}
	 110  
	 111  func (i ClientAuthType) String() string {
	 112  	if i < 0 || i >= ClientAuthType(len(_ClientAuthType_index)-1) {
	 113  		return "ClientAuthType(" + strconv.FormatInt(int64(i), 10) + ")"
	 114  	}
	 115  	return _ClientAuthType_name[_ClientAuthType_index[i]:_ClientAuthType_index[i+1]]
	 116  }
	 117  

View as plain text