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

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

?? keymanager.java

?? 發送短信 接收短信 多種接口com/net/modem 開發庫
?? JAVA
字號:
// SMSLib for Java v3
// A Java API library for sending and receiving SMS via a GSM modem
// or other supported gateways.
// Web Site: http://www.smslib.org
//
// Copyright (C) 2002-2009, Thanasis Delenikas, Athens/GREECE.
// SMSLib is distributed under the terms of the Apache License version 2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.smslib.crypto;

import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import org.smslib.SMSLibException;

/**
 * The KeyManager class handles the association of a number (originator or
 * recipient) with a cryptographic key.
 */
public class KeyManager
{
	static private KeyManager _instance = null;

	HashMap<String, AKey> keys;

	private KeyManager()
	{
		keys = new HashMap<String, AKey>();
	}

	static public KeyManager getInstance()
	{
		if (_instance == null) _instance = new KeyManager();
		return _instance;
	}

	/**
	 * Associates a mobile number with an encryption key.
	 * 
	 * @param mobileNumber
	 *            The mobile number which will be associated with the encryption
	 *            key.
	 * @param key
	 *            The encryption key.
	 * @see AKey
	 * @see #registerKey(String, AKey)
	 * @see #unregisterAllKeys()
	 */
	public void registerKey(String mobileNumber, AKey key)
	{
		keys.put((mobileNumber.charAt(0) == '+' ? mobileNumber.substring(1) : mobileNumber), key);
	}

	/**
	 * Removes the association of a mobile number with a key.
	 * 
	 * @param mobileNumber
	 *            The mobile number which will be removed from the key
	 *            associations.
	 * @return The encryption key which was associated with the specific mobile
	 *         number.
	 * @see AKey
	 * @see #registerKey(String, AKey)
	 */
	public AKey unregisterKey(String mobileNumber)
	{
		return keys.remove((mobileNumber.charAt(0) == '+' ? mobileNumber.substring(1) : mobileNumber));
	}

	/**
	 * Removes all associations of mobile numbers and encryption keys.
	 */
	public void unregisterAllKeys()
	{
		keys.clear();
	}

	/**
	 * Returns the encryption key of the specified mobile number. Returns null
	 * if there is no association.
	 * 
	 * @param mobileNumber
	 *            The mobile number to look for.
	 * @return The encryption key, null if no key was previously associated.
	 */
	public AKey getKey(String mobileNumber)
	{
		return keys.get((mobileNumber.charAt(0) == '+' ? mobileNumber.substring(1) : mobileNumber));
	}

	/**
	 * Encrypts the specified message with the encryption key already associated
	 * with the specified mobile number.
	 * 
	 * @param mobileNumber
	 *            The mobile number which the message will be send to / received
	 *            from.
	 * @param message
	 *            The decrypted message.
	 * @return The encrypted message.
	 * @throws SMSLibException
	 * @throws InvalidKeyException
	 * @throws IllegalBlockSizeException
	 * @throws BadPaddingException
	 * @throws NoSuchPaddingException
	 * @throws NoSuchAlgorithmException
	 */
	public byte[] encrypt(String mobileNumber, byte[] message) throws SMSLibException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, NoSuchAlgorithmException
	{
		AKey k = getKey(mobileNumber);
		if (k == null) throw new SMSLibException("Could not find Encryption Key for the specific number.");
		else if (k instanceof ASymmetricKey) return ((ASymmetricKey) k).encrypt(message);
		else return new byte[0];
	}

