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
Post a Comment