Jose\Algorithm\ContentEncryption\AESCBCHS::encryptContent PHP Method

encryptContent() public method

public encryptContent ( $data, $cek, $iv, $aad, $encoded_protected_header, &$tag )
    public function encryptContent($data, $cek, $iv, $aad, $encoded_protected_header, &$tag)
    {
        $k = mb_substr($cek, mb_strlen($cek, '8bit') / 2, null, '8bit');
        $cyphertext = openssl_encrypt($data, $this->getMode($k), $k, OPENSSL_RAW_DATA, $iv);
        $tag = $this->calculateAuthenticationTag($cyphertext, $cek, $iv, $aad, $encoded_protected_header);
        return $cyphertext;
    }