Standard library / crypto/x509

crypto/x509.PEMCipher

Legacy RFC 1423 PEM encryption is unauthenticated and susceptible to padding-oracle attacks. Do not use for new key storage. Selects the legacy encryption cipher; do not infer security from AES key size. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
type PEMCipher int

Working Example

Example Snippetgo
package main
import (  "crypto/x509"  "fmt")
func main() {  // Historical interoperability demonstration only. Prefer modern protocols for new designs.  var c x509.PEMCipher = x509.PEMCipherAES256  fmt.Println(c == x509.PEMCipherAES256)}
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