コード例 #1
0
ファイル: RSACng.cs プロジェクト: kosmos-zhang/dotnet.corefx
            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));
            }
コード例 #2
0
            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));
                }
            }
コード例 #3
0
ファイル: DSACng.cs プロジェクト: layomia/dotnet_runtime
            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));
                }
            }