Hello guys i am stuck at an issue please
help me
for the biometric authentication in my app, from front-end i am getting public key, signature.
for generating key pair, front end using this library β [react-native-biometrics - npm]
and this algorithms β Algorithmic used by above library
example
like i am getting following public key and signature form front end
public_key : MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsdBu6w2Var6TJHT8TQ1WdDpMu4VzSrDRP8DjY0WI9ddZvQSvjTdUQ9qm3fyZufZpmhPXfjkmg+f/cbJh+m+Zzhf093bcqVVnmEl+an/FTPMaOy2jfYNbxwZDuYCUxJzewGDa74vXCYB2sPgqZikf3UlhI0ZPO8tbdhleGoiQXOcXloAELQ+ebQ6MDBr+QDqNedPW+hLultTClH56v88Tp85PT6HWnPjVQUAWR7QeL+U8mFZOQALBruQvqfB3BwromhTkTB5XtCy1WCGBtzs21CTok4+pWp5QM/E3IUv1B8dtZDqjMIyGhUnM7pFmgL58UYV1unhyMH/cM+ffzlJWIQIDAQAB
Signature : it is encryption of text = "1675256878678"
DQ6vLV4cRAMcCkpT0MTMHPUc8IoMvcckhjY9Fyirq/zX1Ej851g+IojotyPMqSFKbRqrpE3F2OTI717fcAxFRMCFYlcuf1mYjniCJtGTkxTE6m6GNy+ApX5ssUSb3pZajXcLw/YnKvnbiYtsnL0mFgZ27krrp8ZxEf9iDFBJRZW7JVxjaeGqe5jIN64+NODgR+OvMvHPLpNjKIrZleXwQwbOpWE1q9EIhWmApc2bDdUFeaa5RtGOLI9WNkitkhW/Dsk5FNiZOW7oo85IE65cMJ09XTKHCUmYQnhwtdKibKK84koKXELvBat9/aWe+GBdQJQa6mNFfEPnvcmpXDu3tQ==
in the backend i am using elixir ExPublicKey
so the issue that, the public key i am getting from the front end is not getting load as
the public key object type
, something like that
{:ok, public_key} = ExPublicKey.loads(public_key)
iex(64)> ExPublicKey.loads(public_key)
{:error, "invalid argument"}
the desired results should be like this
iex(67)> {:ok, public_key} = ExPublicKey.loads(public_key)
{:ok, #ExPublicKey.RSAPublicKey<
fingerprint_sha256= bc
31
a4
6b
51
67
68
b2
63
60
66
73
39
ad
c8
66
1e
07
9d
0c
02
e6
31
23
16
9d
a3
78
4a
04
ef
e8>}
{ok, "1675256878678"} = ExPublicKey.decrypt_public(params.signature, public_key, [])
Help me out here. or any alternative solution in elixir for the above encryption/decryption