> For the complete documentation index, see [llms.txt](https://docs.scepman.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scepman.com/es/despliegue-de-scepman/intermediate-certificate.md).

# CA intermedia

Configura SCEPman como autoridad de certificación subordinada.

{% hint style="warning" %}
Solo para SCEPman Enterprise Edition
{% endhint %}

Use una CA intermedia cuando otra CA raíz siga siendo su autoridad principal. SCEPman crea la clave y la solicitud de certificado en Azure Key Vault. Su CA raíz firma la solicitud.

### Antes de empezar

Complete estos requisitos previos antes de crear el certificado:

* Su cuenta de administrador puede crear solicitudes de certificado y combinar certificados firmados en Key Vault de SCEPman.
* Un sistema que ejecute Azure CLI y PowerShell puede acceder a Key Vault.
* Conoce el asunto requerido de la CA intermedia y el nombre del certificado.

<details>

<summary>Conceder permisos de certificado de Key Vault</summary>

{% tabs %}
{% tab title="Azure RBAC" %}

1. En Key Vault, abra **Control de acceso (IAM)** → **Asignaciones de roles**.
2. Agregue el rol **Key Vault Certificate Officer** .
3. Asigne el rol a la cuenta de administrador que crea la CSR.

<figure><img src="https://4115997120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FZUqsPTRdUk5IhmZZlBVD%2Fimage.png?alt=media&amp;token=325c2296-4f6b-476d-b003-29cf3674556f" alt="Add a role assignment in the Key Vault"><figcaption><p>Agregue una asignación de rol en Key Vault.</p></figcaption></figure>

<figure><img src="https://4115997120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FptcaAY0strUu3qIgkTdc%2Fimage.png?alt=media&amp;token=6bf4adc2-da77-4ece-ba68-09c61fc6905e" alt="Select the Key Vault Certificate Officer role"><figcaption><p>Seleccione el rol Key Vault Certificate Officer.</p></figcaption></figure>
{% endtab %}

{% tab title="Directivas de acceso de Vault" %}

1. En Key Vault, abra **Directivas de acceso** y seleccione **Crear**.
2. Seleccione la plantilla **Certificate Management** .
3. Asigne la directiva a la cuenta de administrador que crea la CSR.

<figure><img src="https://4115997120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FD2mWeiZ7YnQuRN0rdypW%2F2023-06-14%2016_20_43-IntermediateCert.png?alt=media&amp;token=da6b385e-8902-4b53-8a9f-25f3573d6532" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4115997120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2F37QHfqcQRHNboM4yQkTb%2F2023-06-14%2016_23_37-IntermediateCert.png?alt=media&amp;token=3cc22a95-8f13-4487-b270-083efa2779bd" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4115997120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FIj3S2D7wkNquLnBJSUQe%2F2023-06-14%2017_06_33-.png?alt=media&amp;token=195c03cb-a120-434b-8aa1-c44d4b2d26f6" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

</details>

<details>

<summary>Permitir el acceso de red a Key Vault</summary>

Si su Key Vault usa [Puntos de conexión privados](https://docs.scepman.com/es/configuracion-de-azure/private-endpoints.md), permita el acceso a la estación de trabajo o al entorno de Cloud Shell que se indica a continuación. Sin este acceso, el módulo no puede crear la CSR ni combinar el certificado.

En Key Vault, abra **Configuración** → **Redes**. Permita la red virtual o la dirección IP del cliente correspondiente. También se admite [Azure Cloud Shell](https://learn.microsoft.com/en-us/azure/cloud-shell/vnet/overview) . Quite las excepciones de red temporales después de combinar el certificado.

</details>

### Crear la CA intermedia

{% stepper %}
{% step %}

#### Configurar los ajustes del certificado de SCEPman

En App Service de SCEPman, abra **Variables de entorno**. En **Configuración de la aplicación**, actualice:

* `AppConfig:KeyVaultConfig:RootCertificateConfig:CertificateName`: el nombre del certificado de Key Vault. Use solo letras, números y guiones.
* `AppConfig:KeyVaultConfig:RootCertificateConfig:Subject`: cambie solo `CN` al mismo nombre común.

Seleccionar **Aplicar** y confirme los cambios. **Reinicie** el App Service. Después, abra la URL de SCEPman.

<figure><img src="https://4115997120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FvO2YgKtltBesm2Eme7ix%2Fimage.png?alt=media&amp;token=9ec3f21e-b6eb-47c5-8e10-3e2cbe519669" alt="SCEPman App Service certificate settings"><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Crear la solicitud de certificado

Use la versión 1.9 o posterior del módulo de PowerShell de SCEPman. [Se recomienda](https://learn.microsoft.com/en-us/azure/cloud-shell/overview) Azure Cloud Shell porque incluye la CLI de Azure. De lo contrario, instale [la CLI de Azure](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli).

```powershell
Install-Module -Name SCEPman -Scope CurrentUser -Force
```

Establezca su organización:

```powershell
Reset-IntermediateCaPolicy -Organization "My Organization"
```

Establezca el asunto en el valor configurado en el App Service. También puede ajustar otras opciones de directiva antes de guardarla.

{% code lineNumbers="true" %}

```powershell
$policy = Get-IntermediateCaPolicy
$policy.policy.x509_props.subject = "CN=YOUR_CN_FROM_ABOVE,OU=YOUR_TENANT_ID,O=YOUR_ORGANIZATION"
# change some additional settings of $policy
Set-IntermediateCaPolicy -Policy $policy
```

{% endcode %}

Cree la CSR:

```powershell
New-IntermediateCA -SCEPmanAppServiceName "app-scepman-example" -SearchAllSubscriptions 6>&1
```

El comando genera la CSR para la CA raíz.
{% endstep %}

{% step %}

#### Emitir el certificado de la CA intermedia

Recupere el certificado emitido de la CA raíz. Guárdelo como un archivo codificado en Base64 `.cer` .

<details>

<summary>CA raíz de SCEPman: envíe la CSR mediante Certificate Master</summary>

Abra [Solicitud de firma de certificado (CSR)](https://docs.scepman.com/es/administracion-de-certificados/certificate-master/certificate-signing-request-csr.md). Pegue la CSR codificada en PEM o cargue el archivo CSR para emitir el certificado de la CA intermedia. Cambie **Formato de archivo de descarga** a **PEM** antes de descargar el certificado.

</details>

<details>

<summary>CA raíz empresarial de ADCS: agregue Key Encipherment</summary>

Esto solo se aplica a las CA raíz empresariales de ADCS integradas con AD. El certificado debe incluir `CRLSign`, `DigitalSignature`, `KeyEncipherment`, y `KeyCertSign`. La plantilla predeterminada de **Subordinate Certificate Authority** omite `KeyEncipherment`. Las CA raíz independientes y sin conexión usan los usos de clave de la CSR.

1. Solicite y emita un certificado de SubCA. Puede duplicar la plantilla SubCA.
2. En la CA raíz, exporte el certificado como X.509 codificado en Base-64, por ejemplo, `C:\temp\SubCA.cer`.
3. Cree `C:\temp\extfile.txt`:

```
[Extensions]
2.5.29.15=AwIBpg==
Critical=2.5.29.15
```

4. Ejecute:

```powershell
certutil -sign "C:\temp\SubCA.cer" "C:\temp\SubCAwithKeyEncipher.cer" @C:\temp\extfile.txt
```

El certificado de salida tiene el uso de clave `0xA6`. Su firma cambia, pero su número de serie no. Revocar el certificado ADCS original también revoca el certificado vuelto a firmar. Si lo desea, elimine la entrada antigua con `certutil -deleterow` e importe el nuevo certificado con `certutil -importcert`.

</details>
{% endstep %}

{% step %}

#### Combinar el certificado firmado

En Azure Key Vault, abra el certificado y seleccione **Operación del certificado** → **Combinar solicitud firmada**. Cargue el certificado emitido. Cuando la combinación se realice correctamente, el certificado aparecerá en **Completado** .

![Opciones de operación de certificados en Azure Key Vault](https://4115997120-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2Fgit-blob-9b845d790796a34cb0e9296434373a502ddfee92%2Fscreenshot-2020-10-19-at-16.01.18%20\(1\)%20\(2\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(1\)%20\(3\).png?alt=media)

{% hint style="warning" %}
El certificado debe usar codificación PEM o Base64. La codificación binaria DER provoca un error `x5c has invalid value` .
{% endhint %}
{% endstep %}

{% step %}

#### Verificar la CA

Abra la página de estado de SCEPman. Compruebe que **Idoneidad de la CA** no indique que falte ningún requisito. Descargue el certificado de la CA intermedia para implementarlo mediante su MDM.

Si SCEPman indica que falta `Key Encipherment` , corrija el certificado emitido y vuelva a combinarlo.
{% endstep %}
{% endstepper %}

### Perfiles SCEP de Intune

* **Android:** haga referencia a la CA raíz.
* **Windows:** haga referencia a la CA intermedia.
* **iOS y macOS:** no hay ninguna recomendación concluyente.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.scepman.com/es/despliegue-de-scepman/intermediate-certificate.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
