package Ġcom . my ether wallet . me w connect . core . utils . crypto . keystore Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . security . keystore . Key Gen Parameter Spec Ċ import Ġandroid . security . keystore . Key Properties Ċ import Ġjava . security . KeyPair Generator Ċ import Ġjavax . crypto . Cipher Ċ Ċ /** Ċ Ġ* ĠCreated Ġby ĠB Art Well Ġon Ġ 0 7 . 0 5 . 2 0 1 9 . Ċ Ġ*/ Ċ Ċ abstract Ġclass ĠBase R sa Ke yst ore Helper ( context : ĠContext ) Ġ: ĠBase Ke yst ore Helper ( context ) Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Keys () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġkey Pair Generator Ġ= ĠKey Pair Generator . getInstance ( Key Properties . KEY _ ALGORITHM _ RSA , Ġget Provider ()) ĊĠĠĠĠĠĠĠ Ġval Ġspec Ġ= ĠgetKey Gen Parameter Spec ( Key Gen Parameter Spec . Builder ( get Alias (), ĠKey Properties . P URPOSE _ ENCRYPT Ġor ĠKey Properties . P URPOSE _ DE CRYPT )) ĊĠĠĠĠĠĠĠ Ġkey Pair Generator . initialize ( spec ) ĊĠĠĠĠĠĠĠ Ġkey Pair Generator . generate KeyPair () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Decrypt Cipher (): ĠCipher Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġkey Ġ= Ġkey Store . getKey ( get Alias (), Ġnull ) ĊĠĠĠĠĠĠĠ Ġval Ġcipher Ġ= ĠCipher . getInstance ( get Transformation ()) ĊĠĠĠĠĠĠĠ Ġcipher . init ( Cipher . DE CRYPT _ MODE , Ġkey ) ĊĠĠĠĠĠĠĠ Ġreturn Ġcipher ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġabstract Ġfun ĠgetKey Gen Parameter Spec ( builder : ĠKey Gen Parameter Spec . Builder ): ĠKey Gen Parameter Spec Ċ }