css - 保护 UIWebVIew 中的自定义字体

标签 css ios encryption uiwebview font-face

在我的应用程序中,我在 UIWebView 中显示 HTML 内容。 HTML 内容从服务器下载并存储在 iPad 的文件系统中以支持离线使用。 HTML 在其 CSS 文件中通过 @font-face 使用自定义字体:

@font-face {font-family: 'CustomFont'; src: url(Custom-Font.otf);}

为了完成这项工作,字体 .otf 文件也被下载并存储在 iPad 的文件系统中。

问题是,现在任何可以访问他的 iPad 文件系统的人都可以使用该字体(如果您使用 IExplorer 之类的东西,这真的很容易)。

这会导致一些法律问题,因为大多数字体提供商不允许免费分发他们的字体(当我使用此方法时,他们实际上是这样做的)。

我的问题:有什么方法可以让文件系统中的字体加密并在 UIWebView 尝试加载它们时解密它们?

最佳答案

参见 Protecting Data Using On-Disk Encryption在《iOS App 编程指南》中:

In iOS 4 and later, apps can use the data protection feature to add a level of security to their on-disk data. Data protection uses the built-in encryption hardware present on specific devices (such as the iPhone 3GS and iPhone 4) to store files in an encrypted format on disk. While the user’s device is locked, protected files are inaccessible even to the app that created them. The user must explicitly unlock the device (by entering the appropriate passcode) at least once before your app can access one of its protected files.

我没有对此进行测试,但我强烈认为无法使用 iExplorer 读取加密文件。

关于css - 保护 UIWebVIew 中的自定义字体,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11938858/

相关文章:

iphone - 一个 NSString 中的多个字符串

security - 有没有人有关于如何获得自己的智能卡和让 pkcs#11 使用它的教程?

java:使用从PEM文件读取的RSA公钥解密数据时如何避免IllegalBlockSizeException?

php - $_SESSION 似乎不能跨文件工作?

javascript - 有没有办法在 HTML5 Canvas 上使用 CSS 颜色?

iphone - 任何 View 的颠倒变换

ios - 确保 iOS 的异步任务已完成

c# - 无法从字节转换为字符串

jquery - 根据数量动态布置固定大小的 div

CSS 仅在事件文本上加下划线而不是填充 - ajax 工具包选项卡