net-core-push-notifications
net-core-push-notifications copied to clipboard
Firebase CryptographicException when deployed to production server (NOT Azure)
This works correctly locally. But when deployed - I received CryptographicException "The system cannot find the file specified.".
at System.Security.Cryptography.CngKey.Import(ReadOnlySpan`1 keyBlob, String curveName, CngKeyBlobFormat format, CngProvider provider)
at System.Security.Cryptography.CngPkcs8.ImportPkcs8(ReadOnlySpan`1 keyBlob)
at System.Security.Cryptography.CngPkcs8.ImportPkcs8PrivateKey(ReadOnlySpan`1 source, Int32& bytesRead)
at System.Security.Cryptography.RSACng.ImportPkcs8PrivateKey(ReadOnlySpan`1 source, Int32& bytesRead)
at System.Security.Cryptography.PemKeyHelpers.ImportPem(ReadOnlySpan`1 input, FindImportActionFunc callback)
at CorePush.Firebase.FirebaseSender.GetMasterToken()
at CorePush.Firebase.FirebaseSender.GetJwtTokenAsync()
at CorePush.Firebase.FirebaseSender.SendAsync(Object payload, CancellationToken cancellationToken)
Seems like RSACryptoServiceProvider should be used instead.