Certificate store in windows

Данный материал является переводом оригинальной статьи «ATA Learning : Michael Soule : Manage Certs with Windows Certificate Manager and PowerShell».

Работа с сертификатами обычно является одной из тех дополнительных задач, которые вынужден брать на себя системный администратор Windows. Диспетчер Сертификатов Windows (Windows Certificate Manager) — это один из основных инструментов, который позволяет выполнять эту работу.

В этой статье мы рассмотрим работу с сертификатами применительно к операционной системе Windows. Если же вы хотите узнать больше о том, как работают сертификаты в целом, ознакомьтесь с сопутствующей статьей «Your Guide to X509 Certificates».

Понимание хранилищ сертификатов

В диспетчере сертификатов Windows все сертификаты находятся в логических хранилищах, называемых «хранилищами сертификатов». Хранилища сертификатов – это «корзины», в которых Windows хранит все сертификаты, которые в настоящее время установлены, и сертификат может находиться более чем в одном хранилище.

К сожалению, хранилища сертификатов — не самая интуитивно понятная концепция для работы. О том, как различать эти хранилища и как с ними работать, вы прочитаете ниже.

Каждое хранилище находится в Реестре Windows и в файловой системе. При работе с сертификатом в хранилище вы взаимодействуете с логическим хранилищем, не изменяя напрямую реестр или файловую систему. Этот более простой способ позволяет вам работать с одним объектом, в то время как Windows заботится о том, как представить этот объект на диске.

Иногда можно встретить хранилища сертификатов, называемые физическими или логическими хранилищами. Физические хранилища ссылаются на фактическую файловую систему или место в реестре, где хранятся разделы реестра и / или файл(ы). Логические хранилища — это динамические ссылки, которые ссылаются на одно или несколько физических хранилищ. С логическими хранилищами намного проще работать, чем с физическими хранилищами для наиболее распространенных случаев использования.

Windows хранит сертификаты в двух разных областях — в контексте пользователя и компьютера. Сертификат помещается в один из этих двух контекстов в зависимости от того, должен ли сертификат использоваться одним пользователем, несколькими пользователями или самим компьютером. В остальной части этой статьи сертификат в контексте пользователя и компьютера будет неофициально называться сертификатами пользователей и сертификатами компьютеров.

Сертификаты пользователей

Если вы хотите, чтобы сертификат использовался одним пользователем, то идеальным вариантом будет хранилище пользовательских сертификатов внутри Диспетчера сертификатов Windows. Это общий вариант использования процессов аутентификации на основе сертификатов, таких как проводной IEEE 802.1x.

Сертификаты пользователей находятся в профиле текущего пользователя и логически отображаются только в контексте этого пользователя. Сертификаты пользователей «сопоставлены» и уникальны для каждого пользователя даже в одних и тех же системах.

Компьютерные сертификаты

Если сертификат будет использоваться всеми пользователями компьютера или каким-либо системным процессом, его следует поместить в хранилище в контексте компьютера. Например, если сертификат будет использоваться на веб-сервере для шифрования связи для всех клиентов, размещение сертификата в контексте компьютера будет подходящим вариантом.

Вы увидите, что хранилище сертификатов компьютера логически сопоставлено для всех пользовательских контекстов. Это позволяет всем пользователям использовать сертификаты в хранилище сертификатов компьютера в зависимости от разрешений, настроенных для закрытого ключа.

Сертификаты компьютера находятся в кусте реестра локального компьютера и в подкаталогах \ProgramData. Сертификаты пользователя находятся в кусте реестра текущего пользователя и в подкаталогах \AppData. Ниже вы можете увидеть, где каждый тип хранилища находится в реестре и файловой системе.

Контекст Путь реестра Объяснение
User HKEY_CURRENT_USER
SOFTWARE\Microsoft\SystemCertificates\
Физическое хранилище для пользовательских открытых ключей
User HKEY_CURRENT_USER
SOFTWARE\Policies\Microsoft\SystemCertificates\
Физическое хранилище для пользовательских открытых ключей, установленных объектами групповой политики Active Directory (AD) (GPO)
Computer HKEY_LOCAL_MACHINE
SOFTWARE\Microsoft\SystemCertificates\
Физическое хранилище общедоступных ключей для всей машины
Computer HKEY_LOCAL_MACHINE
SOFTWARE\Microsoft\Cryptography\Services\
Физическое хранилище ключей, связанных с определенной службой
Computer HKEY_LOCAL_MACHINE
SOFTWARE\Policies\Microsoft\SystemCertificates\
Физическое хранилище открытых ключей для всей машины, установленных объектами групповой политики.
Computer HKEY_LOCAL_MACHINE
SOFTWARE\Microsoft\EnterpriseCertificates\
Физическое хранилище общедоступных ключей, установленных корпоративными контейнерами PKI в домене AD
Контекст Расположение файла Объяснение
User $env:APPDATA\Microsoft\SystemCertificates\ Физическое хранилище для пользовательских открытых ключей и указателей на закрытые ключи
User $env:APPDATA\Microsoft\Crypto\ Физическое хранилище для контейнеров закрытых ключей для конкретных пользователей
Computer $env:ProgramData\Microsoft\Crypto\ Физическое хранилище для контейнеров закрытых ключей для всей машины
Предварительные требования

В оставшейся части этой статьи вы найдете несколько примеров, демонстрирующих взаимодействие с хранилищами сертификатов Windows. Чтобы воспроизвести эти примеры, убедитесь, что выполняются следующие требования:

  • Windows Vista, Windows Server 2008 или более новая операционная система. В показанных примерах используется Windows 10 Корпоративная версии 1903.
  • Знакомство с PowerShell. Хотя это и не обязательно, этот язык будет использоваться для ссылки на сертификаты, где это необходимо. Все показанные примеры были созданы с помощью Windows PowerShell 5.1.
  • Вам не потребуется устанавливать какие-либо специальные сертификаты, но использование самозаверяющего сертификата полезно.
Управление сертификатами в Windows

В Windows есть три основных способа управления сертификатами:

  • Оснастка консоли управления Microsoft (MMC) сертификатов (certmgr.msc)
  • PowerShell
  • Инструмент командной строки certutil

В этой статье вы узнаете, как управлять сертификатами с помощью оснастки Certificates MMC и PowerShell. Если вы хотите узнать больше о том, как использовать certutil, ознакомьтесь с документацией Microsoft.

PowerShell против диспетчера сертификатов Windows

Поскольку в Windows можно управлять сертификатами несколькими способами, встаёт вопрос выбора, что лучше использовать — GUI (MMC) или командную строку с PowerShell.

Во-первых, рассмотрим жизненный цикл сертификата. Если вы собираетесь установить или удалить один сертификат только один раз, рассмотрите возможность использования MMC. Но если вы управляете несколькими сертификатами или выполняете одну и ту же задачу снова и снова, использование командной строки может оказаться правильным решением. Даже если вы не умеете писать сценарии PowerShell, вам стоит этому научиться, если у вас есть много разных сертификатов, которыми нужно управлять.

Давайте сначала посмотрим, как обнаружить сертификаты, установленные в Windows, с помощью диспетчера сертификатов и PowerShell.

Использование диспетчера сертификатов Windows (certmgr.msc)

