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

c++ - Do gcc's __float128 floating point numbers take the current rounding mode into account? -

java - the value of local variable is not used -