<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AuthenticationServices",
  "identifier" : "/documentation/AuthenticationServices/ASImportableCredential/APIKey",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Authentication Services"
    ],
    "preciseIdentifier" : "s:22AuthenticationServices22ASImportableCredentialO6APIKeyV"
  },
  "title" : "ASImportableCredential.APIKey"
}
-->

# ASImportableCredential.APIKey

A representation of APIKey as defined in the [Credential Exchange Format (CXF) specs](https://fidoalliance.org/specs/cx/cxf-v1.0-rd-20250313.html)

```
struct APIKey
```

## Topics

### Initializers

[`init(key: ASImportableEditableField?, userName: ASImportableEditableField?, keyType: ASImportableEditableField?, url: ASImportableEditableField?, validFrom: ASImportableEditableField?, expiryDate: ASImportableEditableField?)`](/documentation/AuthenticationServices/ASImportableCredential/APIKey/init(key:userName:keyType:url:validFrom:expiryDate:))

### Instance Properties

[`var expiryDate: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/APIKey/expiryDate)

[`var key: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/APIKey/key)

[`var keyType: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/APIKey/keyType)

[`var url: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/APIKey/url)

[`var userName: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/APIKey/userName)

When instantiating from JSON, this property will be populated from the “username” field.

[`var validFrom: ASImportableEditableField?`](/documentation/AuthenticationServices/ASImportableCredential/APIKey/validFrom)

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Encodable`](/documentation/Swift/Encodable)

[`Equatable`](/documentation/Swift/Equatable)

[`Decodable`](/documentation/Swift/Decodable)

[`Hashable`](/documentation/Swift/Hashable)

[`Sendable`](/documentation/Swift/Sendable)

---

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)