Чтобы просмотреть сертификаты с помощью MMC, откройте Диспетчер сертификатов: откройте меню «Пуск» и введите certmgr.msc. Это вызовет Windows Certificates MMC. Это начальное представление предоставит обзор всех логических хранилищ, отображаемых в левом окне.

На снимке экрана ниже видно, что выбрано логическое хранилище доверенных корневых центров сертификации

Windows Trusted Root Certification Authorities store

Просмотр физических хранилищ

По умолчанию Диспетчер сертификатов Windows не отображает физические хранилища. Чтобы показать их, в верхнем меню оснастки выбирайте «View» > «Options«. Затем вы увидите варианты отображения физических хранилищ сертификатов. Включение этого параметра упрощает определение конкретных путей в Windows.

Теперь вы можете видеть, что дополнительные контейнеры показаны в примере логического хранилища доверенных корневых центров сертификации, показанном ранее. Сертификаты по-прежнему сгруппированы относительно их логических хранилищ, но теперь вы можете увидеть физическое хранилище «Реестр».

Inspecting the physical cert stores

Проверка атрибутов в диспетчере сертификатов Windows

Есть много атрибутов сертификата, которые вы можете увидеть при просмотре их с помощью MMC. Например, вы, вероятно, захотите выбрать определенные сертификаты по их атрибутам. Самый простой способ сделать это — указать Serial Number сертификата или значение Thumbprint. Если сертификат был подписан центром сертификации (CA), при выдаче он будет иметь серийный номер. Thumbprint вычисляется каждый раз при просмотре сертификата.

Вы можете увидеть некоторые атрибуты сертификата, открыв его в MMC, как показано ниже.

Inspecting a Windows certificate

Следует отметить одну важную особенность — встроенные закрытые ключи. Сертификаты в Windows также могут иметь соответствующий закрытый ключ. Эти закрытые ключи хранятся в соответствующих физических хранилищах в виде зашифрованных файлов.

Чтобы быстро отличать сертификаты с соответствующим закрытым ключом и без него, посмотрите на значок сертификата. В Диспетчере сертификатов Windows, если значок просто выглядит как лист бумаги с лентой, соответствующий закрытый ключ отсутствует. Если у сертификата есть закрытый ключ, вы увидите ключ на значке MMC, и ключ в нижней части вкладки «Общие» при открытии сертификата

Certificate without an embedded private key (Сертификат без встроенного закрытого ключа)

Использование PowerShell по физическому хранилищу

Как и в случае с MMC, вы можете просматривать сертификаты и управлять ими с помощью PowerShell. Давайте сначала проверим сертификаты в их физических хранилищах (реестр и файловая система).

Используя PowerShell командлет Get-ChildItem, вы можете перечислить все ключи и значения внутри родительского пути в реестре. Приведенная ниже команда перечислит все сертификаты вошедшего в систему пользователя в логическом хранилище промежуточных центров сертификации.

Get-ChildItem -Path 'HKCU:\Software\Microsoft\SystemCertificates\CA\Certificates'

Каждая запись в кусте реестра, который вы видите, будет соответствовать отпечатку сертификата доверенного центра сертификации и его сертификату в соответствующем свойстве. Вы можете увидеть пример вывода ниже.

Results of the installed certificates from the example commands

Другое распространенное хранилище — это Personal store. Ваши сертификаты для этого хранилища находятся в файловой системе, а не в реестре. В следующих командах мы покажем эти различные физические пути и их цели.

Каждый файл в каталоге, возвращенный приведенной ниже командой, соответствует сертификату, установленному в личном хранилище текущего пользователя.

Get-ChildItem -Path $env:APPDATA\Microsoft\SystemCertificates\My\Certificates\

Каждый файл, возвращаемый в приведенной ниже команде, является ссылкой на объект для закрытого ключа, созданный поставщиком хранилища ключей (KSP). Имя файла соответствует идентификатору ключа субъекта сертификата. К каждому устанавливаемому вами закрытому ключу будет добавлен соответствующий файл.

Get-ChildItem -Path $env:APPDATA\Microsoft\SystemCertificates\My\Keys\

Каждый файл в каталоге, возвращаемый следующей командой, является уникальным контейнером для зашифрованного закрытого ключа, созданного KSP. Нет прямой связи между именем файла и сертификатом, но файл является целью указателя в предыдущей команде.

Get-ChildItem -Path $env:APPDATA\Microsoft\Crypto\Keys
Использование PowerShell по логическому хранилищу

Поскольку работа с сертификатами на их физических путях встречается редко, в остальных примерах вы будете работать с логическими хранилищами.

PowerShell может получить доступ к логическим хранилищам Windows с помощью PSDrive-объекта «Cert:\«, который сопоставляет сертификаты с физическими хранилищами так же, как это делает MMC.

К сожалению, MMC и «Cert:» не маркируют логические хранилища одинаково. Ниже вы можете увидеть сравнительную таблицу общих хранилищ и их названий как в MMC, так и в «Cert:» PSDrive.

Cert: Certificates MMC
My Personal
Remote Desktop Remote Desktop
Root Trusted Root Certification Authorities
CA Intermediate Certification Authorities
AuthRoot Third-Party Root Certification Authorities
TrustedPublisher Trusted Publishers
Trust Enterprise Trust
UserDS Active Directory User Object
Выбор сертификатов

Когда вы работаете с сертификатами, вам понадобится способ фильтрации и выбора сертификатов для выполнения определенных операций. В большинстве случаев вы будете фильтровать и выбирать сертификаты на основе значения определенного расширения.

Для следующих примеров вам нужно начать с перечисления всех установленных сертификатов в хранилище корневого ЦС.

Get-ChildItem -Path 'Cert:\CurrentUser\Root\'

Возвращенные объекты будут объектами сертификатов, которые вы можете использовать в следующих примерах.

Общие расширения уже доступны как свойства объектов сертификата. В приведенном ниже примере вы используете Get-Member для вывода списка всех свойств возвращаемых объектов.

Get-ChildItem -Path 'Cert:\CurrentUser\Root\' | Get-Member -MemberType Properties

The properties available for the returned certificate objects

Как видим, некоторые из этих расширений, например «Issuer», помогают найти сертификат, который вы ищете. Расширения предоставляют информацию о сертификате, например, кому он выдан, для чего его можно использовать и любые ограничения на него.

В более сложных случаях использования вам может понадобиться найти сертификаты других расширений, таких как используемый шаблон сертификата. Сложность в том, что значения этих расширений возвращаются как массив целых чисел. Эти целые числа соответствуют содержимому в кодировке ASN.1.

Покажем пример взаимодействия с свойствами типа ScriptProperty. В приведенной ниже команде вы извлекаете Key Usages.

((Get-ChildItem -Path 'Cert:\CurrentUser\Root\' | Select -First 1).Extensions | Where-Object {$_.Oid.FriendlyName -eq 'Key Usage'}).format($true)

Новая часть, которую мы вводим в приведенной выше команде, — это метод форматирования, который выполняет декодирование ASN.1. Вы передаете ему логическое значение (например, $true), чтобы определить, хотим ли мы, чтобы возвращаемый объект был однострочным или многострочным.

Попробуем использовать значение Thumbprint из сертификата в приведенной ниже команде. Значение Thumbprint устанавливается как переменная PowerShell и используется для выбора конкретного сертификата в приведенных ниже командах.

$thumb = "cdd4eeae6000ac7f40c3802c171e30148030c072"
Get-ChildItem -Path 'Cert:\CurrentUser\Root\' | Where-Object {$_.Thumbprint -eq $thumb}
Создание самозаверяющих (self-signed) сертификатов с помощью PowerShell

PowerShell может создавать самозаверяющие (self-signed) сертификаты с помощью командлета New-SelfSignedCertificate. Самозаверяющие сертификаты полезны для тестирования, поскольку они позволяют генерировать пару открытого и закрытого ключей без использования центра сертификации.

Теперь давайте создадим самозаверяющий сертификат в хранилищах текущего пользователя и локального компьютера, чтобы использовать его в примерах для следующих шагов.

В приведенном ниже примере PowerShell создает пару открытого и закрытого ключей, самозаверяющий сертификат и устанавливает их все в соответствующие хранилища сертификатов.

New-SelfSignedCertificate -Subject 'User-Test' -CertStoreLocation 'Cert:\CurrentUser\My'
New-SelfSignedCertificate -Subject 'Computer-Test' -CertStoreLocation 'Cert:\LocalMachine\My'

Использование самозаверяющих сертификатов для продуктивных сервисов не рекомендуется, поскольку не существует всех механизмов, основанных на доверии.

Импорт и экспорт сертификатов в MMC

Криптография с открытым ключом основана на широкой доступности открытого ключа. Учитывая это, вам нужны стандартные способы эффективного обмена сертификатами. Не менее важна безопасность ваших личных ключей. Хранение закрытых ключей на недоступных носителях или с материалами для аварийного восстановления — обычная практика для определенных закрытых ключей.

Оба они требуют способов хранения этих криптографических объектов в стандартных форматах. Экспорт предоставляет функции для сохранения этих объектов и обеспечения использования широко распространенных стандартных форматов файлов. Импорт позволяет вам переносить криптографические объекты в операционные системы Windows.

Экспорт сертификатов из MMC относительно прост. Чтобы экспортировать сертификат без закрытого ключа, щелкните сертификат в MMC, выберите меню «Все задачи», а затем «Экспорт».

Во время экспорта вам будет предложено указать формат файла, как показано ниже. Наиболее распространены варианты кодирования — DER или Base-64

Exporting a certificate with no private key or one that is marked as not exportable

Экспорт закрытых ключей

Чтобы экспортировать сертификат с соответствующим закрытым ключом, вы должны соответствовать двум критериям:

  • Вошедшая в систему учетная запись должна иметь разрешение на закрытый ключ (только для сертификатов компьютеров);
  • Закрытый ключ должен быть помечен как экспортируемый.

Чтобы проверить разрешения для закрытых ключей локального компьютера, вы можете выбрать сертификат с закрытым ключом, выбрать «Все задачи» и «Управление закрытыми ключами» в MMC «Сертификаты». В открывшемся диалоговом окне отображаются записи управления доступом для закрытых ключей.

Когда выше обозначенные условия выполнены, вы можете выбрать сертификат, щелкнуть «Все задачи», а затем «Экспорт», как если бы вы использовали сертификат только с открытым ключом. При экспорте теперь у вас должна присутствовать возможность выбора экспорта закрытого ключа («Yes, export the private key»), как показано ниже.

Certificate Export Wizard with exportable private key

Когда вы экспортируете закрытый ключ в Windows, вы можете сохранить файл только как PFX. Этот и другие типы файлов и форматы кодирования подробно описаны в этом посте.

Для остальных параметров, отображаемых в мастере экспорта, вы можете использовать значения по умолчанию. В таблице ниже приводится краткое изложение каждого из них.

Настройка Описание
Including all certificates in the certification path if possible Помогает с переносимостью эмитентов сертификатов и включает все соответствующие открытые ключи в PFX.
Delete the private key if the export is successful Удаляет закрытый ключ из файла и имеет несколько распространенных вариантов использования, но одним из примеров является проверка доступа к закрытым ключам.
Export all extended properties Будет включать любые расширения в текущем сертификате, они относятся к сертификатам [конкретные настройки] для интерфейсов Windows.
Enable certificate privacy Обычно в экспортируемом PFX-файле шифруется только закрытый ключ, этот параметр шифрует все содержимое PFX-файла.
Group or user names Вы можете использовать участника безопасности группы или пользователя из Active Directory для шифрования содержимого файла PFX, но пароль является наиболее переносимым вариантом для устаревших систем или компьютеров, не присоединенных к тому же домену.
Импорт сертификатов

Функция импорта одинакова для всех поддерживаемых типов файлов сертификатов. Единственная разница в том, что если файл содержит закрытый ключ, вы можете «Отметить этот ключ как экспортируемый», о чем вы узнаете подробнее ниже. Windows будет использовать мастер импорта сертификатов.

Certificate Import Wizard with a PFX file

При использовании мастера импорта сертификатов для PFX вам потребуется указать пароль, используемый для шифрования закрытого ключа. Вот еще один обзор вариантов импорта.

Настройка Описание
Enable strong private key protection Требуется пароль для каждого доступа к закрытому ключу. Будьте осторожны с новыми функциями, поскольку они не будут поддерживаться во всех программах.
Mark this key as exportable Вы должны стараться избегать использования этого параметра в любой конечной системе, закрытые ключи следует рассматривать так же, как и хранение паролей.
Protect private key using [virtualization-based security] Этот параметр обеспечивает дополнительные функции безопасности для защиты закрытых ключей от сложных атак вредоносного ПО.
Include all extended properties Относится к тем же настройкам Windows, что и при экспорте.

Сертификаты для подписи кода PowerShell — хороший вариант использования надежной защиты закрытого ключа.

С автоматическим размещением сертификатов следует проявлять осторожность. Скорее всего, вы получите наилучшие результаты, выбрав хранилище сертификатов вручную.

Импорт и экспорт сертификатов в PowerShell

Теперь с помощью PowerShell экспортируйте один из самозаверяющих сертификатов, которые вы создали ранее. В этом примере вы выбираете сертификат в личном логическом хранилище CurrentUser, который был самозаверяющим.

$certificate = Get-Item (Get-ChildItem -Path 'Cert:\CurrentUser\My\' | Where-Object {$_.Subject -eq $_.Issuer}).PSPath

Теперь, когда вы выбрали сертификат, вы можете использовать команду Export-Certificate, чтобы сохранить файл в кодировке DER, используя команду ниже.

Export-Certificate -FilePath $env:USERPROFILE\Desktop\certificate.cer -Cert $certificate

Теперь давайте посмотрим на экспорт закрытого ключа. Ниже вы проверяете, что у выбранного сертификата есть закрытый ключ. Если он не возвращает True, то команда Get-Item, скорее всего, выбрала неправильный сертификат.

$certificate.HasPrivateKey

Ниже вы установите пароль, который будет использоваться для шифрования закрытого ключа. Затем экспортируйте выбранный сертификат в файл PFX и используйте пароль, который вы ввели ранее, чтобы зашифровать файл.

$pfxPassword = "ComplexPassword!" | ConvertTo-SecureString -AsPlainText -Force
Export-PfxCertificate -FilePath $env:USERPROFILE\Desktop\certificate.pfx -Password $pfxPassword -Cert $certificate

В случае, если необходимо выполнить импорт, как и при экспорте, есть две команды. Одна команда для импорта сертификатов и одна для импорта файлов PFX.

Ниже команда Import-Certificate импортирует файл в формате DER, который вы экспортировали ранее, в личное хранилище текущего пользователя.

Import-Certificate -FilePath $env:USERPROFILE\Desktop\certificate.cer -CertStoreLocation 'Cert:\CurrentUser\My'

Допустим, вы тоже хотите установить закрытый ключ этого сертификата.

$pfxPassword = "ComplexPassword!" | ConvertTo-SecureString -AsPlainText -Force
Import-PfxCertificate -Exportable -Password $pfxPassword -CertStoreLocation 'Cert:\CurrentUser\My' -FilePath $env:USERPROFILE\Desktop\certificate.pfx

Имейте в виду, что пароль должен быть защищенной строкой. Кроме того, если вы импортируете в хранилище локального компьютера (например, «Cert:\LocalMachine«), вам нужно будет запустить команду из командной строки администратора с повышенными привилегиями.

В приведенном выше примере вы также используете параметр -Exportable с командой, отмечая закрытый ключ как экспортируемый в будущем. По умолчанию (без указания этого параметра) экспорт не используется. Экспортируемые закрытые ключи – отельный аспект информационной безопасности, заслуживающий отдельного внимания.

Удаление сертификатов с помощью PowerShell

При удалении сертификатов помните, что понятие «Корзина Windows» в этом случае отсутствует. Как только вы удалите сертификат, он исчезнет! Это означает, что очень важно подтвердить, что вы удаляете правильный сертификат, путем проверки уникального идентификатора, такого как серийный номер или значение расширения Thumbprint.

Как и выше, в приведенной ниже команде мы выбираем самозаверяющий сертификат из личного хранилища текущего пользователя.

$certificate = Get-Item (Get-ChildItem -Path 'Cert:\CurrentUser\My\' | Where-Object {$_.Subject -eq $_.Issuer}).PSPath

Ниже вы можете увидеть свойства отпечатка, серийного номера и темы для выбранного сертификата, чтобы убедиться, что это именно тот сертификат, который вы собираетесь выбрать.

$certificate.Thumbprint
$certificate.SerialNumber
$certificate.Subject

Убедитесь, что вы выбрали правильный сертификат, который собираетесь удалить.

Приведенная ниже команда удаляет все выбранные объекты сертификата, используйте с осторожностью! Передав объект $certificate через конвейер в командлет Remove-Item в приведенной ниже команде, вы удалите все содержимое сертификата без каких-либо запросов на проверку.

$certificate | Remove-Item
Резюме

На протяжении всей этой статьи вы работали с сертификатами в Windows, изучая, как получить к ним доступ, и некоторые инструменты, которые можно использовать при работе с ними. По этой теме можно изучить гораздо больше, в том числе о том, как связать установленные сертификаты с конкретными службами или даже о том, как реализовать инфраструктуру закрытого открытого ключа (PKI) путем развертывания собственных центров сертификации (CA).

Начало:
1. Криптография: простейшие термины этой науки
2. Система шифрования с открытым ключом
3. Зачем нужны центры сертификации при асимметричном шифровании
4. Зачем нужны самозаверенные сертификаты открытого ключа

Хранилища сертификатов

В операционных системах «Windows» (у меня установлена «Windows 10», так что речь в основном пойдет про нее) сертификаты хранятся на логическом уровне в так называемых «хранилищах» (по-английски «store» или «storage»).

Под «сертификатами» в этом посте имеются в виду файлы цифровых сертификатов открытого ключа (см. подробнее об этом предыдущие посты).

Я написал «на логическом уровне» потому, что по хранилищу сертификатов непонятно, на каком конкретно жестком диске компьютера хранятся сертификаты, в какой конкретно папке файловой системы они хранятся. (В данном посте не будет разбираться поиск точного местонахождения сертификатов на компьютере. Это отдельная тема, которая мне пока что неинтересна.)

На компьютере под управлением операционной системы «Windows 10» существует два главных хранилища сертификатов:

– хранилище компьютера (локальной машины);
– хранилище текущего пользователя.

Пользователь с правами администратора данной операционной системы может работать с каждым из этих хранилищ. Обычный пользователь имеет доступ только к хранилищу сертификатов текущего пользователя.

Насколько я понимаю, в хранилище компьютера отображаются сертификаты, доступные для всех пользователей данной операционной системы. Доступность этих сертификатов всем пользователям обеспечивается тем, что при открытии хранилища сертификатов обычного пользователя там будут видны все сертификаты из хранилища компьютера (они «наследуются»). Поэтому хранилище текущего пользователя обычно содержит больше сертификатов, чем хранилище компьютера: видны все сертификаты из хранилища компьютера и дополнительно сертификаты, доступные только текущему пользователю.

Таким образом, если пользователь с административными правами добавит сертификат в хранилище компьютера, то этот сертификат будет виден (доступен) в хранилище каждого пользователя этого компьютера. Если обычный пользователь добавит сертификат в хранилище текущего пользователя, то этот сертификат будет доступен только этому пользователю.

Подхранилища

Оба вышеописанных хранилища разбиты на подхранилища (папки с сертификатами). У меня их больше десятка. Но самые важные из них сейчас для меня два следующих:

– Личное;
– Доверенные корневые центры сертификации.

Инструменты для работы с хранилищами сертификатов

Как обычно, в операционной системе «Windows» есть множество способов для выполнения нужной задачи. Для работы с хранилищами сертификатов, в частности, можно использовать следующее:

– стандартный способ через графический (оконный) интерфейс;
– из командной строки в программе-оболочке «PowerShell»;
– различные программы командной строки вроде «certmgr.exe» или «certutil.exe»;
– можно написать программу для работы с сертификатами самому и так далее.

В этом посте я буду рассматривать только стандартный способ работы с хранилищами сертификатов через графический (оконный) интерфейс.

Консоль управления Microsoft (MMC)

Операционные системы «Windows» включают очень старый компонент (программу), который называется по-английски «Microsoft Management Console», сокращенно «MMC» (по-русски «Консоль управления Microsoft»). Первая версия этой программы была выпущена в 1998 году, но она до сих пор в строю и ее можно использовать для решения различных административных задач в рамках операционной системы. Насколько я понимаю, актуальная версия этой программы 3.0. Эта версия появилась в составе пакета обновлений SP3 для «Windows XP» (2007-2008 годы) и с тех пор в нее не вносилось заметных изменений. В нашем случае ее можно использовать для работы с хранилищами сертификатов.

Исполняемый файл этой программы — «mmc.exe». Ее можно вызвать с помощью команды «mmc» из любого местоположения, так как она хранится в системной папке %windir%\System32\. Я обычно набираю команду «mmc» в строке поиска «Windows 10» возле кнопки «Пуск», поиск находит эту программу и выдает ссылку «Открыть» для ее запуска.

Насколько я понимаю, сама консоль — это просто пустая площадка, на которую можно добавлять различные модули. Таким образом, каждый может настроить для своей работы такую площадку, которая ему больше всего подходит, регулируя состав модулей на площадке. Каждый модуль предназначен для решения своей административной задачи. Отдельный модуль представляет собой файл динамически подключаемой библиотеки (файл с расширением «.dll»), взаимодействие между модулем и консолью выполняется по стандарту «COM».

Этих модулей довольно много, их можно добавить в консоль через меню «Файл – Добавить или удалить оснастку…». По-английски такой модуль называют «snap-in». Почему выбрано такое название — не знаю, обычно такие модули по-английски называют «plug-in» (по-русски «плагин»). Думаю, эти слова можно считать синонимами. Слово «snap-in» на русский язык почему-то перевели как «оснастка». По-моему, такой перевод — это вообще пальцем в небо. У меня слово «оснастка» ассоциируется с морскими кораблями, парусниками. Но такой перевод сложился уже давно и все к нему привыкли. Хотя по слову «оснастка» нелегко сообразить, что в английском это «snap-in».

После составления своей «площадки» (консоли) с оснастками эту площадку можно сохранить в файл с расширением «.msc» (аббревиатура «MSC» расшифровывается как «Microsoft Saved Console», по-русски «сохраненная консоль Microsoft»). В дальнейшем этот файл можно поместить на рабочий стол и запускать именно его. Файлы с расширением «.msc» по умолчанию привязаны к программе «mmc.exe» и передаются ей в качестве входного параметра.

Встроенные сохраненные консоли для работы с хранилищами сертификатов

Раньше нужно было создавать свою консоль для оснасток, предназначенных для работы с хранилищами сертификатов. Но в операционной системе «Windows 10» есть встроенные сохраненные консоли с нужными оснастками для работы с хранилищами сертификатов. Поэтому напрямую вызывать программу «mmc.exe» и работать с нею теперь не требуется (если нужно выполнить только манипуляции с сертификатами в хранилищах сертификатов).

Для запуска встроенной в операционную систему сохраненной консоли для работы с хранилищем сертфикатов данного компьютера (локальной машины) можно в строке поиска операционной системы (рядом с кнопкой «Пуск») набрать фразу «Управление сертификатами компьютеров» (у меня операционная система «Windows 10» с русскоязычным интерфейсом; в англоязычном интерфейсе, естественно, нужно будет искать на английском). Поиск найдет ссылку «Открыть» для этой сохраненной консоли, по которой и следует перейти. (Напомню, для работы с хранилищем сертификатов компьютера требуются права администратора.) Вот как окно этой сохраненной консоли выглядит у меня:

Очевидно, что это окно программы «mmc.exe» с загруженной в него сохраненной консолью из файла «certlm.msc». Обратите внимание на заголовок окна с названием файла: certlm (расширение не указано, но оно есть, просто в заголовке окна оно опущено). Окончание «lm» в этом слове расшифровывается как «local machine» (по-русски в этом случае можно перевести как «данный компьютер»). Файл «certlm.msc» расположен в той же папке %windir%\System32\, что и файл «mmc.exe», поэтому его тоже можно вызвать из любого местоположения из командной строки командой «certlm».

Для запуска встроенной в операционную систему сохраненной консоли для работы с хранилищем сертификатов текущего пользователя можно в строке поиска операционной системы (рядом с кнопкой «Пуск») набрать фразу «Управление сертификатами пользователей». Вот как окно этой сохраненной консоли выглядит у меня:

Опять же, это окно программы «mmc.exe» с загруженной в него сохраненной консолью из файла «certmgr.msc». Название «certmgr» расшифровывается как «Certificate Manager» (по-русски «Менеджер сертификатов» или «Диспетчер сертификатов»). Для работы с этой сохраненной консолью не требуется прав администратора операционной системы, достаточно прав текущего пользователя. Опять же, файл «certmgr.msc» хранится в той же папке %windir%\System32\, о которой уже дважды было упомянуто ранее. Его можно запустить из любого местоположения из командной строки с помощью команды «certmgr».

Важно отметить, что сохраненная консоль «certmgr.msc» и программа командной строки «certmgr.exe» — это разные вещи. Не следует их путать.

Ссылки по теме:

https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/working-with-certificates

https://learn.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-view-certificates-with-the-mmc-snap-in

​So, I was curious where exactly certificates and their corresponding private keys are stored on a Windows machine. Did a bit of research, and the picture is somewhat clear, however there is a lot of info on the topic and some points don’t seem to correspond to the actual situation on my Windows 8 machine.

Let’s start by the basics, the Certificates MMC console, easily launched by certmgr.msc. It gives us the first hint where certificates are stored, by allowing us to view the Physical certificate stores:

122516 1141 Windowscert1


As you can see, there are several stores: the Registry, the Local Computer (hard drive), Smart Card. There are also some not shown in the picture: the Enterprise store, the Group Policy store, the Third-Party store. When using a AD CA, there are also some containers under the Configuration partition, but let’s ignore those.

If we actually go to MMC and add the certificates snap-in, we have some more choices for the account. They correspond to a normal user account, service account or the computer account. So all of those stores listed above have their corresponding location for each account. Let’s start with the Registry store:

  • HKEY_Current_User\Software\Microsoft\SystemCertificates contains registry settings for the current user. Those can include the BLOB (Binary Large object) and various settings for the certificate, as well as settings related to the CA certificates that support the user certificates.

  • HKEY_Current_User\Software\Policies\Microsoft\SystemCertificates contains the same info, but for certificates distributed via Group Policy.

  • HKEY_Users\User SID\Software\Microsoft\SystemCertificates contains this info for the corresponding user

  • HKEY_LOCAL_MACHINE\Software\Microsoft\Cryptography\Services\ServiceName\SystemCertificates contains this info for the corresponding service account

  • HKEY_Local_Machine\Software\Microsoft\SystemCertificates contain the info for the computer account

  • HKEY_Local_Machine\Software\Policies\Microsoft\SystemCertificates contains the same, but for GP distributed certificates for the computer account

  • HKEY_Local_Machine\Software\Microsoft\EnterpriseCertificates contains info about the AD published certificates

More info about the above can be found in these articles on MSDN and TechNet.

Now, some stuff is actually stored on the local hard drive. Under file:\%APPDATA%\Microsoft\SystemCertificates\MyCertificates you will find all your personal certificates. Looking at the picture above and all the info I’ve seen over the internet, those should be stored in the registry. Well, at least on my Windows 8 machine this is NOT the case, and all the certificates that are listed under Personal in certmgr.msc can be found in this folder. The corresponding private keys are in C:\Users\XXXX\AppData\Roaming\Microsoft\Crypto\RSA\S-I-D. Other directories worth noting are the C:\Users\XXXX\AppData\Roaming\Microsoft\Credentials one and the C:\Users\XXXX\AppData\Roaming\Microsoft\Protect\S-I-D one.

For the computer account, certificates are indeed stored in the registry, in the keys detailed above. The corresponding private keys are stored encrypted in C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys and similarly for the others.

You can use some other tools to work with the certificate stores. The certutil tool has some uses, for example you can view all the personal certificates for the current user with:

certutil -user -viewstore My

If you simply want to dump all the information in the console, you can use:

certutil -user -store My

To do the same for the computer account, simply drop the ‘-user’ parameter:

certutil -store My or certutil -viewstore My

A lot more options are available, feel free to explore more here.

For the PowerShell lovers, the Cert: drive can provide most of the needed information. Here are some uses:

PS C:> cd Cert:; dir

Location   : CurrentUser
StoreNames : {SmartCardRoot, Root, Trust, AuthRoot...}

Location   : LocalMachine
StoreNames : {TrustedPublisher, ClientAuthIssuer, Remote Desktop, Root...}

To list all the certificates in the ‘Personal’ store for the current user, use:

PS Cert:> dir Cert:CurrentUserMy

Directory: Microsoft.PowerShell.SecurityCertificate::CurrentUserMy
Thumbprint                                Subject
----------                                -------
A7620E9F2EA346FF002AECA5EEBE364892E70D74  CN=6DB6031A-EB7C-4DD8-8CD6-D238A787B8F8
978C8DDEF435A171EC32F9A3D5890301A8D3BFC9  CN=vasil.michev@hp.com
7B5159CEDAF7DDA18090BBC78CA607213235823F  E=vasil.michev@hp.com, CN=Vasil Lyubenov Michev, OU=VPN-WEB-H, O=Hewlett-Packard Company
3DE9DFBBC381470A9234FF06D8109A8E74140655  CN=vasil@michev.info
249BA6C5CA7DC641A07287EA2B2AA9B361A4C56E  CN=Vasil

To get all the details for a particular certificate, you can use:

PS Cert:> dir Cert:CurrentUserMy106796B4130A9AE14BF38C7CE553353204613796 | fl *

And there is of course much more that you can do with PowerShell, make sure to check out this article.

There are unfortunately some discrepancies between the store names in different tools, so you need to be careful. I’m too lazy to make a good table for all the relevant ones, but a sample is available for example here.

In the world of cybersecurity, security certificates play a crucial role in ensuring the authenticity and integrity of digital communication. But have you ever wondered where these security certificates are stored in Windows 10? Well, prepare to be enlightened!

The storage location for security certificates in Windows 10 is the certificate store. This store acts as a repository for all the certificates that are used to validate the identity of websites, applications, and individuals. The certificate store is a vital component of the Windows operating system, providing a secure and centralized location for managing and accessing these important digital assets. So, the next time you encounter a security certificate while browsing the web or installing software, remember that it is stored in the certificate store of your Windows 10 system.

Security certificates in Windows 10 are stored in the certificate stores on your computer, which are managed by the Certificates snap-in in the Microsoft Management Console (MMC). These certificates are categorized into various stores such as Current User, Local Computer, and Trusted Root Certification Authorities. To access the certificate stores, open the MMC, add the Certificates snap-in, and choose the appropriate store. From there, you can view, import, or export certificates for various security purposes.

Where Are Security Certificates Stored In Windows 10

An Overview of Security Certificates in Windows 10

In Windows 10, security certificates play a vital role in establishing secure communication channels between applications, websites, and users. These certificates are used to verify the authenticity and integrity of digital entities, such as websites, software, and individuals. By default, Windows 10 comes pre-installed with a collection of trusted root certificates from various Certificate Authorities (CAs). These certificates are stored in specific locations within the Windows operating system for effective management and secure usage.

Where Are Root Certificates Stored?

The root certificates in Windows 10 are stored in the trusted root certification authorities store. This store acts as a repository for all trusted root certificates issued by different CAs. These certificates are essential for validating the trustworthiness of intermediate and end-entity certificates. The trusted root certification authorities store can be accessed through the Microsoft Management Console (MMC) or by using various command-line tools like certutil and PowerShell.

The location of the trusted root certification authorities store in Windows 10 is:

Store Name Location
Current User Cert:\CurrentUser\Root
Local Machine Cert:\LocalMachine\Root

These locations provide access to the root certificates installed on the user’s account or the entire local machine, respectively. It is important to note that modifications to these root certificates should be performed with caution, as any incorrect changes can disrupt the trust chain and result in security vulnerabilities.

Current User Store

The Current User store, as the name suggests, contains the root certificates specific to the currently logged-in user. These certificates are managed and controlled by the user for applications and processes associated with their account. The Current User store is typically used for personal certificate management.

In Windows 10, the Current User store for root certificates can be accessed using the following path:

Cert:\CurrentUser\Root

Here, the «Cert:» notation represents the certificate store provider, «CurrentUser» specifies the user account, and «Root» refers to the store containing the root certificates.

Any changes made to the Current User store will only affect the user account associated with it and will not impact other user accounts or the local machine as a whole.

Local Machine Store

The Local Machine store, also known as the Computer store, contains root certificates that are shared across all user accounts on the Windows 10 system. These certificates are considered trusted by all applications and processes running on the machine. Modifying the Local Machine store requires administrative privileges as it can have system-wide implications.

In Windows 10, the Local Machine store for root certificates can be accessed using the following path:

Cert:\LocalMachine\Root

Similar to the Current User store, the «Cert:» notation indicates the certificate store provider, «LocalMachine» signifies the local machine context, and «Root» denotes the store containing the root certificates.

Changes made to the Local Machine store will affect all user accounts on the Windows 10 system and impact the trust relationship between applications and websites.

Where Are Intermediate Certificates Stored?

In addition to root certificates, Windows 10 also maintains a separate store for intermediate certificates. Intermediate certificates are used to establish the chain of trust between root certificates and end-entity certificates. These certificates are typically issued by a trusted CA and are necessary for verifying the authenticity and validity of end-entity certificates.

The intermediate certificates in Windows 10 are stored in the intermediate certification authorities store. This store acts as an intermediary between the root certification authorities store and the end-entity certificates store. It contains all the intermediate certificates required to validate the trustworthiness and integrity of the end-entity certificates.

The location of the intermediate certification authorities store in Windows 10 is:

Store Name Location
Current User Cert:\CurrentUser\CA
Local Machine Cert:\LocalMachine\CA

Similar to the root certificates, the intermediate certificates are stored separately for the Current User and Local Machine contexts. The paths mentioned above enable access to the intermediate certificates specific to the respective account or the entire machine.

Current User Store

The Current User store for intermediate certificates contains the certificates associated with the currently logged-in user account. It allows the user to manage and control the intermediate certificates used by applications and processes associated with their account.

To access the Current User store for intermediate certificates in Windows 10, use the following path:

Cert:\CurrentUser\CA

The «Cert:» notation represents the certificate store provider, «CurrentUser» specifies the user account, and «CA» refers to the store containing the intermediate certificates.

Any modifications made to the Current User store for intermediate certificates will only impact the associated user account and will not affect other user accounts or the local machine.

Local Machine Store

The Local Machine store for intermediate certificates is shared across all user accounts on the Windows 10 system. It contains the intermediate certificates that are trusted by all applications and processes running on the machine.

To access the Local Machine store for intermediate certificates in Windows 10, use the following path:

Cert:\LocalMachine\CA

Similar to the Current User store, the «Cert:» notation denotes the certificate store provider, «LocalMachine» indicates the local machine context, and «CA» represents the store containing the intermediate certificates.

Modifications made to the Local Machine store for intermediate certificates will impact all user accounts on the Windows 10 system and affect the trust relationship between applications and websites.

Managing and Updating Security Certificates in Windows 10

To ensure the proper functioning and security of your Windows 10 system, it is important to regularly manage and update the security certificates stored within the operating system. Here are a few essential practices:

Updating Root Certificates

Root certificates in Windows 10 are typically updated through regular system updates provided by Microsoft. These updates include the latest trusted root certificates from various CAs. It is crucial to keep your Windows 10 system up to date to benefit from the latest security enhancements and trusted root certificates.

The Windows Update functionality in Windows 10 automatically checks for and installs updates, including root certificate updates. Ensure that you have automatic updates enabled, or regularly check for updates through the Windows Update settings.

Importing and Managing Certificates

In addition to the pre-installed root and intermediate certificates, you may encounter scenarios where you need to import and manage custom certificates in Windows 10. Here’s how you can import and manage certificates:

  • Open the Certificate Manager by searching for ‘certmgr.msc’ in the Windows search bar.
  • In the Certificate Manager, you can access various certificate stores, including the trusted root certification authorities and intermediate certification authorities stores.
  • To import a certificate, right-click on the desired store (e.g., Trusted Root Certification Authorities) and select ‘All Tasks’ > ‘Import’.
  • Follow the on-screen instructions to browse and select the certificate file to import.
  • Once imported, the certificate will be available in the respective store, and you can manage its properties and trust settings.

Ensure that you only import and trust certificates from reliable and trusted sources to maintain the security and integrity of your system.

Revoking and Renewing Certificates

In certain cases, it may be necessary to revoke or renew certificates. Here are some scenarios where these actions might be required:

  • Certificate Revocation: If you suspect that a certificate has been compromised or the private key associated with it has been exposed, you should immediately revoke the certificate. This can be done through the certificate’s issuer or the relevant CA. Revoking a certificate ensures that it can no longer be used for secure communication.
  • Certificate Renewal: Certificates have a finite validity period, typically ranging from one to three years. It is important to track certificate expiration dates and renew them before they expire. Failure to renew a certificate in time can result in disruptions to secure communication.

To revoke or renew a certificate, you need to follow the process specified by the certificate issuer or the associated CA. This usually involves contacting them and providing the necessary information to initiate the revocation or renewal process.

Certificate Trust in Applications

When an application or website establishes a secure connection using SSL/TLS, it relies on the underlying operating system’s certificate store to verify the authenticity and integrity of the certificates involved. However, some applications have their own separate certificate stores, especially browsers like Google Chrome and Mozilla Firefox.

These browsers maintain their own trusted root certificate stores and manage the trust relationships independently of the Windows 10 operating system. This can lead to inconsistencies between different applications’ trust stores and the Windows 10 system’s trust store.

Therefore, it is important to ensure that certificates are managed and updated not only at the system level but also within individual applications, especially web browsers. Most modern browsers have options or settings that allow you to view and manage the trusted root certificates used by the browser.

Regularly check and update the trusted root certificates in your web browsers to maintain a consistent and secure trust foundation.

In conclusion, understanding where security certificates are stored in Windows 10 is crucial for managing and securing your system. Windows 10 provides separate stores for root certificates and intermediate certificates, allowing for fine-grained control and trust management. Additionally, regularly updating certificates, managing custom imports, and ensuring consistent certificate trust across applications and browsers are essential practices. By following these guidelines, you can maintain the integrity, authenticity, and security of the certificates used in Windows 10.

Where Are Security Certificates Stored In Windows 10

Location of Security Certificates in Windows 10

In Windows 10, security certificates are stored in specific locations to ensure the secure communication between various applications and websites. The certificates play a crucial role in verifying the identity of the parties involved in the communication process. Understanding where these certificates are stored can be helpful for troubleshooting certificate-related issues or managing trusted certificates.

Root Certificate Store:

  • The root certificate store contains trusted root certificates that have been pre-installed by Microsoft.
  • Location: The root certificate store can be accessed through the Certificate Manager, which can be opened by typing «certmgr.msc» in the Run dialog box (Win + R) and navigating to «Trusted Root Certification Authorities».

Intermediate Certificate Store:

  • The intermediate certificate store contains certificates that validate the trustworthiness of the root certificates.
  • Location: The intermediate certificate store can also be accessed through the Certificate Manager by navigating to «Intermediate Certification Authorities».

Personal Certificate Store:

  • The personal certificate store stores the certificates issued to individuals or entities for various purposes.
  • Location: The personal certificate store can be accessed through the Certificate Manager by navigating to «Personal».

Key Takeaways — Where Are Security Certificates Stored in Windows 10

  • Security certificates on Windows 10 are stored in the Windows Certificate Store.
  • The Windows Certificate Store is a centralized location for storing digital certificates.
  • You can access the Windows Certificate Store using the Microsoft Management Console (MMC).
  • The Windows Certificate Store is divided into multiple certificate stores, including the Current User and Local Machine stores.
  • The Current User store contains certificates specific to the user who is currently logged in.

Frequently Asked Questions

In this section, we will answer some commonly asked questions about where security certificates are stored in Windows 10.

1. How do I access the certificate store in Windows 10?

To access the certificate store in Windows 10, follow these steps:

1. Press the Windows key + R to open the Run dialog box.

2. Type «certmgr.msc» and press Enter to open the Certificate Manager.

3. In the Certificate Manager, you can navigate through the different folders to view and manage the security certificates.

4. You can also access the certificate store by searching for «Certificate Manager» in the Windows search bar.

2. Where are user certificates stored in Windows 10?

User certificates in Windows 10 are stored in the Current User store. Here’s how to access it:

1. Open the Certificate Manager as mentioned in the previous question.

2. Expand the «Personal» folder under «Current User».

3. Here, you will find all the user certificates associated with the current user account.

3. Where are system certificates stored in Windows 10?

System certificates in Windows 10 are stored in the Local Machine store. Here’s how to access it:

1. Open the Certificate Manager as mentioned in the first question.

2. Expand the «Personal» folder under «Local Computer».

3. Here, you will find all the system certificates installed on the computer.

4. Can I export security certificates from the Certificate Manager?

Yes, you can export security certificates from the Certificate Manager in Windows 10. Follow these steps:

1. Open the Certificate Manager as mentioned in the first question.

2. Find the certificate you want to export and double-click on it.

3. In the certificate details window, go to the «Details» tab and click on «Copy to File».

4. Follow the export wizard to save the certificate as a .pfx file.

5. How do I import a security certificate in Windows 10?

To import a security certificate in Windows 10, follow these steps:

1. Open the Certificate Manager as mentioned in the first question.

2. Go to the store where you want to import the certificate (e.g., Current User or Local Machine).

3. Right-click on the folder or certificate store and select «All Tasks» > «Import».

4. Follow the import wizard to select the certificate file and complete the import process.

In conclusion, security certificates in Windows 10 are stored in different locations depending on the type of certificate and the purpose it serves. The main locations where security certificates can be found include the certificate stores in the Windows operating system, the Trusted Root Certification Authorities store, the Current User store, and the Local Machine store.

The certificate stores in Windows 10 provide a secure location for storing digital certificates that are used for various purposes, such as authentication, encryption, and secure communication. Understanding where these certificates are stored is important for managing and troubleshooting security-related issues on a Windows 10 system.

We often come across an abstract concept called “Security on the internet” and then the Unavoidable query comes “why do we need security on the internet?”

We spend loads of time on the internet be it social media, personal communication and business transactions. The Internet security is important to communicate securely over the Internet. Thus, with the use of internet security the computers, files/data from the computer, IT systems etc. are protected from any kind of intrusion by any malicious user/system over the Internet

What does security provide?

  1. Confidentiality: The information within the message or transaction is kept confidential. It may only be read and understood by the intended sender and receiver.
  2. Integrity: The information within the message or transaction is not tampered accidentally or deliberately.
  3. Authentication/Identification: The persons / entities with whom we are communicating are really who they say they are.
  4. Non-Repudiation: The sender cannot deny sending the message or transaction, and the receiver cannot deny receiving it.
  5. Access Control: Access to the protected information is only realized by the intended person or entity.

All the above security properties can be achieved and implemented with the help of Digital Certificate through the use of Public Key Infrastructure (PKI) mechanism.

The digital certificate is basically a digital form of identification by which consumers, businesses and organizations can exchange the data securely over the internet using the public key infrastructure (PKI). Digital Certificate is also known as a public key certificate or identity certificate.

Public Key Cryptography or Asymmetric Cryptography uses two different cryptographic key pairs: A.) Private key and B.) Public key. One key from the key pair is used to Encrypt and the other key is used to decrypt the data and vice-versa.

To understand what certificates are, it is important to note that a digital certificate establishes the owner’s identity, and it makes the owner’s public key available. Digital certificates are issued by trusted Certificate Authorities (CAs), which are recognized as reliable digital certificate providers. These certificates are issued only for a limited time; after the expiration of the certificate a new certificate is issued. 

A digital certificate alone can only verify the identity of the digital certificate’s owner by providing the public key that is required to verify the owner’s digital signature. Therefore, the owner of the digital certificate must protect the private key that belongs to the public key of the digital certificate.

How digital certificates are verified?

  1. The issuer of a digital certificate is called a Certificate/Certification Authority. Verifying the certificates is the process of validating the entity’s identity. Validation process is a way to be sure about the person’s identity.
  2. The certificate contains information about the CA name and digital signature, these two fields will be used to authenticate the certificate. The CA name of the certificate has to be from a trusted CA and the digital signature must be valid.
  3. Now, the process is to validate the digital signature of the certificate, the verification of a digital signature is performed as per the below steps:
    • Calculate the hash-value: The first step is to calculate the hash-value of the message (often called a message digest) by applying a cryptographic
      hashing algorithm (For example: MD5, SHA1, SHA2). The hash value of the message is a unique value.
    • Calculate the digital signature: In this step the hash value of the message or the message digest is encrypted with the private key of the signer, the encrypted hash value is also called as digital signature.
    • Calculate the current message digest: In this step the hashed value of the signed message is calculated by the same algorithm which was used during the signing process.
    • Calculate the original Hash-value: Now, the digital signature is decrypted by the public key that corresponds to the private key of the signer. As a result, we will obtain the original hash value that was calculated from the original message during the first step of the signing process.
    • Compare the current and original hash value: In this step we will compare the hash values of the current message digest and the original hash value. If two values are identical then the verification is successful. This proves that the message has been signed with the private key that corresponds to the public key used in the verification process. If the two values differ, this means that the digital signature is invalid and the verification is unsuccessful.

To manage user certificates, individuals and organizations can use certificate lifecycle management tools, which facilitates the issuance, renewal and revocation of digital certificates. The tool can be essential for maintaining the integrity and security of digital communications. 

Now, worried about false impersonation of your identity? – If you send your digital certificate containing your public key to someone else, the person cannot misuse the digital certificate without having access to your private key. If the private key is compromised, then malicious users may act as the legitimate owner of the digital certificate.

Use of digital certificate in the internet applications

There are numerous internet applications using public key cryptography standards for key exchange, digital signature and digital certificates need to be used to obtain the desired public key.

Following are brief descriptions of a few of the commonly used Internet applications that use public-key cryptography:

  1. SSL (Secure Socket Layer) – This is an encryption-based internet security protocol. This protocol is used to provide security between the client and a server. SSL uses digital certificates, called SSL Digital, for key exchange, encryption, server authentication, and client authentication for secure communication over the internet. Overall, it provides a private communication path for a user and a trusted authority. 
  2. Client Authentication –Client authentication is an option which requires a server to authenticate a client’s digital certificate before allowing the client to access certain resources. The server requests and authenticates the client’s digital certificate during the SSL handshake and the server can also determine whether it trusts the CA that issued the digital certificate to the client.
  3. Secure Electronic Mail – To secure email messages, it uses standards such as Privacy Enhanced Mail (PEM) or Secure/Multipurpose Internet Mail Extensions (S/MIME). digital certificates are used for digital signatures and for the exchange of keys to encrypt and decrypt messages.
  4. Virtual Private networks (VPNs) – Virtual private networks, also called secure tunnels, can be set up between firewalls/secure gateways to enable protected connections between secure networks over insecure communication links. All traffic destined to these networks is encrypted between the firewalls/secure gateways.

Windows Certificate stores

Certificate stores are a combination of logical grouping and physical storage locations. Certificate store contains certificates issued from a number of different certification authorities (CAs). Windows Certification List is a collection of certificates which are part of Windows Certificate Store, these include Root Certificates, Intermediate Certificates, End Entity Certificates, SSL/TLS certificates, Client Authentication certificates etc. 

System certificate stores has the following types:

  1. Local machine certificate store: This certificate store is local to computer and global to all users on the computer. The certificate store is located in the registry under HKEY_LOCAL_MACHINE root.
  2. Current user certificate store: This certificate store is local to a user account on the computer. This certificate store is located in the registry under the HKEY_CURRENT_USER root.

Let’s start with the certificate MMC console, easily launched by certmgr.msc.
This gives us the hint of physical certificate stores, as shown in fig 1.

As shown in figure1 below, there are several stores: smart card store, Enterprise store, the Third-Party store etc.

If we go to MMC and add the certificate snap-in, we have some more choices for the accounts: user account, service account and the computer account, all the stores listed in the fig1 have their corresponding location for each account.

Microsoft certificate stores storage locations include:

  1. HKEY_LOCAL_MACHINESOFTWAREMicrosoftSystemCertificates – contain the info for the computer account
  2. HKEY_LOCAL_MACHINESOFTWAREMicrosoftEnterpriseCertificates – contains info about the AD published certificates
  3. HKEY_Local_MachineSoftwarePoliciesMicrosoftSystemCertificates- contains info for the computer account, but for Group policy distributed certificates for the computer account
  4. User: HKEY_CURRENT_USERSoftwareMicrosoftSystemCertificates – contains registry settings for the current user. Those can include the BLOB (Binary Large object) and various settings for the certificate, as well as settings related to the CA certificates that support the user certificates.
  5. HKEY_Current_UserSoftwarePoliciesMicrosoftSystemCertificates – contains registry settings for the current user, but for certificates distributed via Group Policy.
  6. HKEY_UsersUser SIDSoftwareMicrosoftSystemCertificates – contains this info for the corresponding user

If your organization is looking for implementation of encryption technologies in cloud environment, please consult [email protected] for further information.

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Midtown madness для windows 10
  • Total commander windows 7 x32
  • Не загружается оболочка windows
  • Приложение центр отзывов windows 10 что это
  • Панель задач пропали значки windows 10