Example #1
0
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     SetContentView(Resource.Layout.activity_main);
     encrypt_edit         = FindViewById <EditText>(Resource.Id.encrypt_edit);
     encrypt              = FindViewById <Button>(Resource.Id.encrypt_button);
     decrypt              = FindViewById <Button>(Resource.Id.decrypt_button);
     encryptText          = FindViewById <TextView>(Resource.Id.encrypt_text);
     decryptText          = FindViewById <TextView>(Resource.Id.decrypt_text);
     encrypt.Click       += Encrypt_Click;
     decrypt.Click       += Decrypt_Click;
     stringToEncrypt      = encrypt_edit.Text.ToString();
     _encryptionKeyHelper = new PlatformEncryptionKeyHelper(Application.Context, "AndroidKeyStore");
     _encryptionKeyHelper.CreateKeyPair();
     _privateKey = _encryptionKeyHelper.GetPrivateKey();
     _publicKey  = _encryptionKeyHelper.GetPublicKey();
 }
        private void ExecuteCapsCommand()
        {
            if (caps == false)
            {
                caps         = true;
                CapsEnabled  = true;
                CapsDisabled = false;

                Akey = Akey.ToUpper();
                Bkey = Bkey.ToUpper();
                Ckey = Ckey.ToUpper();
                Dkey = Dkey.ToUpper();
                Ekey = Ekey.ToUpper();
                Fkey = Fkey.ToUpper();
                Gkey = Gkey.ToUpper();
                Hkey = Hkey.ToUpper();
                Ikey = Ikey.ToUpper();
                Jkey = Jkey.ToUpper();
                Kkey = Kkey.ToUpper();
                Lkey = Lkey.ToUpper();
                Mkey = Mkey.ToUpper();
                Nkey = Nkey.ToUpper();
                Okey = Okey.ToUpper();
                Pkey = Pkey.ToUpper();
                Qkey = Qkey.ToUpper();
                Rkey = Rkey.ToUpper();
                Skey = Skey.ToUpper();
                Tkey = Tkey.ToUpper();
                Vkey = Vkey.ToUpper();
                Ukey = Ukey.ToUpper();
                Wkey = Wkey.ToUpper();
                Xkey = Xkey.ToUpper();
                Ykey = Ykey.ToUpper();
                Zkey = Zkey.ToUpper();
            }
            else
            {
                caps         = false;
                CapsEnabled  = false;
                CapsDisabled = true;
                Akey         = Akey.ToLower();
                Bkey         = Bkey.ToLower();
                Ckey         = Ckey.ToLower();
                Dkey         = Dkey.ToLower();
                Ekey         = Ekey.ToLower();
                Fkey         = Fkey.ToLower();
                Gkey         = Gkey.ToLower();
                Hkey         = Hkey.ToLower();
                Ikey         = Ikey.ToLower();
                Jkey         = Jkey.ToLower();
                Kkey         = Kkey.ToLower();
                Lkey         = Lkey.ToLower();
                Mkey         = Mkey.ToLower();
                Nkey         = Nkey.ToLower();
                Okey         = Okey.ToLower();
                Pkey         = Pkey.ToLower();
                Qkey         = Qkey.ToLower();
                Rkey         = Rkey.ToLower();
                Skey         = Skey.ToLower();
                Tkey         = Tkey.ToLower();
                Vkey         = Vkey.ToLower();
                Ukey         = Ukey.ToLower();
                Wkey         = Wkey.ToLower();
                Xkey         = Xkey.ToLower();
                Ykey         = Ykey.ToLower();
                Zkey         = Zkey.ToLower();
            }
        }
Example #3
0
 public Key(Ikey k)
 {
     Ikey = k;
 }
Example #4
0
 public KeyContext(Ikey key)
 {
     _key = key;
 }