Click or drag to resize
Pdftools logo

HttpClientHandlerSetClientCertificateAndKey Method

Set the SSL/TLS client certificate and private key

The file must contain the certificate and its private key. It is also recommended to include all certificates of the trust chain.

Namespace: PdfTools
Assembly: PdfTools (in PdfTools.dll) Version: 1.7.0+cfcc11b476b3e1eb4320f0f37269191f64e36bd8
Syntax
C#
public void SetClientCertificateAndKey(
	Stream cert,
	Stream key,
	string password
)

Parameters

cert  Stream
The certificate may be in either PEM (.pem, ASCII text) or DER (.cer, binary) form.
key  Stream
The encrypted private key of the certificate must be in PEM (ASCII text) form (.pem).
password  String
The password required to decrypt the private key.
Exceptions
ExceptionCondition
PasswordExceptionThe password is invalid.
CorruptExceptionThe certificate or key cannot be read.
ArgumentNullExceptionif cert is .
ArgumentNullExceptionif key is .
See Also