亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? satsamidlet.java

?? Mobile Phone JSR 177 midlet example
?? JAVA
字號:
//Copyright 2005 Nokia Corporation.
//
// THIS SOURCE CODE IS PROVIDED 'AS IS', WITH NO WARRANTIES WHATSOEVER,
// EXPRESS OR IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY, FITNESS
// FOR ANY PARTICULAR PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE
// OR TRADE PRACTICE, RELATING TO THE SOURCE CODE OR ANY WARRANTY OTHERWISE
// ARISING OUT OF ANY PROPOSAL, SPECIFICATION, OR SAMPLE AND WITH NO
// OBLIGATION OF NOKIA TO PROVIDE THE LICENSEE WITH ANY MAINTENANCE OR
// SUPPORT. FURTHERMORE, NOKIA MAKES NO WARRANTY THAT EXERCISE OF THE
// RIGHTS GRANTED HEREUNDER DOES NOT INFRINGE OR MAY NOT CAUSE INFRINGEMENT
// OF ANY PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS OWNED OR CONTROLLED
// BY THIRD PARTIES
//
// Furthermore, information provided in this source code is preliminary,
// and may be changed substantially prior to final release. Nokia Corporation
// retains the right to make changes to this source code at
// any time, without notice. This source code is provided for informational
// purposes only.
//
// Nokia and Nokia Connecting People are registered trademarks of Nokia
// Corporation.
// Java and all Java-based marks are trademarks or registered trademarks of
// Sun Microsystems, Inc.
// Other product and company names mentioned herein may be trademarks or
// trade names of their respective owners.
//
// A non-exclusive, non-transferable, worldwide, limited license is hereby
// granted to the Licensee to download, print, reproduce and modify the
// source code. The licensee has the right to market, sell, distribute and
// make available the source code in original or modified form only when
// incorporated into the programs developed by the Licensee. No other
// license, express or implied, by estoppel or otherwise, to any other
// intellectual property rights is granted herein.

package satsa;

import java.security.GeneralSecurityException;
import javax.crypto.BadPaddingException;
import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

// Main SATSA MIDlet class
// It controls the state of the user interface
// and handles the encryption and decryption process
public class SATSAMIDlet extends MIDlet {
  private Display display;    
  private MessageStore messageStore;
  private ListScreen listScreen;
  private EncryptScreen encryptScreen;
  private PasswordScreen passwordScreen;
  private DecryptScreen decryptScreen;
  private InfoScreen infoScreen;
  private NewScreen newScreen;
  private Codec codec;

  public SATSAMIDlet() {}

  protected void destroyApp(boolean unconditional)
    throws MIDletStateChangeException
  {
    exitMIDlet();
  }

  protected void pauseApp()
  {
  }

  protected void startApp()
    throws MIDletStateChangeException
  {
    if (display == null)
    {
      initMIDlet();
    }
  }

  // Initialize all the internal fields
  private void initMIDlet()
  {
    // Init the user interface
    display = Display.getDisplay(this);
    listScreen = new ListScreen(this);
    encryptScreen = new EncryptScreen(this);
    passwordScreen = new PasswordScreen(this);
    decryptScreen = new DecryptScreen(this);
    infoScreen = new InfoScreen();
    newScreen = new NewScreen(this);
    
    // Initialize the Cryptographic Codec and the message store
    codec = new Codec(this);
    messageStore = new MessageStore(this);
    
    // Startup the UI
    showMessageList();
  }

  // Shows the list of existing messages
  void showMessageList()
  {
    messageStore.fillList(listScreen);
    display.setCurrent(listScreen);
  }

  // Shows an encrypted message in HEX format
  void showEncryptedMessage(int index)
  {
    encryptScreen.setIndex(index);
    encryptScreen.setMessage(codec
        .byteToHex(messageStore.getMessage(index+1)));
    display.setCurrent(encryptScreen);
  }

  // Displays the password screen
  void showPasswordScreen(int index)
  {
    passwordScreen.setIndex(index);
    display.setCurrent(passwordScreen);
  }

  // Shows a decrypted messages
  void showDecryptedMessage(int index, String password)
  {
    // 128bit (16 characters) key is needed for AES
    // just fill with blanks if too short
    while (password.length() <16 )
    {
      password = password.concat(" ");
    }
    decryptScreen.setIndex(index);
    byte message[] = messageStore.getMessage(index+1);
    // Do the decryption and validation in a separate thread
    new Thread(new CryptoRunnable(message,
        password.getBytes(),
        false)).start();
  }

  // Display an error message
  void showError(String messageString)
  {
    infoScreen.showError(messageString, Display.getDisplay(this));
  }

  // Delete a message
  void deleteMessage(int index)
  {
    messageStore.deleteMessage(index+1);
    messageStore.fillList(listScreen);
  }

