本文整理汇总了Java中org.bouncycastle.crypto.generators.DESedeKeyGenerator类的典型用法代码示例。如果您正苦于以下问题:Java DESedeKeyGenerator类的具体用法?Java DESedeKeyGenerator怎么用?Java DESedeKeyGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DESedeKeyGenerator类属于org.bouncycastle.crypto.generators包,在下文中一共展示了DESedeKeyGenerator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateDESKey
import org.bouncycastle.crypto.generators.DESedeKeyGenerator; //导入依赖的package包/类
/**
* Generate des key.
*
* @param file the file
* @throws java.io.IOException Signals that an I/O exception has occurred.
*/
public static void generateDESKey(String file) throws IOException {
DESedeKeyGenerator kg = new DESedeKeyGenerator();
KeyGenerationParameters kgp = new KeyGenerationParameters(
new SecureRandom(),
DESedeParameters.DES_EDE_KEY_LENGTH * 8);
kg.init(kgp);
byte[] key = kg.generateKey();
BufferedOutputStream keystream =
new BufferedOutputStream(new FileOutputStream(file));
byte[] keyhex = Hex.encode(key);
keystream.write(keyhex, 0, keyhex.length);
keystream.flush();
keystream.close();
}
开发者ID:oneops,项目名称:oneops,代码行数:21,代码来源:CmsCryptoDES.java
示例2: create
import org.bouncycastle.crypto.generators.DESedeKeyGenerator; //导入依赖的package包/类
public static KeyGenerator create() {
final SecureRandom random = new SecureRandom();
final KeyGenerationParameters parameters = new KeyGenerationParameters(
random,
DESedeParameters.DES_EDE_KEY_LENGTH * 8);
final DESedeKeyGenerator keyGenerator = new DESedeKeyGenerator();
keyGenerator.init(parameters);
return new KeyGenerator(keyGenerator);
}
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:10,代码来源:KeyGenerator.java
示例3: KeyGenerator
import org.bouncycastle.crypto.generators.DESedeKeyGenerator; //导入依赖的package包/类
public KeyGenerator()
{
super("DESede", 192, new DESedeKeyGenerator());
}
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:DESede.java
示例4: KeyGenerator3
import org.bouncycastle.crypto.generators.DESedeKeyGenerator; //导入依赖的package包/类
public KeyGenerator3()
{
super("DESede3", 192, new DESedeKeyGenerator());
}
开发者ID:Appdome,项目名称:ipack,代码行数:5,代码来源:DESede.java
示例5: KeyGenerator
import org.bouncycastle.crypto.generators.DESedeKeyGenerator; //导入依赖的package包/类
private KeyGenerator(final DESedeKeyGenerator keyGenerator) {
this.keyGenerator = keyGenerator;
}
开发者ID:AndreasWBartels,项目名称:libraries,代码行数:4,代码来源:KeyGenerator.java
注:本文中的org.bouncycastle.crypto.generators.DESedeKeyGenerator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论