	/**
	 * Decrypts the specified message with the encryption key already associated
	 * with the specified mobile number.
	 * 
	 * @param mobileNumber
	 *            The mobile number which the message received from.
	 * @param message
	 *            The encrypted message.
	 * @return The decrypted message.
	 * @throws SMSLibException
	 * @throws InvalidKeyException
	 * @throws IllegalBlockSizeException
	 * @throws BadPaddingException
	 * @throws NoSuchPaddingException
	 * @throws NoSuchAlgorithmException
	 */
	public byte[] decrypt(String mobileNumber, byte[] message) throws SMSLibException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, NoSuchPaddingException, NoSuchAlgorithmException
	{
		AKey k = getKey(mobileNumber);
		if (k == null) throw new SMSLibException("Could not find Encryption Key for the specific number.");
		else if (k instanceof ASymmetricKey) return ((ASymmetricKey) k).decrypt(message);
		else return new byte[0];
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产馆精品极品| 亚洲精品一区二区在线观看| 91精品蜜臀在线一区尤物| 国产精品欧美一区喷水| 亚洲超碰97人人做人人爱| 成人永久aaa| 欧美一级日韩一级| 亚洲综合免费观看高清完整版在线| 久久久久久久综合| 日本不卡一二三区黄网| 色成人在线视频| 欧美国产97人人爽人人喊| 久久精品国产成人一区二区三区| 欧洲激情一区二区| 亚洲日韩欧美一区二区在线| 国产成人在线观看免费网站| 日韩亚洲欧美成人一区| 午夜精品久久久久久久99水蜜桃| 成人99免费视频| 中日韩av电影| 粉嫩av一区二区三区在线播放| 26uuu另类欧美| 狠狠狠色丁香婷婷综合激情| 日韩欧美另类在线| 久久99久久久久久久久久久| 制服丝袜中文字幕一区| 婷婷一区二区三区| 91精品在线观看入口| 婷婷丁香激情综合| 制服.丝袜.亚洲.另类.中文| 午夜精品久久久久久久蜜桃app| 91国产丝袜在线播放| 一区二区激情视频| 欧美性生交片4| 香蕉影视欧美成人| 69成人精品免费视频| 免费成人小视频| 日韩欧美激情四射| 国产综合色产在线精品| 国产亚洲欧洲一区高清在线观看| 国产精品一区二区黑丝| 亚洲国产精品二十页| 91亚洲精品久久久蜜桃网站| 亚洲免费色视频| 国内成+人亚洲+欧美+综合在线 | 国产在线一区二区| 日韩一区在线播放| 久久综合九色欧美综合狠狠| 粉嫩aⅴ一区二区三区四区| av影院午夜一区| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品卡一卡二| 成人免费毛片嘿嘿连载视频| 欧美国产成人在线| 欧美影视一区二区三区| 日日夜夜精品视频免费| 日韩无一区二区| 国模套图日韩精品一区二区| 国产欧美一区二区精品性| 91免费视频大全| 三级欧美在线一区| 欧美国产禁国产网站cc| 91福利小视频| 国模少妇一区二区三区| 亚洲人快播电影网| 日韩午夜小视频| 99在线精品观看| 美日韩一级片在线观看| 1区2区3区精品视频| 4438x成人网最大色成网站| 国产福利不卡视频| 亚洲成人免费视| 国产香蕉久久精品综合网| 欧美体内she精高潮| 国产成人综合视频| 日韩精品亚洲一区二区三区免费| 久久欧美中文字幕| 欧美日韩国产一级二级| 色天天综合色天天久久| 久久99国产精品免费网站| 亚洲激情图片qvod| 久久久久久久av麻豆果冻| 欧美日韩一区不卡| 99视频国产精品| 国产不卡视频一区二区三区| 日韩精品欧美精品| 亚洲愉拍自拍另类高清精品| 亚洲国产成人私人影院tom| 日韩欧美国产一区二区三区| 91福利国产精品| www.日韩av| 国产成人免费在线视频| 美女视频黄频大全不卡视频在线播放 | av在线不卡网| 国产精品羞羞答答xxdd| 麻豆成人免费电影| 午夜精品福利一区二区蜜股av| 最新成人av在线| 欧美国产精品一区二区三区| 久久影音资源网| 欧美成va人片在线观看| 欧美一区二区三区小说| 欧美久久一区二区| 欧美精品成人一区二区三区四区| 欧美优质美女网站| 91久久精品一区二区二区| 99久久精品国产一区二区三区| 国产成人午夜高潮毛片| 国产91精品一区二区麻豆网站| 国产最新精品精品你懂的| 极品少妇一区二区| 国产美女av一区二区三区| 奇米精品一区二区三区在线观看 | 欧美美女一区二区三区| 欧美伊人久久久久久久久影院| 91影视在线播放| 在线亚洲精品福利网址导航| 在线观看av不卡| 欧美亚一区二区| 欧美日韩亚洲国产综合| 欧美肥胖老妇做爰| 91精品国产一区二区| 日韩精品一区国产麻豆| 欧美精品一区二区三区久久久| 久久综合九色综合欧美98| 国产欧美一区二区在线观看| 日本一区二区视频在线观看| 国产精品国产自产拍高清av| 亚洲欧洲日产国产综合网| 亚洲精品成人悠悠色影视| 午夜电影一区二区| 国产综合久久久久久鬼色| 粉嫩aⅴ一区二区三区四区五区| 91在线精品一区二区| 欧美专区亚洲专区| 日韩美女视频一区二区在线观看| 26uuu国产电影一区二区| 亚洲国产精华液网站w| 一区二区三区日韩在线观看| 午夜视频一区二区| 国产精品主播直播| 日本高清成人免费播放| 欧美日韩www| 欧美国产精品久久| 丝瓜av网站精品一区二区| 国产在线精品国自产拍免费| 99热精品国产| 日韩免费性生活视频播放| 亚洲国产精华液网站w| 日韩经典一区二区| 成人免费av在线| 欧美精品亚洲一区二区在线播放| 久久久综合激的五月天| 亚洲一区二区三区在线播放| 国产在线视视频有精品| 欧美日韩中文精品| 久久精品无码一区二区三区| 亚洲一区二区欧美日韩| 国产最新精品免费| 欧美视频自拍偷拍| 中文字幕成人av| 亚洲va欧美va人人爽| 成人中文字幕合集| 欧美一区二区三区思思人| 国产精品入口麻豆九色| 琪琪一区二区三区| 在线免费av一区| 欧美激情在线看| 久久99国内精品| 欧美丰满美乳xxx高潮www| 亚洲欧美日韩小说| 国产成人av电影在线播放| 欧美一区在线视频| 亚洲一区在线观看网站| 波多野洁衣一区| 国产片一区二区| 久久激五月天综合精品| 欧美日韩一区二区三区高清| 国产精品久久久久7777按摩| 精品一区二区成人精品| 制服丝袜激情欧洲亚洲| 亚洲综合区在线| 91九色02白丝porn| 亚洲天堂精品在线观看| 国产成人在线观看| 久久精品免费在线观看| 精品无码三级在线观看视频| 91精品国产91久久综合桃花| 亚洲大片一区二区三区| 欧洲在线/亚洲| 亚洲女人****多毛耸耸8| 99视频在线观看一区三区| 国产日韩精品一区| 国产成人免费视频网站| 精品999久久久| 国产原创一区二区| 国产亚洲一区二区三区四区| 狠狠色狠狠色综合| 久久精品人人做人人综合 | 午夜精品久久久久久|