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

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -