Hi all,
I'm newbie with MAUI. I've a test app developed with MAUI to write/read values via OPC (PLC Enviroment).
If I test the app with emulator everything works good.
If I test the app on the phisical device (android phone) I get this exception (below)
{System.NotSupportedException: Creating X509Certificate from PKCS #12 store failed
---> System.PlatformNotSupportedException: The PKCS#12 PersistKeySet flag is not supported on this platform.
at Internal.Cryptography.Pal.AndroidCertificatePal.FromBlob(ReadOnlySpan
1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags) at Internal.Cryptography.Pal.CertificatePal.FromBlob(ReadOnlySpan
1 rawData, SafePasswordHandle password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)
at System.Security.Cryptography.X509Certificates.X509Certificate2..ctor(Byte[] rawData, String password, X509KeyStorageFlags keyStorageFlags)
at CertificateFactory.a(Byte[] a, String b, Nullable
1 c) at CertificateFactory.CreateCertificateFromPKCS12(Byte[] rawData, String password) --- End of inner exception stack trace --- at CertificateFactory.CreateCertificateFromPKCS12(Byte[] rawData, String password) at CertificateFactory.a(X509Certificate a, String b, AsymmetricKeyParameter c, SecureRandom d) at CertificateFactory.CreateCertificate(String storeType, String storePath, String password, String applicationUri, String applicationName, String subjectName, IList
1 domainNames, UInt16 keySize, DateTime startTime, UInt16 lifetimeInMonths, UInt16 hashSizeInBits, Boolean isCA, X509Certificate2 issuerCAKeyCert, Byte[] publicKey)
at Opc.UaFx.OpcCertificateManager.CreateCertificate(OpcCertificateSettings settings, OpcCertificateStoreInfo store)
at Opc.UaFx.OpcCertificateManager.CreateCertificate(IOpcApplicationInstance instance, OpcCertificateStoreInfo store)
at Opc.UaFx.OpcCertificateStores.a()
at Opc.UaFx.OpcCertificateStores.a()
at Opc.UaFx.OpcApplicationInstance`2[[Opc.UaFx.OpcTransport, Opc.UaFx.Client, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0220af0d33d50236],[Opc.UaFx.Client.OpcClientSecurity, Opc.UaFx.Client, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0220af0d33d50236]].Setup(OpcApplicationConfiguration configuration)
at Opc.UaFx.Client.OpcClient.Connect()
I'm too newbie to understand if this is a problem of Android configuration, app issue or (my nightmare) opcfx trouble.
I've surfed on the net but I found answers too much different
So, I'm here to ask you if someone can help me to understand this issue so I could solve it.
Dario
If I test the app on the physical device (android phone) I get this exception (below)
Do you debug it in your physical device? Is device native android OS?
You can try to use other devices that install native android OS to make a test.