Table of Contents

Class CertificateRequest

Namespace
Org.BouncyCastle.Tls
Assembly
BouncyCastle.Cryptography.dll

Parsing and encoding of a CertificateRequest struct from RFC 4346.

public sealed class CertificateRequest
Inheritance
CertificateRequest
Inherited Members

Remarks

struct {
  ClientCertificateType certificate_types<1..2^8-1>;
  DistinguishedName certificate_authorities<3..2^16-1>;
} CertificateRequest;

Updated for RFC 5246:

struct {
  ClientCertificateType certificate_types <1..2 ^ 8 - 1>;
  SignatureAndHashAlgorithm supported_signature_algorithms <2 ^ 16 - 1>;
  DistinguishedName certificate_authorities <0..2 ^ 16 - 1>;
} CertificateRequest;

Revised for RFC 8446:

struct {
  opaque certificate_request_context <0..2 ^ 8 - 1>;
  Extension extensions <2..2 ^ 16 - 1>;
} CertificateRequest;

Constructors

CertificateRequest(byte[], IList<SignatureAndHashAlgorithm>, IList<SignatureAndHashAlgorithm>, IList<X509Name>)

public CertificateRequest(byte[] certificateRequestContext, IList<SignatureAndHashAlgorithm> supportedSignatureAlgorithms, IList<SignatureAndHashAlgorithm> supportedSignatureAlgorithmsCert, IList<X509Name> certificateAuthorities)

Parameters

certificateRequestContext byte[]
supportedSignatureAlgorithms IList<SignatureAndHashAlgorithm>
supportedSignatureAlgorithmsCert IList<SignatureAndHashAlgorithm>
certificateAuthorities IList<X509Name>

Exceptions

IOException

CertificateRequest(short[], IList<SignatureAndHashAlgorithm>, IList<X509Name>)

public CertificateRequest(short[] certificateTypes, IList<SignatureAndHashAlgorithm> supportedSignatureAlgorithms, IList<X509Name> certificateAuthorities)

Parameters

certificateTypes short[]

see ClientCertificateType for valid constants.

supportedSignatureAlgorithms IList<SignatureAndHashAlgorithm>
certificateAuthorities IList<X509Name>

an IList<T> of X509Name.

Properties

CertificateAuthorities

public IList<X509Name> CertificateAuthorities { get; }

Property Value

IList<X509Name>

an IList<T> of X509Name.

CertificateTypes

public short[] CertificateTypes { get; }

Property Value

short[]

an array of certificate types

See Also

SupportedSignatureAlgorithms

public IList<SignatureAndHashAlgorithm> SupportedSignatureAlgorithms { get; }

Property Value

IList<SignatureAndHashAlgorithm>

an IList<T> of SignatureAndHashAlgorithm (or null before TLS 1.2).

SupportedSignatureAlgorithmsCert

public IList<SignatureAndHashAlgorithm> SupportedSignatureAlgorithmsCert { get; }

Property Value

IList<SignatureAndHashAlgorithm>

an optional IList<T> of SignatureAndHashAlgorithm. May be non-null from TLS 1.3 onwards.

Methods

Encode(TlsContext, Stream)

Encode this CertificateRequest to a Stream.

public void Encode(TlsContext context, Stream output)

Parameters

context TlsContext

the TlsContext of the current connection.

output Stream

the Stream to encode to.

Exceptions

IOException

GetCertificateRequestContext()

public byte[] GetCertificateRequestContext()

Returns

byte[]

HasCertificateRequestContext(byte[])

public bool HasCertificateRequestContext(byte[] certificateRequestContext)

Parameters

certificateRequestContext byte[]

Returns

bool

Parse(TlsContext, Stream)

Parse a CertificateRequest from a Stream

public static CertificateRequest Parse(TlsContext context, Stream input)

Parameters

context TlsContext

the TlsContext of the current connection.

input Stream

the Stream to parse from.

Returns

CertificateRequest

a CertificateRequest object.

Exceptions

IOException

See Also