MCPcopy Create free account
hub / github.com/XTLS/Go / marshal

Method marshal

handshake_messages.go:1298–1320  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1296}
1297
1298func (m *certificateMsgTLS13) marshal() []byte {
1299 if m.raw != nil {
1300 return m.raw
1301 }
1302
1303 var b cryptobyte.Builder
1304 b.AddUint8(typeCertificate)
1305 b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) {
1306 b.AddUint8(0) // certificate_request_context
1307
1308 certificate := m.certificate
1309 if !m.ocspStapling {
1310 certificate.OCSPStaple = nil
1311 }
1312 if !m.scts {
1313 certificate.SignedCertificateTimestamps = nil
1314 }
1315 marshalCertificate(b, certificate)
1316 })
1317
1318 m.raw = b.BytesOrPanic()
1319 return m.raw
1320}
1321
1322func marshalCertificate(b *cryptobyte.Builder, certificate Certificate) {
1323 b.AddUint24LengthPrefixed(func(b *cryptobyte.Builder) {

Callers

nothing calls this directly

Calls 1

marshalCertificateFunction · 0.85

Tested by

no test coverage detected