  // Shows the new message
  void showNewMessage()
  {
    newScreen.createForm();
    display.setCurrent(newScreen);
  }

  // adds a new message encrypting it an storing in the record store
  void addNewMessage(String message, String password)
  {
    // 128bit (16 characters) key is needed for AES
    // just fill with blanks if too short
    while (password.length() <16 )
    {
      password = password.concat(" ");
    }
    // Do the encryption in a separate thread
    new Thread(new CryptoRunnable(message.getBytes(),
        password.getBytes(),
        true)).start();      
  }

  void exitMIDlet()
  {
    if (messageStore != null) {
  	messageStore.close();
    }   
    notifyDestroyed();
  }
  
  // Internal class to handle the decryption and encryption
  // process in a separate thread as recommended in SATSA-CRYPTO
  private class CryptoRunnable implements Runnable {
    private byte[] message, password;
    private boolean encryption;
    
    CryptoRunnable(byte[] message, byte[] password, boolean encryption) {
      this.message = message;
      this.password = password;
      this.encryption = encryption;
    }
    
    public void run() {
      if (encryption) {
        try
        {
          // Encrypt the message
          byte[] encryptedMessage = codec.encrypt(password, message);
          // Calculate the digest of the encrypted message
          byte[] digest = codec.digest(encryptedMessage);
          // Compose the overall message
          byte[] messageBytes = 
            new byte[encryptedMessage.length + digest.length];
          System.arraycopy(digest, 0, messageBytes, 0, digest.length);
          System.arraycopy(encryptedMessage,
              0,
              messageBytes,
              digest.length,
              encryptedMessage.length);
          // Store the encoded message
          messageStore.addMessage(messageBytes);
        }
        catch (GeneralSecurityException gse)
        {
          // Use of generic Exception type since mutiple
          // exceptions may be thrown at this point
          showError("General Security Exception while encrypting: "
              + gse.toString());
        }
        showMessageList();
      } else {
        try
        {
          // Get the cipher text and the digest
          // SHA-1 digest is 160 bits long
          byte[] digest = new byte[20];
          byte[] cipherText = new byte[message.length-digest.length];
          // Decompose the message
          System.arraycopy(message, 0, digest, 0, digest.length);
          System.arraycopy(message,
              digest.length,
              cipherText,
              0,
              cipherText.length);
          
          // Verify the cipher's text digest
          if (codec.isDigestValid(cipherText, digest)) {
            // If digest is ok, let's decrypt
            byte[] plainText = codec.decrypt(password, cipherText);        
             
            // Display the message on screen
            decryptScreen.setMessage(new String(plainText));
            display.setCurrent(decryptScreen);
          } else {
            showError("Digest of message is not valid");
          }            
        }
        catch (BadPaddingException bpe)
        {
          // This is a particular exception when the password is incorrect
          showError("Incorrect password.");
        }
        catch (GeneralSecurityException gse)
        {
          // Handles all other exceptions
          showError("General Security Exception while decrypting: "
              + gse.toString());
        }
      }
    }
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩精品电影| 欧美一二三四在线| 久久综合久色欧美综合狠狠| 日韩电影在线看| 欧美videos大乳护士334| 国产一区在线观看麻豆| 中文字幕国产精品一区二区| 色综合网色综合| 日本va欧美va欧美va精品| 精品99999| 91在线观看免费视频| 亚洲h在线观看| 精品成人私密视频| av影院午夜一区| 午夜精品免费在线| 日韩免费福利电影在线观看| 国产激情精品久久久第一区二区| 国产精品女主播在线观看| 欧洲人成人精品| 国产专区综合网| 一区二区三区欧美日| 日韩女优毛片在线| 99国产精品久久久久久久久久久 | 日韩精品欧美精品| 久久这里只有精品视频网| 成人h动漫精品| 三级影片在线观看欧美日韩一区二区 | 99国产精品久久久| 亚洲一区在线电影| 欧美羞羞免费网站| 视频一区二区国产| 欧美国产日韩亚洲一区| 成人黄色777网| 亚洲大片免费看| 一区二区中文字幕在线| 精品女同一区二区| 欧美亚洲动漫另类| 久久色视频免费观看| 亚洲综合一二三区| 亚洲成va人在线观看| 91麻豆精品国产91久久久久久| 国内成人精品2018免费看| 一区二区三区不卡视频在线观看| 欧美一级理论性理论a| 一道本成人在线| 粉嫩嫩av羞羞动漫久久久 | 菠萝蜜视频在线观看一区| 日韩国产欧美一区二区三区| 亚洲欧美色一区| 亚洲国产精品av| 久久女同精品一区二区| 欧美r级在线观看| 欧美一区二区三区在线| 97se亚洲国产综合自在线| 午夜成人免费视频| 国产69精品久久久久777| 中文字幕+乱码+中文字幕一区| 欧美一区二区三区公司| 欧美午夜不卡视频| 欧美在线视频不卡| 欧美日韩免费高清一区色橹橹 | 美脚の诱脚舐め脚责91| 中文字幕+乱码+中文字幕一区| 国产自产视频一区二区三区| 蜜臀av在线播放一区二区三区| 亚洲成人动漫av| 日韩精品视频网| 麻豆一区二区99久久久久| 蜜臀久久久久久久| 欧美精品日日鲁夜夜添| 自拍偷自拍亚洲精品播放| 国产精品色哟哟网站| 久久久国产午夜精品| 日本一区二区免费在线| 国产精品美女久久久久aⅴ| 国产精品九色蝌蚪自拍| 亚洲免费在线视频一区 二区| 国产精品国产三级国产三级人妇| 中文一区二区在线观看| 中文字幕在线不卡视频| 亚洲欧美日韩在线| 日本三级韩国三级欧美三级| 免费久久99精品国产| 国产自产视频一区二区三区| 国产高清在线观看免费不卡| 成人app下载| 欧美系列日韩一区| 精品国产乱码久久| 国产欧美日韩麻豆91| 亚洲精品少妇30p| 美女脱光内衣内裤视频久久网站| 国产麻豆精品theporn| 99国内精品久久| 欧美一区二区在线观看| 国产午夜精品一区二区三区视频 | 波多野结衣的一区二区三区| 色吊一区二区三区| 91精品综合久久久久久| 日本一区二区不卡视频| 秋霞国产午夜精品免费视频| 91视频在线观看| 国产福利不卡视频| 欧美性受极品xxxx喷水| 精品国产伦一区二区三区观看方式| 欧美国产一区在线| 日日摸夜夜添夜夜添国产精品| 日韩国产高清影视| 99re热这里只有精品视频| 日韩欧美aaaaaa| 一区二区三区在线免费观看| 精油按摩中文字幕久久| 色偷偷久久一区二区三区| 精品久久一二三区| 亚洲成av人影院| 99久久精品国产精品久久| 精品免费视频一区二区| 亚洲小说春色综合另类电影| 国产a精品视频| 欧美精品一区二区在线观看| 天天综合网 天天综合色| 91在线视频官网| 国产欧美精品国产国产专区| 蓝色福利精品导航| 正在播放一区二区| 亚洲与欧洲av电影| 91在线免费视频观看| 久久网这里都是精品| 久久不见久久见中文字幕免费| 欧美少妇一区二区| 亚洲午夜羞羞片| 91蝌蚪porny| 最近中文字幕一区二区三区| 国产福利不卡视频| 国产日韩精品一区二区三区在线| 久草这里只有精品视频| 精品毛片乱码1区2区3区| 六月丁香婷婷色狠狠久久| 日韩欧美色综合网站| 麻豆极品一区二区三区| 欧美mv日韩mv国产| 国产呦精品一区二区三区网站| 久久青草欧美一区二区三区| 国产成人精品网址| 国产精品久久久久久久岛一牛影视| 成人精品国产一区二区4080| 国产精品久久久久影院| 一本色道**综合亚洲精品蜜桃冫| 一区二区三区四区精品在线视频| 91国偷自产一区二区三区观看 | 欧美性受xxxx黑人xyx性爽| 一区二区三区高清| 6080yy午夜一二三区久久| 日本午夜一区二区| 久久理论电影网| 91在线视频网址| 欧美三级在线看| 欧美日韩一二区| 欧美性大战xxxxx久久久| 日韩一区二区视频在线观看| 日韩国产在线观看| 日韩一区二区三区精品视频| 午夜精品一区在线观看| 色婷婷综合视频在线观看| 亚洲电影在线播放| 欧美变态tickling挠脚心| 国产乱子伦视频一区二区三区| 中文字幕电影一区| 91黄色在线观看| 精品一区二区在线看| 中文av字幕一区| 欧美日韩一区二区三区四区| 美腿丝袜亚洲三区| 中文一区二区在线观看| 欧美亚洲动漫制服丝袜| 激情综合网av| 亚洲精品一二三| 欧美日韩国产片| 日韩精品三区四区| 亚洲综合一区在线| a在线播放不卡| 欧美a一区二区| 亚洲欧洲美洲综合色网| 日韩三级电影网址| 91视频在线观看免费| 狠狠色丁香久久婷婷综合丁香| 亚洲欧洲色图综合| 欧美成人国产一区二区| 91麻豆免费看片| 国产精品一级在线| 蜜臀久久99精品久久久久久9| 中文字幕在线免费不卡| 日韩欧美资源站| 欧美伊人久久大香线蕉综合69 | 视频一区欧美日韩| 国产精品毛片高清在线完整版 | 日韩欧美不卡在线观看视频| 91国内精品野花午夜精品| 久久精品国产亚洲a| 亚洲欧美日韩综合aⅴ视频| 久久久久国产精品麻豆|