android - Convert Key object to PrivateKey -


i need use following method keystore class:

public key getprivatekey(string alias)

but on end need privatekey object, not key. how can convert key object privatekey? thanks!

after key key key store create key pair , pub , priv key pair key following:

key prvkey = keystore.getkey(_alias,_keypass.tochararray()); publickey pubkey = certificate.getpublickey(); keypair keypair = new keypair(pubkey, (privatekey)prvkey); privatekey privkewy = keypair.getprivate(); 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -