Ejemplo n.º 1
0
        static async Task <RSAParameters> GetRsa(int keyStrength, string keyIdentifier)
        {
            var blob = await ResourcesProvider.GetBytesAsync($"RSA_{keyStrength}_{keyIdentifier}.bin",
                                                             ResourceType.RsaKeys);

            var rsaParams = BCryptRsaImport.BlobToParameters(blob, out int resultBitLength, out bool isPrivate);

            if (keyStrength != resultBitLength)
            {
                throw new InvalidDataException("Desired keyStrength does not match parsed data");
            }

            return(rsaParams);
        }
Ejemplo n.º 2
0
 byte[] GetRsaBlob(string blobType, int bits)
 {
     return(ResourcesProvider.GetBytes($"RSA_{bits}_{blobType}.bin", ResourceType.RsaKeys));
 }
Ejemplo n.º 3
0
        public static XbfsHeader GetHeader()
        {
            var data = ResourcesProvider.GetBytes("xbfs_header.bin", ResourceType.DataBlobs);

            return(Shared.BytesToStruct <XbfsHeader>(data));
        }