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

Struct Certificate

common.go:1346–1366  ·  view source on GitHub ↗

A Certificate is a chain of one or more certificates, leaf first.

Source from the content-addressed store, hash-verified

1344
1345// A Certificate is a chain of one or more certificates, leaf first.
1346type Certificate struct {
1347 Certificate [][]byte
1348 // PrivateKey contains the private key corresponding to the public key in
1349 // Leaf. This must implement crypto.Signer with an RSA, ECDSA or Ed25519 PublicKey.
1350 // For a server up to TLS 1.2, it can also implement crypto.Decrypter with
1351 // an RSA PublicKey.
1352 PrivateKey crypto.PrivateKey
1353 // SupportedSignatureAlgorithms is an optional list restricting what
1354 // signature algorithms the PrivateKey can be used for.
1355 SupportedSignatureAlgorithms []SignatureScheme
1356 // OCSPStaple contains an optional OCSP response which will be served
1357 // to clients that request it.
1358 OCSPStaple []byte
1359 // SignedCertificateTimestamps contains an optional list of Signed
1360 // Certificate Timestamps which will be served to clients that request it.
1361 SignedCertificateTimestamps [][]byte
1362 // Leaf is the parsed form of the leaf certificate, which may be initialized
1363 // using x509.ParseCertificate to reduce per-handshake processing. If nil,
1364 // the leaf certificate will be parsed as needed.
1365 Leaf *x509.Certificate
1366}
1367
1368// leaf returns the parsed leaf certificate, either from c.Leaf or by parsing
1369// the corresponding c.Certificate[0].

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected