Standard library / crypto/tls

tls.CipherSuiteName()

Looks up the standard cipher-suite name; unknown identifiers receive a hexadecimal fallback. A known name is not proof of security. Expected stdout: 'TLS_AES_128_GCM_SHA256\n'.

Formal Syntax & Structure

go syntaxgo
func CipherSuiteName(id uint16) string

Parameters & Attributes

NameTypeDescription
iduint16Numeric IANA cipher suite identifier.

Return Value

string

Result of the operation; handle any returned error before using other results.

Working Example

Example Snippetgo
package main
import (  "crypto/tls"  "fmt")
func main() { fmt.Println(tls.CipherSuiteName(tls.TLS_AES_128_GCM_SHA256)) }
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference