博客园UAP 新版本发布了(新增Metro版)

最近咱们更新了以前发布的博客园UAP(mobile 和 metro 版),应不少用户的要求增长了登陆及显示帐号收藏的功能,使用了博客园新增长的API。算法

 

在新版本中,你们能够登陆本身的博客园帐号,查看博客园帐户中的收藏。windows

还能将以前版本中的,属于微软帐户的收藏,一键上传到博客园帐户的收藏中(固然也能够手动上传一部分)。app

另外咱们还改善了文章和代码的阅读效果,以及博客园UAP直接运行在win10 mobile上会出现的一些显示异常。dom

 

如下是一些预览:ide

在首页左侧新增登录功能字体

原来的收藏面板显示博客园帐户收藏和本地上传按钮加密

修缮后的阅读界面spa

字体大小更合适,界面更适合阅读code

以前版本的阅读界面blog

字体显示有问题,代码显示太小

Metro版右上角增长用户登陆入口,同时收藏界面新增云端收藏及同步到云端功能

 

 

在使用API的时候,咱们须要用RSA进行加密,WinRT已经支持直接使用openSSL生成的公钥了,咱们只需引用这两个namespace,

using Windows.Security.Cryptography.Core;
using Windows.Security.Cryptography;

 

AsymmetricKeyAlgorithmProvider p = AsymmetricKeyAlgorithmProvider.OpenAlgorithm(AsymmetricAlgorithmNames.RsaPkcs1);
CryptographicKey key = p.ImportPublicKey(CryptographicBuffer.DecodeFromBase64String(CNBLOGS_PUBLIC_KEY));

IBuffer rawUsername = CryptographicBuffer.ConvertStringToBinary(username, BinaryStringEncoding.Utf8);
IBuffer rawPassword = CryptographicBuffer.ConvertStringToBinary(password, BinaryStringEncoding.Utf8);
var enUsername = CryptographicEngine.Encrypt(key, rawUsername, null);
var enPassword = CryptographicEngine.Encrypt(key, rawPassword, null);

而后就可使用WinRT提供的RSA加密算法了。

 

加密方法的签名是

public static IBuffer Encrypt(CryptographicKey key, IBuffer data, IBuffer iv);

当前的程序集中使用IBuffer,能够直接经过CryptographicBuffer类来进行常见的加密辅助手段,它们直接接受IBuffer类型。

如:

public static IBuffer ConvertStringToBinary(System.String value, BinaryStringEncoding encoding);
public static IBuffer DecodeFromBase64String(System.String value);
public static System.String EncodeToBase64String(IBuffer buffer);
public static IBuffer GenerateRandom(System.UInt32 length);

 

欢迎你们更新体验新版本,也但愿你们能向咱们反馈使用中发现的问题哦:)

 

最新版本的store连接在这里:

Windows Phone Store App link:

http://www.windowsphone.com/zh-cn/store/app/博客园-uap/500f08f0-5be8-4723-aff9-a397beee52fc

Windows Metro App link:

https://www.microsoft.com/zh-cn/store/apps/%E5%8D%9A%E5%AE%A2%E5%9B%AD-uap/9nblggh11j4v

相关文章
相关标签/搜索