You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/SwiftJWT/JWTError.swift
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ public struct JWTError: Error, Equatable {
27
27
privateletinternalError:InternalError
28
28
29
29
privateenumInternalError{
30
-
case invalidJWTString, failedVerification, osVersionToLow, invalidPrivateKey, invalidData, invalidKeyID
30
+
case invalidJWTString, failedVerification, osVersionToLow, invalidPrivateKey, invalidData, invalidKeyID, missingPEMHeaders
31
31
}
32
32
33
33
/// Error when an invalid JWT String is provided
@@ -48,6 +48,9 @@ public struct JWTError: Error, Equatable {
48
48
/// Error when the KeyID field `kid` in the JWT header fails to generate a JWTSigner or JWTVerifier
49
49
publicstaticletinvalidKeyID=JWTError(localizedDescription:"The JWT KeyID `kid` header failed to generate a JWTSigner/JWTVerifier", internalError:.invalidKeyID)
50
50
51
+
/// Error when a PEM string is provided without the expected PEM headers/footers. (e.g. -----BEGIN PRIVATE KEY-----)
52
+
publicstaticletmissingPEMHeaders=JWTError(localizedDescription:"The provided key did not have the expected PEM headers/footers", internalError:.missingPEMHeaders)
53
+
51
54
/// Function to check if JWTErrors are equal. Required for equatable protocol.
0 commit comments