本文整理汇总了Java中org.bouncycastle.crypto.params.ParametersWithRandom.getParameters方法的典型用法代码示例。如果您正苦于以下问题:Java ParametersWithRandom.getParameters方法的具体用法?Java ParametersWithRandom.getParameters怎么用?Java ParametersWithRandom.getParameters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.crypto.params.ParametersWithRandom
的用法示例。
在下文中一共展示了ParametersWithRandom.getParameters方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(boolean forEncryption, CipherParameters parameters)
{
this.forEncryption = forEncryption;
if (forEncryption)
{
if (parameters instanceof ParametersWithRandom)
{
ParametersWithRandom p = (ParametersWithRandom)parameters;
this.random = p.getRandom();
this.pubKey = (NTRUEncryptionPublicKeyParameters)p.getParameters();
}
else
{
this.random = new SecureRandom();
this.pubKey = (NTRUEncryptionPublicKeyParameters)parameters;
}
this.params = pubKey.getParameters();
}
else
{
this.privKey = (NTRUEncryptionPrivateKeyParameters)parameters;
this.params = privKey.getParameters();
}
}
示例2: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
/**
* initialise the EC Elgamal engine.
*
* @param param the necessary EC key parameters.
*/
public void init(
CipherParameters param)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom p = (ParametersWithRandom)param;
if (!(p.getParameters() instanceof ECPublicKeyParameters))
{
throw new IllegalArgumentException("ECPublicKeyParameters are required for new public key transform.");
}
this.key = (ECPublicKeyParameters)p.getParameters();
this.random = p.getRandom();
}
else
{
if (!(param instanceof ECPublicKeyParameters))
{
throw new IllegalArgumentException("ECPublicKeyParameters are required for new public key transform.");
}
this.key = (ECPublicKeyParameters)param;
this.random = new SecureRandom();
}
}
示例3: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
/**
* initialise the encryptor.
*
* @param param the necessary EC key parameters.
*/
public void init(
CipherParameters param)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom p = (ParametersWithRandom)param;
if (!(p.getParameters() instanceof ECPublicKeyParameters))
{
throw new IllegalArgumentException("ECPublicKeyParameters are required for encryption.");
}
this.key = (ECPublicKeyParameters)p.getParameters();
this.random = p.getRandom();
}
else
{
if (!(param instanceof ECPublicKeyParameters))
{
throw new IllegalArgumentException("ECPublicKeyParameters are required for encryption.");
}
this.key = (ECPublicKeyParameters)param;
this.random = new SecureRandom();
}
}
示例4: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(boolean forSigning, CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.random = rParam.getRandom();
param = rParam.getParameters();
}
else
{
this.random = new SecureRandom();
}
this.key = (ECPrivateKeyParameters)param;
}
else
{
this.key = (ECPublicKeyParameters)param;
}
}
示例5: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(
boolean forSigning,
CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.random = rParam.getRandom();
this.key = (ECPrivateKeyParameters)rParam.getParameters();
}
else
{
this.random = new SecureRandom();
this.key = (ECPrivateKeyParameters)param;
}
}
else
{
this.key = (ECPublicKeyParameters)param;
}
}
示例6: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(
boolean forSigning,
CipherParameters param)
{
this.forSigning = forSigning;
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.random = rParam.getRandom();
this.key = (ECPrivateKeyParameters)rParam.getParameters();
}
else
{
this.random = new SecureRandom();
this.key = (ECPrivateKeyParameters)param;
}
}
else
{
this.key = (ECPublicKeyParameters)param;
}
}
示例7: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(
boolean forSigning,
CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.random = rParam.getRandom();
this.key = (DSAPrivateKeyParameters)rParam.getParameters();
}
else
{
this.random = new SecureRandom();
this.key = (DSAPrivateKeyParameters)param;
}
}
else
{
this.key = (DSAPublicKeyParameters)param;
}
}
示例8: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(
boolean forWrapping,
CipherParameters param)
{
this.forWrapping = forWrapping;
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom p = (ParametersWithRandom)param;
rand = p.getRandom();
this.param = (ParametersWithIV)p.getParameters();
}
else
{
if (forWrapping)
{
rand = new SecureRandom();
}
this.param = (ParametersWithIV)param;
}
}
示例9: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(
boolean forSigning,
CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.random = rParam.getRandom();
this.key = (GOST3410PrivateKeyParameters)rParam.getParameters();
}
else
{
this.random = new SecureRandom();
this.key = (GOST3410PrivateKeyParameters)param;
}
}
else
{
this.key = (GOST3410PublicKeyParameters)param;
}
}
示例10: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(boolean forSigning,
CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
// XXX random needed?
this.random = rParam.getRandom();
this.key = (GMSSPrivateKeyParameters)rParam.getParameters();
initSign();
}
else
{
this.random = new SecureRandom();
this.key = (GMSSPrivateKeyParameters)param;
initSign();
}
}
else
{
this.key = (GMSSPublicKeyParameters)param;
initVerify();
}
}
示例11: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(boolean forSigning,
CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.random = rParam.getRandom();
this.key = (RainbowPrivateKeyParameters)rParam.getParameters();
}
else
{
this.random = new SecureRandom();
this.key = (RainbowPrivateKeyParameters)param;
}
}
else
{
this.key = (RainbowPublicKeyParameters)param;
}
this.signableDocumentLength = this.key.getDocLength();
}
示例12: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(boolean forSigning,
CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.sr = rParam.getRandom();
this.key = (McElieceCCA2PublicKeyParameters)rParam.getParameters();
this.initCipherEncrypt((McElieceCCA2PublicKeyParameters)key);
}
else
{
this.sr = new SecureRandom();
this.key = (McElieceCCA2PublicKeyParameters)param;
this.initCipherEncrypt((McElieceCCA2PublicKeyParameters)key);
}
}
else
{
this.key = (McElieceCCA2PrivateKeyParameters)param;
this.initCipherDecrypt((McElieceCCA2PrivateKeyParameters)key);
}
}
示例13: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(boolean forSigning,
CipherParameters param)
{
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.sr = rParam.getRandom();
this.key = (McEliecePublicKeyParameters)rParam.getParameters();
this.initCipherEncrypt((McEliecePublicKeyParameters)key);
}
else
{
this.sr = new SecureRandom();
this.key = (McEliecePublicKeyParameters)param;
this.initCipherEncrypt((McEliecePublicKeyParameters)key);
}
}
else
{
this.key = (McEliecePrivateKeyParameters)param;
this.initCipherDecrypt((McEliecePrivateKeyParameters)key);
}
}
示例14: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
/**
* initialise the underlying EC ElGamal engine.
*
* @param param the necessary EC key parameters.
*/
public void init(
CipherParameters param)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom p = (ParametersWithRandom)param;
if (!(p.getParameters() instanceof ECPublicKeyParameters))
{
throw new IllegalArgumentException("ECPublicKeyParameters are required for new randomness transform.");
}
this.key = (ECPublicKeyParameters)p.getParameters();
this.random = p.getRandom();
}
else
{
if (!(param instanceof ECPublicKeyParameters))
{
throw new IllegalArgumentException("ECPublicKeyParameters are required for new randomness transform.");
}
this.key = (ECPublicKeyParameters)param;
this.random = new SecureRandom();
}
}
示例15: init
import org.bouncycastle.crypto.params.ParametersWithRandom; //导入方法依赖的package包/类
public void init(
boolean forSigning,
CipherParameters param)
{
SecureRandom providedRandom = null;
if (forSigning)
{
if (param instanceof ParametersWithRandom)
{
ParametersWithRandom rParam = (ParametersWithRandom)param;
this.key = (DSAPrivateKeyParameters)rParam.getParameters();
providedRandom = rParam.getRandom();
}
else
{
this.key = (DSAPrivateKeyParameters)param;
}
}
else
{
this.key = (DSAPublicKeyParameters)param;
}
this.random = initSecureRandom(forSigning && !kCalculator.isDeterministic(), providedRandom);
}