private static RSA BuildRsaPublicKey(byte[] encodedData) { RSA rsa = new RSAOpenSsl(); try { rsa.ImportRSAPublicKey(encodedData.AsSpan(), out _); } catch (Exception) { rsa.Dispose(); throw; } return(rsa); }