📄 rijndaelkeygenerator.java
字号:
// Decompiled by Jad v1.5.7. Copyright 1997-99 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3)
// Source File Name: RijndaelKeyGenerator.java
package cn.ac.ict.crypto.provider.Rijndael;
import java.security.InvalidAlgorithmParameterException;
import java.security.SecureRandom;
import java.security.spec.AlgorithmParameterSpec;
import javax.crypto.KeyGeneratorSpi;
import javax.crypto.SecretKey;
// Referenced classes of package cn.ac.ict.crypto.provider.Rijndael:
// RijndaelKey
public class RijndaelKeyGenerator extends KeyGeneratorSpi
{
public RijndaelKeyGenerator()
{
}
protected void engineInit(AlgorithmParameterSpec params, SecureRandom random)
throws InvalidAlgorithmParameterException
{
throw new InvalidAlgorithmParameterException("Not Implemented");
}
protected void engineInit(SecureRandom random)
{
rand = random;
keyLength = 16;
}
protected void engineInit(int strength, SecureRandom random)
{
keyLength = strength;
rand = random;
}
protected SecretKey engineGenerateKey()
{
if(rand == null)
rand = new SecureRandom();
byte bytes[] = new byte[keyLength];
RijndaelKey key = null;
rand.nextBytes(bytes);
try
{
key = new RijndaelKey(bytes);
for(int i = 0; i < keyLength; i++)
bytes[i] = 0;
}
catch(Exception e)
{
throw new RuntimeException("RijndaelKeyGenerator: " + e);
}
return key;
}
public static final String ident = "$Id: RijndaelKeyGenerator.java,v 0.0 2000/12/26 $";
SecureRandom rand;
private int keyLength;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -