本文整理汇总了Java中org.bouncycastle.crypto.BufferedAsymmetricBlockCipher类的典型用法代码示例。如果您正苦于以下问题:Java BufferedAsymmetricBlockCipher类的具体用法?Java BufferedAsymmetricBlockCipher怎么用?Java BufferedAsymmetricBlockCipher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BufferedAsymmetricBlockCipher类属于org.bouncycastle.crypto包,在下文中一共展示了BufferedAsymmetricBlockCipher类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCipherForAsymmetricBlockCipherMode
import org.bouncycastle.crypto.BufferedAsymmetricBlockCipher; //导入依赖的package包/类
private Cipher createCipherForAsymmetricBlockCipherMode(final String transformation, final AsymmetricBlockCipher modeWithEngine, final String engineName, final String modeName, final String paddingName)
throws NoSuchPaddingException
{
AsymmetricBlockCipher padding;
if (paddingName.isEmpty() || "NOPADDING".equals(paddingName))
padding = modeWithEngine;
else {
padding = createAsymmetricBlockCipherPadding(paddingName, modeWithEngine);
if (padding == null)
throw new NoSuchPaddingException("There is no asymmetric-block-cipher-padding registered with name \"" + paddingName + "\"!");
}
return new AsymmetricBlockCipherImpl(
transformation,
new BufferedAsymmetricBlockCipher(padding)
);
}
示例2: initFromSpec
import org.bouncycastle.crypto.BufferedAsymmetricBlockCipher; //导入依赖的package包/类
private void initFromSpec(
OAEPParameterSpec pSpec)
throws NoSuchPaddingException
{
MGF1ParameterSpec mgfParams = (MGF1ParameterSpec)pSpec.getMGFParameters();
Digest digest = DigestFactory.getDigest(mgfParams.getDigestAlgorithm());
if (digest == null)
{
throw new NoSuchPaddingException("no match on OAEP constructor for digest algorithm: "+ mgfParams.getDigestAlgorithm());
}
cipher = new BufferedAsymmetricBlockCipher(new OAEPEncoding(new ElGamalEngine(), digest, ((PSource.PSpecified)pSpec.getPSource()).getValue()));
paramSpec = pSpec;
}
示例3: CipherSpi
import org.bouncycastle.crypto.BufferedAsymmetricBlockCipher; //导入依赖的package包/类
public CipherSpi(
AsymmetricBlockCipher engine)
{
cipher = new BufferedAsymmetricBlockCipher(engine);
}
示例4: AsymmetricBlockCipherImpl
import org.bouncycastle.crypto.BufferedAsymmetricBlockCipher; //导入依赖的package包/类
public AsymmetricBlockCipherImpl(final String transformation, final BufferedAsymmetricBlockCipher delegate) {
super(transformation);
this.delegate = delegate;
}