Do anyone know how to export an ECPublicKeyParameters object and more importantly IMPORT a #ECDH Pubkey back in to a ECPublicKeyParameters object, in any way from #Bouncycastle?
I've successfully exported pubkeys to Bigints, Byte arrays/Base64 and some weird Pubkeydata string that begins with #0300(...), but i've not seen a way to import it back in to a ECPublicKeyParameters object.
1. I've tried reading it back in through SubjectPublicKeyInfo(which gives some weird unspecific error)
2. Tried PublicKeyFactory.Create() but that only ends up as an AsymmetricKeyParameter which isn't helpful.
3. I've tried SubjectPublicKeyInfoFactory but that is only an information class for the public key that can't be passed back to the keypair object.
4. I've tried looking for properties to assign, like .Pubkey and .Q but all of them are readonly and the ones that isn't implicitly readonly are unilateral and can't be assigned anything.
5. I've been thinking of tearing my hair off, but i don't have that much left so - bad idea
There is no intellsense popping up in Visual Studio (just shows the function name and parameter types) and i haven't found much documentation (as in close to none) on #ECDH for #BouncyCastle and the code samples i found on stack etc are for ancient versions of BC and does not apply - or even answer this question.
#Curve25519 est une courbe elliptique offrant 128 bits de sécurité et conçue pour être utilisée par le protocole d'échange de clés #DiffieHellman basé sur les courbes elliptiques ( #ECDH ). C'est une courbe elliptique permettant des performances très élevées, n'étant protégée par aucun #brevet connu et moins impactée par les générateurs de #nombres pseudo-aléatoires défaillants.
#curve25519 #diffiehellman #ecdh #brevet #nombres #mathématiques #chiffrement