open-nav
    Preparing search index...

    Function decodeExchangeToken

    • Decrypt the encodedExchangeToken returned by tokenExchange.

      NAV encrypts the 16 character exchange token with AES-128 in ECB mode using the technical user's exchange key (csereklucs / "XML aláírás kulcs" pair) as the raw key, then base64 encodes the result. Padding is optional in practice: NAV historically returned an unpadded 16 byte block, while some environments return a PKCS#7 padded 32 byte block, so both are accepted.

      Parameters

      • encodedToken: string

        base64 payload from the response

      • exchangeKey: string

        16 character exchange key of the technical user

      Returns string