---
id: "ssh_public_key"
kind: "datatype"
status: "draft"
is_pii: false
categories: ["cryptography"]
langs: ["common"]
quality: 75
url: "http://registry.apicrafter.io/datatype/ssh_public_key"
---

# SSH public key (OpenSSH format) (`ssh_public_key`)

> **Draft.** Draft records have not been reviewed yet and may be incomplete or wrong; do not treat them as authoritative for legal or compliance decisions.

Public key in the one-line OpenSSH format of authorized_keys and known_hosts files: the key type (ssh-ed25519, ecdsa-sha2-nistp256, ssh-rsa and others), a space, the Base64 of the RFC 4253 key blob and an optional comment, often user@host. The multi-line RFC 4716 format (---- BEGIN SSH2 PUBLIC KEY ----) and authorized_keys options before the key type are not covered.

- Personal data (PII): no
- Categories: Cryptographic identifiers (cryptography)
- Countries: global
- Languages: Common to most languages (common)

## Detection

Regular expression (Python `re`):

```
^(?:ssh-(?:ed25519|ed448|rsa|dss)|ecdsa-sha2-nistp(?:256|384|521)|sk-(?:ssh-ed25519|ecdsa-sha2-nistp256)@openssh\.com) AAAA[0-9A-Za-z+/]+={0,2}(?: [^\r\n]*)?$
```

## Examples

- `ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOMqqnkVzrm0SdG6UOoqKLsabgH5C9okWi0dh2l9GKJl` — Ed25519 host key of github.com, published by GitHub
- `ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBEmKSENjQEezOmxkZMy7opKgwFB9nkt5YRrYMjNuG5N87uRgg6CLrbo5wAdT/y6v0mKV0U2w0WZ2YB/++Tpockg=` — ECDSA host key of github.com, published by GitHub
- `SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU` (invalid example) — Fingerprint of the Ed25519 key, not the key

## Sources

- doc: <https://man.openbsd.org/sshd#AUTHORIZED_KEYS_FILE_FORMAT>
- doc: <https://www.rfc-editor.org/rfc/rfc4253#section-6.6>
- other: <https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/githubs-ssh-key-fingerprints>

## Quality

Score 75/100. Missing: mapping (Wikidata, Schema.org, ...), translation, detector coverage.

JSON: <http://registry.apicrafter.io/api/v1/datatypes/ssh_public_key.json> · Edit: <https://github.com/apicrafter/metacrafter-registry/edit/main/data/datatypes/any/cryptography/ssh_public_key.yaml>
