Skip to content

Commit bab5128

Browse files
Updated PublicKeyCredentialParameters to be hashable
1 parent b90a0f4 commit bab5128

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Sources/WebAuthn/Ceremonies/Registration/PublicKeyCredentialCreationOptions.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public struct PublicKeyCredentialCreationOptions: Encodable, Sendable {
7171

7272
// MARK: - Credential parameters
7373
/// From §5.3 (https://w3c.github.io/TR/webauthn/#dictionary-credential-params)
74-
public struct PublicKeyCredentialParameters: Equatable, Encodable, Sendable {
74+
public struct PublicKeyCredentialParameters: Hashable, Encodable, Sendable {
7575
/// The type of credential to be created. At the time of writing always ``CredentialType/publicKey``.
7676
public let type: CredentialType
7777
/// The cryptographic signature algorithm with which the newly generated credential will be used, and thus also
@@ -99,6 +99,13 @@ extension Array where Element == PublicKeyCredentialParameters {
9999
}
100100
}
101101

102+
extension Set where Element == PublicKeyCredentialParameters {
103+
/// A list of `PublicKeyCredentialParameters` WebAuthn Swift currently supports.
104+
public static var supported: Self {
105+
Set([PublicKeyCredentialParameters].supported)
106+
}
107+
}
108+
102109
// MARK: - Credential entities
103110

104111
/// From §5.4.2 (https://www.w3.org/TR/webauthn/#sctn-rp-credential-params).

0 commit comments

Comments
 (0)