---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/mtls](../index.md) / validateCodeUploadCaCertificate

# Function: validateCodeUploadCaCertificate()

> **validateCodeUploadCaCertificate**(`certificatePem`): `void`

Defined in: [packages/b2c-tooling-sdk/src/operations/mtls/index.ts:322](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/bceb8da43dd8bc63d57932bbd905d36a1b40c949/packages/b2c-tooling-sdk/src/operations/mtls/index.ts#L322)

Validates that a PEM certificate can be uploaded as a code upload CA.

The CA certificate bundle is allowed a maximum expiry of 1 year
([MAX\_CODE\_UPLOAD\_CA\_VALIDITY\_DAYS](../variables/MAX_CODE_UPLOAD_CA_VALIDITY_DAYS.md) days); before it expires it must be
renewed to avoid disruption with code uploads.

## Parameters

### certificatePem

`string`

PEM-encoded CA certificate

## Returns

`void`

## Throws

Error if the certificate can't be parsed, isn't a CA, is expired, or is valid for more than 1 year
