Forum Discussion
xmoncomble
Jan 04, 2021Copper Contributor
Register a virtual printer : parameter certificateSigningRequest
on my web application, I would like to https://docs.microsoft.com/fr-fr/graph/api/printer-create?view=graph-rest-beta (https://docs.microsoft.com/fr-fr/graph/universal-print-concept-overview part Ext...
mwetzko
Jan 25, 2021Copper Contributor
You can do that with dotnet:
// dotnet 5.0
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(2048);
CertificateRequest certificateRequest = new CertificateRequest("CN=My Name", rsa, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
certificateRequest.CertificateExtensions.Add(new X509KeyUsageExtension(X509KeyUsageFlags.DigitalSignature, false));
var Content = Convert.ToBase64String(certificateRequest.CreateSigningRequest());
var TransportKey = Convert.ToBase64String(rsa.ExportRSAPublicKey());
Of course: the usings on top and the code inside some method.