List of usage examples for org.bouncycastle.crypto.engines RSAEngine getInputBlockSize
public int getInputBlockSize()
From source file:org.fnppl.opensdx.security.PrivateKey.java
License:Open Source License
public byte[] sign(byte[] data) throws Exception { RSAEngine rsae = new RSAEngine(); rsae.init(false, priv);// w w w . ja v a 2s . c om byte[] filleddata = new byte[rsae.getInputBlockSize() - 1]; for (int i = 0; i < filleddata.length; i++) { filleddata[i] = data[i % data.length];//HT 2011-03-03 better some initvectorpadddup!!! } //System.out.println("PrivKey_SIGN_PLAINBLOATED:\t"+SecurityHelper.HexDecoder.encode(filleddata, ':', 80)); return rsae.processBlock(filleddata, 0, filleddata.length); }