Register a virtual printer : parameter certificateSigningRequest

New Contributor

on my web application, I would like to Register one or more virtual printers (https://docs.microsoft.com/fr-fr/graph/universal-print-concept-overview part Extending Universal Print to support pull printing) with the API print/printers/create but I need to add on the body the certificateSigningRequest parameter and i don't understand how to do that

HOW to generate the content and transportKey ?

 

 

 

 

 

2 Replies

@xmoncomble 

 

Please take a look at the following article and let us know if you need more information:

OEM Universal Print printer registration - Universal Print | Microsoft Docs

@xmoncomble 

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.