# XML Tags for the Hasp.Transfer Method

This topic describes the Transfer method XML tags that are used to:

>specify parameters for a detachable license or to cancel a detachable license. A detached license for a Product includes:

•Features in the Product that are defined as detachable.

•The contents of license memory that belong to the Product.

>specify parameters for transferring a Sentinel protection key from one computer to another.

The hasp_transfer XML tags are described below.

## Scope XML Tag

Use the scope input tags to specify the license that will be detached.

## Detach XML Tag

Provide details for a single detached license that can be used locally on the recipient machine. The detach XML tag can be empty, or can be used to specify the Product ID and duration of a detached license.

If the detach XML tag is empty, the license specified in the scope is detached for 24 hours.

Use the following syntax:

    <detach>
      <product id="productID">
        <duration>seconds</duration>
      </product>
    </detach>

The variables used in the tags above are as follows:

Variable | Description
--- | ---
`productID` | Product ID of the Product to detach
`seconds` | Duration of the detached license, in seconds. If the <duration> tag is not provided, default value is 86,400 (24 hours).

## Network Detach XML Tag

Provide details for a detached license with concurrency (one or more network seats). Each seats can be used locally on the recipient machine or consumed by protected application on a different machine in the LAN. The detach XML tag is used to specify the Product ID, number of seats, and duration of a detached license.

For more information, see Detaching a License With Concurrency.

Use the following syntax:

    <network_detach>
      <product id="productID">
        <duration>seconds</duration>
        <seats>numberOfSeats</seats>
      </product>
    </network_detach>

The variables used in the tags above are as follows:

Variable | Description
--- | ---
`productID` | Product ID of the Product to detach
`seconds` | Duration of the detached license, in seconds. If the <duration> tag is not provided, default value is 86,400 (24 hours).
`numberOfSeats` | Number of seats (with concurrency) in the detached license. If the <seats> tag is not provided, default value is 1. Note the following: >The value specified must be 1 or greater. > The value specified must not exceed the number of seats available in the license. >If you are using the <network_seats> tag to change the value for seats that were detached earlier, specify the new total number of detached seats. You can only increase, not decrease, the number of detached seats.

## Examples

>The following example specifies that a detached license for Product ID 12345 will expire after 604,800 seconds (one week):

    <detach>
      <product id="12345">
        <duration>604800</duration>
      </product>
    </detach>

>The following example specifies that 10 detached seats with concurrency for Product ID 84235 will expire after 31,449,600 seconds (one year):

    <network_detach>
      <product id="84235">
        <duration>31449600</duration>
        <seats>10</seats>
      </product>
    </network_detach>

## Cancel XML Tag

The cancel XML tag can be used to cancel a detached license, and thus return the license or network seats to the pool earlier than the scheduled expiration of the detached license.

Use the following syntax:

    <cancel>
      <hasp id="haspID"/>
    </cancel>

where haspID is the Key ID of the detached license to be canceled.

## Recipient XML Tag

Use either the GetInfo or GetSessionInfo method, together with the HASP_RECIPIENT predefined format template, to retrieve the recipient information.

## Rehost XML Tag

The rehost XML tag is used to specify the Sentinel protection key that will be transferred from one computer to another.

Use the following syntax:

    <rehost>
      <hasp id="haspID"/>
    </rehost>

where haspID is the Key ID of the protection key to transfer.

To rehost a protection key from one computer to another, use the following sequence of API calls:

1.Install the protected application on the machine to receive the protection key (recipient machine).

2.On the recipient machine, call the GetInfo method to generate recipient information of the machine. Save this information to a disk file.

3.On the machine that contains the protection key (source machine), call the Transfer method and pass the recipient information. This generates an H2H file and removes the protection key from the source machine.

On the recipient machine, call the Update method to apply the H2H file. This installs the protection key on the recipient machine.

##
Related Topics

Transfer Method

About XML Tags

Scope Input XML Tags

Format XML Tags