List of usage examples for org.bouncycastle.crypto.params ParametersWithRandom getRandom
public SecureRandom getRandom()
From source file:com.joyent.http.signature.crypto.NativeRSABlindedEngine.java
License:Open Source License
/** * initialise the RSA engine./*w ww. j a v a 2 s . c o m*/ * * @param forEncryption true if we are encrypting, false otherwise. * @param param the necessary RSA key parameters. */ @Override public void init(final boolean forEncryption, final CipherParameters param) { core.init(forEncryption, param); if (param instanceof ParametersWithRandom) { ParametersWithRandom rParam = (ParametersWithRandom) param; key = (RSAKeyParameters) rParam.getParameters(); random = rParam.getRandom(); } else { key = (RSAKeyParameters) param; random = new SecureRandom(); } }