Import Public RSA Key From Certificate

后端 未结 3 1957
情歌与酒
情歌与酒 2021-01-28 13:08

Our customer has their public RSA key stored in a certificate.

We need this key hardcoded in our WinRT app, so we can encrypt client-side. However, we\'re having issues

3条回答
  •  孤街浪徒
    2021-01-28 13:14

    Two things:

    1. The argument to ImportPublicKey key is an IBuffer. The easiest way to get this is using the ToBuffer extension method for a byte[].
    2. Use the override of ImportPublicKey that takes both an IBuffer and a CryptographicPublicKeyBlobType, specifically CryptographicPublicKeyBlobType.X509SubjectPublicKeyInfo. Pass in the subject public key info field from the certificate.

提交回复
热议问题