code: func (pc *PeerCertificate) UnmarshalJSON(b []byte) error {
  	var buf []byte
  	if err := json.Unmarshal(b, &buf); err != nil {
  		return err
  	}
  	derBytes, _ := pem.Decode(buf)
  	c, err := x509.ParseCertificate(derBytes.Bytes)
  	if err != nil {
  		return err
  	}
  	*pc = PeerCertificate(*c)
  	return nil
  }
docs: // UnmarshalJSON populates a new PeerCertificate struct from JSON data.