-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Ciao,
ho generato un certificato usando la documentazione a corredo del PDND (https://docs.pagopa.it/interoperabilita-1/manuale-operativo/client-e-materiale-crittografico#generare-il-materiale-crittografico).
Per poter leggere la chiave primaria (il file PEM generato) nel tuo codice, ho dovuto modificare la funzione GetSecurityParameters in questo modo:
private RSAParameters GetSecurityParameters(string keyPath)
{
RSAParameters rsaParams;
using (var tr = new StringReader(File.ReadAllText(keyPath).Trim()))
{
var pemReader = new PemReader(tr);
var keyPair = pemReader.ReadObject() as RsaPrivateCrtKeyParameters;
if (keyPair == null)
{
throw new Exception("Could not read RSA private key");
}
rsaParams = DotNetUtilities.ToRSAParameters(keyPair);
}
return rsaParams;
}
ti torna questa modifica?
grazie
Metadata
Metadata
Assignees
Labels
No labels