📄 desedekey.java
字号:
package au.net.aba.crypto.provider;
/*
* $Id: DESedeKey.java,v 1.8 1998/10/05 05:46:45 dgh Exp $
* $Author: dgh $
*
* 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/DESedeKey.java,v $
* $Revision: 1.8 $
* $Date: 1998/10/05 05:46:45 $
* $State: Exp $
*/
import javax.crypto.SecretKey;
import javax.crypto.spec.DESedeKeySpec;
/**
* a triple DES key.
*/
public class DESedeKey implements SecretKey
{
public final static String ident = "$Id: DESedeKey.java,v 1.8 1998/10/05 05:46:45 dgh Exp $";
private byte[] key;
public DESedeKey(
byte[] rawKey)
{
key = new byte[DESedeKeySpec.DES_EDE_KEY_LEN];
System.arraycopy(rawKey, 0,
key, 0, DESedeKeySpec.DES_EDE_KEY_LEN);
}
/**
* returns the algorithm for this key.
*
* @return the string "DESede".
*/
public String getAlgorithm()
{
return "DESede";
}
/**
* returns an encoded representation of this key.
*
* @return the key in raw byte format.
*/
public byte[] getEncoded()
{
byte[] tmp;
tmp = new byte[DESedeKeySpec.DES_EDE_KEY_LEN];
System.arraycopy(key, 0, tmp, 0, DESedeKeySpec.DES_EDE_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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -