{
  "$comment": "GENERATED by TimeBasedOneTimePasswords/tools/generate-test-vectors.py (OpenChargingTechnology/Whitepapers) - do not edit by hand. Regenerate by rerunning the generator.",
  "specification": "Open Charging Technology TOTP HTTP Authentication 1.0 (draft)",
  "description": "Server-side verification of the 'Authorization: TOTP' scheme (sections 5.3, 6.2 and 8): a verifier holding 'verifier.logins' (login -> TOTP configuration; absent optional parameters mean the verifier's own defaults, an absent 'tlsChannelBinding' raw tokens) at the clock 'verifier.unixTimestampMillis' receives 'authorization' (null: no header) and answers 'accepted' (the request is authenticated as 'login'), 'rejected' (401; an unknown login is indistinguishable from a wrong token) or 'malformed' (400, or 401: a server MAY treat malformed as failed). The verifier has no TLS exporter material, so it rejects every token of a login whose configuration asks for channel binding, never verifying one as raw; no presented token is bound, so a verifier with exporter material reaches the same outcomes. The clock lies at least 10s before the end of its slot for every login, so a harness setting a live server's clock may lag that much. The whole file requires the listed capabilities; harnesses without them skip it declaratively.",
  "requires": [
    "httpVerification"
  ],
  "verifier": {
    "unixTimestampMillis": 1716423785000,
    "logins": {
      "chargingstation-0001": {
        "sharedSecret": "secure!Charging!"
      },
      "chargingstation-0002": {
        "sharedSecret": "another!Station!"
      },
      "EVSE:DE*GEF*E1234*1": {
        "sharedSecret": "Lades\u00e4ule-S\u00fcd-01",
        "validityTimeSeconds": 60,
        "totpLength": 16,
        "alphabet": "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",
        "hashAlgorithm": "sha512"
      },
      "chargingstation-0003": {
        "sharedSecret": "bound!Station!03",
        "tlsChannelBinding": true
      }
    }
  },
  "vectors": [
    {
      "id": "accept-current",
      "description": "The current token of the login's configuration.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\"",
      "expected": {
        "outcome": "accepted",
        "login": "chargingstation-0001"
      }
    },
    {
      "id": "accept-previous",
      "description": "The previous slot's token: one slot of clock skew or transmission delay.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"TWRQVTBqQ201dFh6\"",
      "expected": {
        "outcome": "accepted",
        "login": "chargingstation-0001"
      }
    },
    {
      "id": "accept-next",
      "description": "The next slot's token: a client clock one slot ahead.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"ZEk1NHZuQTI1bTJo\"",
      "expected": {
        "outcome": "accepted",
        "login": "chargingstation-0001"
      }
    },
    {
      "id": "reject-two-slots-old",
      "description": "A token two slots old is outside the window - which is never widened.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"bmwwaUFCVm82alJZ\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-two-slots-ahead",
      "description": "A token two slots ahead is outside the window.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"MndoMTVTaE9Ybmkz\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "accept-non-default-configuration",
      "description": "The previous slot under a login's own configuration (60s, 16 characters, Base32, HMAC-SHA512, a non-ASCII secret); the login contains a colon.",
      "authorization": "TOTP login=\"RVZTRTpERSpHRUYqRTEyMzQqMQ==\", totp=\"Rk5QRFdUQk5IU0JMUE1OUA==\"",
      "expected": {
        "outcome": "accepted",
        "login": "EVSE:DE*GEF*E1234*1"
      }
    },
    {
      "id": "reject-non-default-configuration-two-slots-old",
      "description": "Two slots of 60 seconds old: the window is counted in the login's slots.",
      "authorization": "TOTP login=\"RVZTRTpERSpHRUYqRTEyMzQqMQ==\", totp=\"QzZLR0RINkJWQ0JSVjZBRA==\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "accept-second-login",
      "description": "Another login, verified against its own configuration.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDI=\", totp=\"MHNIVEg0UXpwVmxM\"",
      "expected": {
        "outcome": "accepted",
        "login": "chargingstation-0002"
      }
    },
    {
      "id": "reject-token-of-another-login",
      "description": "Another login's current token is no token of this login.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"MHNIVEg0UXpwVmxM\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-unknown-login",
      "description": "An unknown login is rejected exactly like a wrong token - with a token that is valid for a known login.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTk5OTk=\", totp=\"Q042M3k1MDJtYVZo\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-other-hash-algorithm",
      "description": "The current token under HMAC-SHA512 is no token of a login configured for HMAC-SHA256.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"eUJoVFRiWE8ySUxk\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-token-prefix",
      "description": "The first 11 characters of the current token.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVY=\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-token-extended",
      "description": "The current token of length 13 - which starts with the length 12 token, as every longer token of the slot does.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZoQQ==\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-token-case-altered",
      "description": "The current token with the case of its first character changed: tokens are compared exactly.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Y042M3k1MDJtYVZo\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-token-with-whitespace",
      "description": "The current token with a leading space inside the Base64: compared exactly, never trimmed.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"IENONjN5NTAybWFWaA==\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-raw-token-of-bound-login",
      "description": "The current raw token of a login whose configuration asks for channel binding: such a login takes no raw token - and a verifier without exporter material verifies no bound one.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDM=\", totp=\"NkVsM01sWFVzMkRU\"",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "reject-bound-login-with-earlier-draft-tlscb-false",
      "description": "The same with tlscb=false of earlier drafts: an unknown parameter, ignored - a client cannot talk the binding down.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDM=\", totp=\"NkVsM01sWFVzMkRU\", tlscb=false",
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "accept-earlier-draft-tlscb-true-ignored",
      "description": "The current raw token with tlscb=true of earlier drafts: an unknown parameter, ignored - the login's configuration says raw.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", tlscb=true",
      "expected": {
        "outcome": "accepted",
        "login": "chargingstation-0001"
      }
    },
    {
      "id": "accept-lenient-casing",
      "description": "Scheme and parameter names are matched case-insensitively.",
      "authorization": "totp LOGIN=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", TOTP=\"Q042M3k1MDJtYVZo\"",
      "expected": {
        "outcome": "accepted",
        "login": "chargingstation-0001"
      }
    },
    {
      "id": "accept-unknown-parameter",
      "description": "An unknown parameter is ignored.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", realm=\"ocpp\"",
      "expected": {
        "outcome": "accepted",
        "login": "chargingstation-0001"
      }
    },
    {
      "id": "reject-no-authorization",
      "description": "No Authorization header at all.",
      "authorization": null,
      "expected": {
        "outcome": "rejected"
      }
    },
    {
      "id": "malformed-missing-totp",
      "description": "The totp parameter is mandatory.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\"",
      "expected": {
        "outcome": "malformed"
      }
    },
    {
      "id": "malformed-empty-totp",
      "description": "An empty token.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"\"",
      "expected": {
        "outcome": "malformed"
      }
    },
    {
      "id": "malformed-duplicate-totp-valid-first",
      "description": "A valid token followed by a second totp parameter: ambiguous, so malformed - never the first one wins.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Q042M3k1MDJtYVZo\", totp=\"Y042M3k1MDJtYVZo\"",
      "expected": {
        "outcome": "malformed"
      }
    },
    {
      "id": "malformed-duplicate-totp-valid-last",
      "description": "The same with the valid token last - never the last one wins.",
      "authorization": "TOTP login=\"Y2hhcmdpbmdzdGF0aW9uLTAwMDE=\", totp=\"Y042M3k1MDJtYVZo\", totp=\"Q042M3k1MDJtYVZo\"",
      "expected": {
        "outcome": "malformed"
      }
    }
  ]
}
