?? pbekey.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 + -