I am working on a client server based application.
Where I get PublicKey in this format
as I saved it into String.
Now I want to use this key in my Android(Java code), how can I use this ?
I am working on a client server based application.
Where I get PublicKey in this format
as I saved it into String.
Now I want to use this key in my Android(Java code), how can I use this ?
First you need to generate the public key from the pem format you provided, here is my method for doing this:
And here is how I use it to read (decode) the content signed with the public key provided.
There is a project called "bouncycastle" we use it on j2me but it woll work on android too. it can be used to handle openssl certificates.
bouncycastle.org
Java KeyStore implementation:
import java.security.cert.Certificate import java.security.KeyStore
and readme a LOT because openssl keys are not directly supported by java which is bringing their own mechanisms.
Java example for KeyStore stuff: