<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "applicensedeliverysdk",
  "identifier" : "/documentation/AppLicenseDeliverySDK/ALDSession",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "App License Delivery SDK"
    ],
    "preciseIdentifier" : "s:3ALD10ALDSessionC"
  },
  "title" : "ALDSession"
}
-->

# ALDSession

A structure that contains the details of a license request and methods to generate license responses.

```
class ALDSession
```

## Topics

### Initializers

[`init(request: [UInt8], PASK: [UInt8], encryptionCert: [UInt8], signingCert: [UInt8], signingKey: [UInt8]?) throws`](/documentation/AppLicenseDeliverySDK/ALDSession/init(request:PASK:encryptionCert:signingCert:signingKey:))

Initialize a ALDSession with a license request. Call generateLicense() to create a license.

[`init(signingCert: [UInt8], signingKey: [UInt8]?, PASK: [UInt8]) throws`](/documentation/AppLicenseDeliverySDK/ALDSession/init(signingCert:signingKey:PASK:))

Initialize a static ALDSession without a request. This should only be used when an offline generation of a static license is desired.
A static license is a minimal license that is only used to install apps on the device and is not meant to enforce marketplace defined rights.
Only generateStaticLicense() should be invoked to generate licenses in this case.

### Instance Properties

[`var requestAction: ALDLicenseAction`](/documentation/AppLicenseDeliverySDK/ALDSession/requestAction)

action specified in this request

[`var requestDeviceID: [UInt8]`](/documentation/AppLicenseDeliverySDK/ALDSession/requestDeviceID)

the device ID of the requested device

[`var requestID: UInt64`](/documentation/AppLicenseDeliverySDK/ALDSession/requestID)

requestID of the session

[`var requestTime: UInt64`](/documentation/AppLicenseDeliverySDK/ALDSession/requestTime)

the client time when the request was made

[`var requestVersion: UInt32`](/documentation/AppLicenseDeliverySDK/ALDSession/requestVersion)

request version number

[`var requestedAppleItemIDList: [UInt64]`](/documentation/AppLicenseDeliverySDK/ALDSession/requestedAppleItemIDList)

An array of identifiers for apps that iOS requests a license request for in the session.

[`var requestedLicenseIDList: [UInt64]`](/documentation/AppLicenseDeliverySDK/ALDSession/requestedLicenseIDList)

the list of license ID the client has requested a renwal for. used only when action is “renew”

[`var sessionType: ALDSessionType`](/documentation/AppLicenseDeliverySDK/ALDSession/sessionType)

the current session type

### Instance Methods

[`func finalizeLicenseResponse(licenseResponse: [UInt8], signature: [UInt8]?) throws -> [UInt8]`](/documentation/AppLicenseDeliverySDK/ALDSession/finalizeLicenseResponse(licenseResponse:signature:))

Returns a signed license in a byte array to send in response to a license request from iOS.

[`func generateLicense(attr: ALDLicenseAttribute) throws`](/documentation/AppLicenseDeliverySDK/ALDSession/generateLicense(attr:))

Generates a license based on the provided ALDLicenseAttribute and add it to the session.
Multiple licenses can be generated in this session by callling this function multiple times, they get added to the session response.

[`func generateLicenseResponse() throws -> [UInt8]`](/documentation/AppLicenseDeliverySDK/ALDSession/generateLicenseResponse())

Generates a license response. This method produces a license response, in a bytes array. The response is not yet signed.

[`func generateStaticLicense(licenseID: UInt64, appKey: ALDAppKey) throws`](/documentation/AppLicenseDeliverySDK/ALDSession/generateStaticLicense(licenseID:appKey:))

Generates a static license based on the provided ALDLicenseAttribute. This method produces a static license, in a bytes array.
A static license is a minimal license that is only used to install apps on the device and is not meant to enforce marketplace defined rights.

### Enumerations

[`enum ALDLicenseAction`](/documentation/AppLicenseDeliverySDK/ALDSession/ALDLicenseAction)

The action requested in the license request or provided in the response to one.

[`enum ALDSessionType`](/documentation/AppLicenseDeliverySDK/ALDSession/ALDSessionType)

The type of the license session created.
A normalSession is used for a session created with a license request.
A staticSession is used for session created without a license request

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)