public CryptoCipher createCryptoCipher()

in oss-20190517/src/main/java/com/aliyun/sdk/service/oss20190517/encryption/crypto/CryptoScheme.java [70:83]


    public CryptoCipher createCryptoCipher(SecretKey cek, byte[] iv, int cipherMode, Provider provider) {
        try {
            Cipher cipher = null;
            if (provider != null) {
                cipher = Cipher.getInstance(getContentCipherAlgorithm(), provider);
            } else {
                cipher = Cipher.getInstance(getContentCipherAlgorithm());
            }
            cipher.init(cipherMode, cek, new IvParameterSpec(iv));
            return newCryptoCipher(cipher, cek, cipherMode);
        } catch (Exception e) {
            throw new OSSClientException("Unable to build cipher: " + e.getMessage(), e);
        }
    }