use of org.gudy.bouncycastle.crypto.params.AsymmetricKeyParameter in project BiglyBT by BiglySoftware.
the class PKCS1Encoding method init.
@Override
public void init(boolean forEncryption, CipherParameters param) {
AsymmetricKeyParameter kParam;
if (param instanceof ParametersWithRandom) {
ParametersWithRandom rParam = (ParametersWithRandom) param;
this.random = rParam.getRandom();
kParam = (AsymmetricKeyParameter) rParam.getParameters();
} else {
this.random = new SecureRandom();
kParam = (AsymmetricKeyParameter) param;
}
engine.init(forEncryption, kParam);
this.forPrivateKey = kParam.isPrivate();
this.forEncryption = forEncryption;
}
use of org.gudy.bouncycastle.crypto.params.AsymmetricKeyParameter in project BiglyBT by BiglySoftware.
the class OAEPEncoding method init.
@Override
public void init(boolean forEncryption, CipherParameters param) {
AsymmetricKeyParameter kParam;
if (param instanceof ParametersWithRandom) {
ParametersWithRandom rParam = (ParametersWithRandom) param;
this.random = rParam.getRandom();
kParam = (AsymmetricKeyParameter) rParam.getParameters();
} else {
this.random = new SecureRandom();
kParam = (AsymmetricKeyParameter) param;
}
engine.init(forEncryption, kParam);
this.forEncryption = forEncryption;
}
Aggregations