Beispiel #1
0
            private byte[] ExportKeyBlob(bool includePrivateParameters)
            {
                string blobType = includePrivateParameters ?
                                  Interop.BCrypt.KeyBlobType.BCRYPT_RSAFULLPRIVATE_BLOB :
                                  Interop.BCrypt.KeyBlobType.BCRYPT_PUBLIC_KEY_BLOB;

                SafeNCryptKeyHandle keyHandle = GetKeyHandle();

                return(CngKeyLite.ExportKeyBlob(keyHandle, blobType));
            }
            private byte[] ExportFullKeyBlob(bool includePrivateParameters)
            {
                string blobType = includePrivateParameters ?
                                  Interop.BCrypt.KeyBlobType.BCRYPT_ECCFULLPRIVATE_BLOB :
                                  Interop.BCrypt.KeyBlobType.BCRYPT_ECCFULLPUBLIC_BLOB;

                using (SafeNCryptKeyHandle keyHandle = GetDuplicatedKeyHandle())
                {
                    return(CngKeyLite.ExportKeyBlob(keyHandle, blobType));
                }
            }
Beispiel #3
0
            private byte[] ExportKeyBlob(bool includePrivateParameters)
            {
                // Use generic blob type for multiple version support
                string blobType = includePrivateParameters ?
                                  Interop.BCrypt.KeyBlobType.BCRYPT_PRIVATE_KEY_BLOB :
                                  Interop.BCrypt.KeyBlobType.BCRYPT_PUBLIC_KEY_BLOB;

                using (SafeNCryptKeyHandle keyHandle = GetDuplicatedKeyHandle())
                {
                    return(CngKeyLite.ExportKeyBlob(keyHandle, blobType));
                }
            }