@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
@Override protected byte[] engineWrap(Key key) throws IllegalBlockSizeException, InvalidKeyException { try { byte[] encoded = key.getEncoded(); return engineDoFinal(encoded, 0, encoded.length); } catch (BadPaddingException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } }
newE.initCause(e); throw newE;
newE.initCause(e); throw newE;
@Override int doCryptoOperation(final byte[] tmpBuf, byte[] output) throws BadPaddingException, IllegalBlockSizeException { int resultSize; if (encrypting) { if (usingPrivateKey) { resultSize = NativeCrypto.RSA_private_encrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } else { resultSize = NativeCrypto.RSA_public_encrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } } else { try { if (usingPrivateKey) { resultSize = NativeCrypto.RSA_private_decrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } else { resultSize = NativeCrypto.RSA_public_decrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } } catch (SignatureException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } } return resultSize; } }
@Override int doCryptoOperation(final byte[] tmpBuf, byte[] output) throws BadPaddingException, IllegalBlockSizeException { int resultSize; if (encrypting) { if (usingPrivateKey) { resultSize = NativeCrypto.RSA_private_encrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } else { resultSize = NativeCrypto.RSA_public_encrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } } else { try { if (usingPrivateKey) { resultSize = NativeCrypto.RSA_private_decrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } else { resultSize = NativeCrypto.RSA_public_decrypt( tmpBuf.length, tmpBuf, output, key.getNativeRef(), padding); } } catch (SignatureException e) { IllegalBlockSizeException newE = new IllegalBlockSizeException(); newE.initCause(e); throw newE; } } return resultSize; } }