ideakey.java

来自「面向应用的智能安全代理平台和工具包是一个综合网络应用的安全共性需求而设计和实现的」· Java 代码 · 共 77 行

JAVA
77
字号
package au.net.aba.crypto.provider;

/*
 * $Id: IDEAKey.java,v 1.5 1999/01/18 04:59:30 leachbj Exp $
 * $Author: leachbj $
 *
 * 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/IDEAKey.java,v $
 * $Revision: 1.5 $
 * $Date: 1999/01/18 04:59:30 $
 * $State: Exp $
 */

import au.net.aba.crypto.spec.IDEAKeySpec;
import javax.crypto.SecretKey;

/**
 * A class wrapper for Idea keys.
 */
public class IDEAKey implements SecretKey
{
	public final static String ident = "$Id: IDEAKey.java,v 1.5 1999/01/18 04:59:30 leachbj Exp $";

	private byte[] key;

	/**
	 * the basic constructor
	 */
	public IDEAKey(
		byte[] rawKey)
	{
		key = new byte[IDEAKeySpec.IDEA_KEY_LEN];
		System.arraycopy(rawKey, 0, key, 0, IDEAKeySpec.IDEA_KEY_LEN);
	}
	/**
	 * returns the algorithm for this key.
	 *
	 * @return the string "IDEA"
	 */
	public String getAlgorithm()
	{
		return "IDEA";
	}
	/**
	 * returns an encoded representation of this key.
	 *
	 * @return the key as a set of bytes.
	 */
	public byte[] getEncoded()
	{
		byte[]	tmp;

		tmp = new byte[IDEAKeySpec.IDEA_KEY_LEN];
		System.arraycopy(key, 0, tmp, 0, IDEAKeySpec.IDEA_KEY_LEN);

		return tmp;
	}
	/**
	 * returns the format for this key.
	 *
	 * @return the string "RAW"
	 */
	public String getFormat()
	{
		return "RAW";
	}
}

⌨️ 快捷键说明

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