RSA PrivateKeyFromBytes does not load the new private key values, whereas PublicKeyFromBytes works fine
B4X:
Public MyPublicRSAKeyAsBytes() As Byte, MyPrivateRSAKeyAsBytes() As Byte
Private ForeignKPG, OwnKPG As KeyPairGenerator
Sub GenerateOWNRSAKeys
' C.Initialize("RSA/ECB/PKCS1Padding")
OwnKPG.Initialize("RSA", 2048)
OwnKPG.GenerateKey
MyPrivateRSAKeyAsBytes=OwnKPG.PrivateKeyToBytes
MyPublicRSAKeyAsBytes=OwnKPG.PublicKeyToBytes
'Key load TEST
OwnKPG.Initialize("RSA", 2048)
OwnKPG.PrivateKeyFromBytes(MyPrivateRSAKeyAsBytes)
MyPrivateRSAKeyAsBytes = OwnKPG.PrivateKey ' <--- Error (Key = NULL)'
End Sub