<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "OpenSSL",
  "identifier" : "/documentation/OpenSSL/Base64URL",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "OpenSSL"
    ],
    "preciseIdentifier" : "s:7OpenSSL9Base64URLO"
  },
  "title" : "Base64URL"
}
-->

# Base64URL

Namespace for URL-safe unpadded Base64 encoding (base64url).

```
enum Base64URL
```

## Overview

`Base64URL` implements the URL-safe, unpadded alphabet defined in
[RFC 4648 §5](https://datatracker.ietf.org/doc/html/rfc4648#section-5).
The alphabet swaps `+` for `-` and `/` for `_` relative to standard
Base64, and strips the trailing `=` padding — producing strings that
can be embedded directly in URLs, HTTP headers, JSON values, and
filename segments without further escaping.

This encoding is the canonical transport form for JOSE (JWS per
[RFC 7515](https://datatracker.ietf.org/doc/html/rfc7515) and JWT per
[RFC 7519](https://datatracker.ietf.org/doc/html/rfc7519)),
[WebAuthn](https://www.w3.org/TR/webauthn-3/) credential blobs,
[Nostr NIP-19](https://github.com/nostr-protocol/nips/blob/master/19.md)
identifiers, and DID documents. The namespace is caseless; call
[`encode(_:)`](/documentation/OpenSSL/Base64URL/encode(_:)) and [`decode(_:)`](/documentation/OpenSSL/Base64URL/decode(_:)) as `static` entry points.

> Note: This namespace is pure Swift on top of Foundation’s
> `Data(base64Encoded:)` / `base64EncodedString()`. It does **not**
> call into `libcrypto` and is not constant-time — do not feed it
> secret-dependent material that needs side-channel resistance.

> SeeAlso: ``doc://OpenSSL/documentation/OpenSSL/Base64URL/encode(_:)``, ``doc://OpenSSL/documentation/OpenSSL/Base64URL/decode(_:)``