Register a virtual printer : parameter certificateSigningRequest

%3CLINGO-SUB%20id%3D%22lingo-sub-2029957%22%20slang%3D%22fr-FR%22%3ERegister%20a%20virtual%20printer%3A%20parameter%20certificateSigningRequest%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2029957%22%20slang%3D%22fr-FR%22%3E%3CP%3Eon%20my%20web%20application%2C%20I%20would%20like%20to%20%3CSPAN%20class%3D%22sxs-lookup%22%3E%3CSPAN%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Ffr-fr%2Fgraph%2Fapi%2Fprinter-create%3Fview%3Dgraph-rest-beta%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERegister%20one%20or%20more%20virtual%20printers%3C%2FA%3E%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Ffr-fr%2Fgraph%2Funiversal-print-concept-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E(https%3A%2F%2Fdocs.microsoft.com%2Ffr-fr%2Fgraph%2Funiversal-print-concept-overview%3C%2FA%3E%20part%20Extending%20Universal%20Print%20to%20support%20pull%20printing)%20with%20the%20API%20print%2Fprinters%2Fcreate%20but%20I%20need%20to%20add%20on%20the%20body%20the%20certificateSigningRequest%20parameter%20and%20i%20don't%20understand%20how%20to%20do%20that%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22sxs-lookup%22%3E%3CSPAN%3EHOW%20to%20generate%20the%20content%20and%20transportKey%3F%3CBR%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2084587%22%20slang%3D%22en-US%22%3ERe%3A%20Register%20a%20virtual%20printer%20%3A%20parameter%20certificateSigningRequest%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2084587%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F903578%22%20target%3D%22_blank%22%3E%40xmoncomble%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20take%20a%20look%20at%20the%20following%20article%20and%20let%20us%20know%20if%20you%20need%20more%20information%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Funiversal-print%2Fhardware%2Funiversal-print-oem-printer-registration%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EOEM%20Universal%20Print%20printer%20registration%20-%20Universal%20Print%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
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.