/** * Close the transformer engine. * * The close functions closes all stored default crypto contexts. This * deletes key data and forces a cleanup of the crypto contexts. */ public void Close() { if (defaultContext != null) { defaultContext.Close(); defaultContext = null; } if (defaultContextControl != null) { defaultContextControl.Close(); defaultContextControl = null; } }
/** * Construct a SRTPTransformEngine based on given master encryption key, * master salt key and SRTP/SRTCP policy. * * @param masterKey * the master encryption key * @param masterSalt * the master salt key * @param srtpPolicy * SRTP policy * @param srtcpPolicy * SRTCP policy */ public SrtpTransformEngine(byte[] masterKey, byte[] masterSalt, SrtpPolicy srtpPolicy, SrtpPolicy srtcpPolicy) { defaultContext = new SrtpCryptoContext(0, 0, 0, masterKey, masterSalt, srtpPolicy); defaultContextControl = new SrtcpCryptoContext(0, masterKey, masterSalt, srtcpPolicy); }