Class Certificate
- Namespace
- Org.BouncyCastle.Tls
- Assembly
- BouncyCastle.Cryptography.dll
Parsing and encoding of a Certificate struct from RFC 4346.
public sealed class Certificate
- Inheritance
-
Certificate
- Inherited Members
Remarks
opaque ASN.1Cert<2^24-1>;
struct {
ASN.1Cert certificate_list<0..2^24-1>;
} Certificate;
Constructors
Certificate(TlsCertificate[])
public Certificate(TlsCertificate[] certificateList)
Parameters
certificateListTlsCertificate[]
Certificate(byte[], CertificateEntry[])
public Certificate(byte[] certificateRequestContext, CertificateEntry[] certificateEntryList)
Parameters
certificateRequestContextbyte[]certificateEntryListCertificateEntry[]
Certificate(short, byte[], CertificateEntry[])
public Certificate(short certificateType, byte[] certificateRequestContext, CertificateEntry[] certificateEntryList)
Parameters
certificateTypeshortcertificateRequestContextbyte[]certificateEntryListCertificateEntry[]
Fields
EmptyChain
public static readonly Certificate EmptyChain
Field Value
EmptyChainTls13
public static readonly Certificate EmptyChainTls13
Field Value
Properties
CertificateType
public short CertificateType { get; }
Property Value
IsEmpty
public bool IsEmpty { get; }
Property Value
- bool
trueif this certificate chain contains no certificates, orfalseotherwise.
Length
public int Length { get; }
Property Value
Methods
Encode(TlsContext, Stream, Stream)
Encode this Certificate to a Stream, and optionally calculate the "end point hash" (per RFC 5929's tls-server-end-point binding).
public void Encode(TlsContext context, Stream messageOutput, Stream endPointHashOutput)
Parameters
contextTlsContextthe TlsContext of the current connection.
messageOutputStreamthe Stream to encode to.
endPointHashOutputStreamthe Stream to write the "end point hash" to (or null).
Exceptions
GetCertificateAt(int)
public TlsCertificate GetCertificateAt(int index)
Parameters
indexint
Returns
GetCertificateEntryAt(int)
public CertificateEntry GetCertificateEntryAt(int index)
Parameters
indexint
Returns
GetCertificateEntryList()
public CertificateEntry[] GetCertificateEntryList()
Returns
GetCertificateList()
public TlsCertificate[] GetCertificateList()
Returns
- TlsCertificate[]
an array of TlsCertificate representing a certificate chain.
GetCertificateRequestContext()
public byte[] GetCertificateRequestContext()
Returns
- byte[]
Parse(ParseOptions, TlsContext, Stream, Stream)
Parse a Certificate from a Stream.
public static Certificate Parse(Certificate.ParseOptions options, TlsContext context, Stream messageInput, Stream endPointHashOutput)
Parameters
optionsCertificate.ParseOptionsthe Certificate.ParseOptions to apply during parsing.
contextTlsContextthe TlsContext of the current connection.
messageInputStreamthe Stream to parse from.
endPointHashOutputStreamthe Stream to write the "end point hash" to (or null).
Returns
- Certificate
a Certificate object.