Hi,
I am using the reference implementation of Encrypt Decrypt C# implementation:
But it is throwing exception for a public key given by NDHM PHR app:
Exception:
at Org.BouncyCastle.Asn1.DefiniteLengthInputStream.ToArray()
at Org.BouncyCastle.Asn1.Asn1InputStream.CreatePrimitiveDerObject(Int32 tagNo, DefiniteLengthInputStream defIn, Byte[][] tmpBuffers)
at Org.BouncyCastle.Asn1.Asn1InputStream.BuildObject(Int32 tag, Int32 tagNo, Int32 length)
at Org.BouncyCastle.Asn1.Asn1InputStream.ReadObject()
at Org.BouncyCastle.Asn1.Asn1Object.FromByteArray(Byte[] data)
at Org.BouncyCastle.Security.PublicKeyFactory.CreateKey(Byte[] keyInfoData)
at In.ProjectEKA.HipService.EncryptionBit.EncrytorDemo.GetPublicKeyFrom(String publicKey) in
Below are an example public key and the algo details:
“cryptoAlg”: “ECDH”,
“curve”: “curve25519”,
“dhPublicKey”: {
“expiry”: “2020-11-07T13:15:33.501894”,
“parameters”: “Ephemeral public key”,
“keyValue”: “BH1zmG+pTHyoFPM5jOok6ZXeh58OnEtvvyiHY3d3TmqXWuChftXLD73Mi5sUvjJm+R91Yq2yNSj6x89PrSKtXI4=”
},
Please let me know if there is an update to the c# code.