⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pbekey.java

📁 面向应用的智能安全代理平台和工具包是一个综合网络应用的安全共性需求而设计和实现的一个通用性的网络信息安全应用支撑平台
💻 JAVA
字号:
package au.net.aba.crypto.provider;

/*
 * $Id: PBEKey.java,v 1.2 1999/01/21 01:35:38 wslade Exp $
 * $Author: wslade $
 *
 * Copyright (C) 1996-1998 Australian Business Access Pty Ltd.
 * All rights reserved.         
 *       
 * Use, modification, copying and distribution of this software is subject the
 * terms and conditions of the ABA Public Licence. See the file
 * "PUBLIC_LICENCE" for additional information.
 *
 * If you have not received a copy of the Public Licence, you must destroy all
 * copies of this file immediately. 
 *
 * $Source: /aba/CVSROOT/jdk1.1/src/au.net.aba/crypto/provider/PBEKey.java,v $
 * $Revision: 1.2 $
 * $Date: 1999/01/21 01:35:38 $
 * $State: Exp $
 */

import java.io.*;
import java.security.*;
import java.util.StringTokenizer;

import javax.crypto.*;
import javax.crypto.spec.PBEKeySpec;

/**
 * A class wrapper for Blowfish keys.
 */
public class PBEKey implements SecretKey
{
	public final static String ident = "$Id: PBEKey.java,v 1.2 1999/01/21 01:35:38 wslade Exp $";

	private char[] pwd;
	
	/**
	 * The basic constructor
	 *
	 *
	 * @param pwd	the bytes making up the key.
	 */
	public PBEKey(
		char[] pwd)
	{
		this.pwd = pwd;
	}
	/**
	 * returns the algorithm for this key.
	 *
	 * @return the string "PBE"
	 */
	public String getAlgorithm()
	{
		return "PBE";
	}
	/**
	 * returns a null since there is no encoded form.
	 *
	 * @return the key as a byte array
	 */
	public byte[] getEncoded()
	{
		return null;
	}
	/**
	 * returns the format for this key.
	 *
	 * @return the string "RAW"
	 */
	public String getFormat()
	{
		return "RAW";
	}
	/**
	 * Returns the password. This method is specific to the PBE implementation
	 **/
	public char[] getPassword()
	{
		char[] cpy = new char[pwd.length];
		System.arraycopy(pwd, 0, cpy, 0, pwd.length);
		return cpy;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -