AssociateMacSecKey

Updated at:

Associates a MACsec key with a dedicated Express Connect circuit port. This implements low-latency encryption and decryption by using dedicated encryption chips such as NICs or switches to directly encrypt the physical link, such as optical fiber or Ethernet, and covers all traffic from the sender to the receiver.

Operation description

You must meet the following prerequisites to use this feature:

  • The device where the Express Connect circuit is located supports the MACsec feature.

  • Payment for the Express Connect circuit is completed.

  • Only dedicated Express Connect circuits are supported.

Note the following:

  • You can configure up to three sets of Ckn and Cak.

  • Associating a key that is currently in the Disassociated state disassociates the previously effective key.

  • Associating a key that is currently in the AssociatedFailed state triggers the device to renegotiate the session.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

vpc:AssociateMacSecKey

update

*PhysicalConnection

acs:vpc:{#regionId}:{#accountId}:physicalconnection/{#PhysicalConnectionId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the Express Connect circuit.

You can call the DescribeRegions operation to query the region ID.

cn-hangzhou

PhysicalConnectionId

string

Yes

The ID of the Express Connect circuit. The Express Connect circuit must be a dedicated circuit that is paid, supports MACsec on the device, and is in the Enabled state. You can call the DescribePhysicalConnections operation to query the current state and device capabilities.

pc-bp1hp0wr072f6****

CipherSuite

string

Yes

The encryption algorithm type. Valid values:

  • GCM-AES-128

  • GCM-AES-XPN-128

  • GCM-AES-256

  • GCM-AES-XPN-256

GCM-AES-128

Ckn

string

Yes

The key name. Only hexadecimal characters are supported. Lowercase letters are automatically converted to uppercase letters. If the encryption algorithm type is GCM-AES-128 or GCM-AES-XPN-128, the length must be 32 hexadecimal characters. If the encryption algorithm type is GCM-AES-256 or GCM-AES-XPN-256, the length must be 64 hexadecimal characters.

0123456789ABCDEF0123456789ABCDEF

Cak

string

Yes

The passphrase. Only hexadecimal characters are supported. Lowercase letters automatically transform to uppercase letters. If the encryption algorithm type is GCM-AES-128 or GCM-AES-XPN-128, the length must be 32 hexadecimal characters. If the encryption algorithm type is GCM-AES-256 or GCM-AES-XPN-256, the length must be 64 hexadecimal characters.

0123456789ABCDEF0123456789ABCDEF

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

D32B3C26-6C6C-4988-93E9-D2A6444CE6AE

Examples

Success response

JSON format

{
  "RequestId": "D32B3C26-6C6C-4988-93E9-D2A6444CE6AE"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.%s The param of %s is illegal. The parameter is invalid.
400 ResourceNotFound.PhysicalConnectionId The specified resource of [%s] is not found. The Express Connect circuit does not exist.
400 IncorrectStatus.PhysicalConnection The status of %s [%s] is incorrect. The status of the physical connection does not support this operation.
400 UnsupportedFeature.Macsec The feature of Macsec is not supported. The current physical connection does not support the MACSec feature.
400 IncorrectStatus.PconnMacsec The status of %s [%s] is incorrect. The operation is not allowed because the MACSec key is in an unstable state.
400 QuotaExceeded.PconnMacsec The quota of PconnMacsec is exceeded, usage 3/3. A physical connection supports binding up to three sets of MACSec keys.
400 UnsupportedFeature.Macsec.CipherSuite The feature of Macsec.CipherSuite is not supported. The current physical connection supports MACSec, but does not support the selected encryption algorithm.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.