Exemplo n.º 1
0
        public RSAParameters GetPrivateKey()
        {
            ISharedPreferences        prefs   = PreferenceManager.GetDefaultSharedPreferences(mContext);
            string                    priv    = prefs.GetString(KeysPriv, "");
            RSAParametersSerializable rsaPriv = JsonConvert.DeserializeObject <RSAParametersSerializable>(priv);

            return(rsaPriv.RSAParameters);
        }
Exemplo n.º 2
0
        public RSAParametersSerializable GetPublicKey()
        {
            ISharedPreferences        prefs  = PreferenceManager.GetDefaultSharedPreferences(mContext);
            string                    pub    = prefs.GetString(KeysPub, "");
            RSAParametersSerializable rsaPub = JsonConvert.DeserializeObject <RSAParametersSerializable>(pub);

            return(rsaPub);
        }
Exemplo n.º 3
0
        public void SavePcPublicKey(RSAParameters pubKey)
        {
            RSAParametersSerializable rsaPub = new RSAParametersSerializable(pubKey);
            string                   pub     = JsonConvert.SerializeObject(rsaPub);
            ISharedPreferences       prefs   = PreferenceManager.GetDefaultSharedPreferences(mContext);
            ISharedPreferencesEditor editor  = prefs.Edit();

            editor.PutString(KeycPub, pub);
            editor.Apply();
        }
Exemplo n.º 4
0
        public void SavePairKey(RSAParameters pub, RSAParameters priv)
        {
            RSAParametersSerializable rsaPub = new RSAParametersSerializable(pub);
            string pubstr = JsonConvert.SerializeObject(rsaPub);
            RSAParametersSerializable rsaPriv = new RSAParametersSerializable(priv);
            string                   privstr  = JsonConvert.SerializeObject(rsaPriv);
            ISharedPreferences       prefs    = PreferenceManager.GetDefaultSharedPreferences(mContext);
            ISharedPreferencesEditor editor   = prefs.Edit();

            editor.PutString(KeysPub, pubstr);
            editor.PutString(KeysPriv, privstr);
            editor.Apply();
        }
Exemplo n.º 5
0
 public QrCodeObject(long nonce, RSAParametersSerializable kcpub, byte[] kd)
 {
     Nonce = nonce;
     KcPub = kcpub;
     Kd    = kd;
 }