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
certificateRequestContextbyte[]supportedSignatureAlgorithmsIList<SignatureAndHashAlgorithm>supportedSignatureAlgorithmsCertIList<SignatureAndHashAlgorithm>certificateAuthoritiesIList<X509Name>
Exceptions
CertificateRequest(short[], IList<SignatureAndHashAlgorithm>, IList<X509Name>)
public CertificateRequest(short[] certificateTypes, IList<SignatureAndHashAlgorithm> supportedSignatureAlgorithms, IList<X509Name> certificateAuthorities)
Parameters
certificateTypesshort[]see ClientCertificateType for valid constants.
supportedSignatureAlgorithmsIList<SignatureAndHashAlgorithm>certificateAuthoritiesIList<X509Name>
Properties
CertificateAuthorities
public IList<X509Name> CertificateAuthorities { get; }
Property Value
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
contextTlsContextthe TlsContext of the current connection.
outputStreamthe Stream to encode to.
Exceptions
GetCertificateRequestContext()
public byte[] GetCertificateRequestContext()
Returns
- byte[]
HasCertificateRequestContext(byte[])
public bool HasCertificateRequestContext(byte[] certificateRequestContext)
Parameters
certificateRequestContextbyte[]
Returns
Parse(TlsContext, Stream)
Parse a CertificateRequest from a Stream
public static CertificateRequest Parse(TlsContext context, Stream input)
Parameters
contextTlsContextthe TlsContext of the current connection.
inputStreamthe Stream to parse from.
Returns
- CertificateRequest
a CertificateRequest object.