<!--
{
  "availability" : [

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

# OpenSSLError

The unified error type thrown by every `OpenSSL` Swift API.

```
enum OpenSSLError
```

## Overview

`OpenSSLError` is the single failure surface for this module. Each case
carries a human-readable `String` that describes the specific failure
condition; the string is surfaced verbatim by [`errorDescription`](/documentation/OpenSSL/OpenSSLError/errorDescription) to
Foundation’s `LocalizedError` machinery, so it can be displayed in
logs, alerts, or error UI without further processing.

Instances are produced exclusively by this package’s Swift code — no
raw `ERR_get_error()` C values bleed through. Equality compares the
case *and* the associated `String`, which is convenient for tests but
means the `String` contents are part of the observable API contract
for those tests.

> Note: Some cases are reserved for future API surface
> (``doc://OpenSSL/documentation/OpenSSL/OpenSSLError/signingFailed(_:)``,
> ``doc://OpenSSL/documentation/OpenSSL/OpenSSLError/verificationFailed(_:)``,
> ``doc://OpenSSL/documentation/OpenSSL/OpenSSLError/invalidSignature(_:)``) and are not produced by any
> code path shipping today. They exist so adding the corresponding
> operations later is non-breaking for consumers who already pattern-
> match on the full case list.

> SeeAlso: ``doc://OpenSSL/documentation/OpenSSL/RSA/PrivateKey/init(pemRepresentation:)``,
> ``doc://OpenSSL/documentation/OpenSSL/SHA256/SHA256Digest/init(rawValue:)``,
> [Foundation `LocalizedError`](https://developer.apple.com/documentation/foundation/localizederror)