Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Copyright 2021 - Haga Rakotoharivelo - https://github.com/haga-rak

using System;
using System.Linq;
using Org.BouncyCastle.Tls;
using Org.BouncyCastle.Tls.Crypto;
using Org.BouncyCastle.Tls.Crypto.Impl.BC;
Expand Down Expand Up @@ -27,12 +29,15 @@ public void NotifyServerCertificate(TlsServerCertificate serverCertificate)
public TlsCredentials? GetClientCredentials(CertificateRequest certificateRequest)
{
if (_clientCertificateInfo != null) {
var context = certificateRequest.GetCertificateRequestContext();

var signatureAndHashAlgorithm = TlsUtilities.ChooseSignatureAndHashAlgorithm(_tlsCrypto.Context,
certificateRequest.SupportedSignatureAlgorithms, SignatureAlgorithm.rsa);

var config = BouncyCastleClientCertificateConfiguration.CreateFrom(certificateRequest, _tlsCrypto,
var signatureAndHashAlgorithm = TlsUtilities
.ChooseSignatureAndHashAlgorithm(_tlsCrypto.Context,
certificateRequest.SupportedSignatureAlgorithms,
certificateRequest.SupportedSignatureAlgorithms
.First()
.Hash
);

var config = BouncyCastleClientCertificateConfiguration.CreateFrom(certificateRequest, _tlsCrypto,
_clientCertificateInfo);

var cryptoParameters = new TlsCryptoParameters(_tlsCrypto.Context);
Expand Down