[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

/wp-includes/secrets/ -> interface-wp-secrets-keyring.php (summary)

Secrets API: WP_Secrets_Keyring interface

File Size: 58 lines (2 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

WP_Secrets_Keyring:: (3 methods):
  wrap()
  unwrap()
  get_key_source()


Interface: WP_Secrets_Keyring  - X-Ref

Wraps and unwraps the root key that everything else in this API derives from.

A KMS or HSM lives behind this interface in a production deployment. An
implementation is never handed a plaintext secret, only 32 bytes of key material,
and cannot turn encryption off. There is no method here that
accepts a plaintext secret value at all.

An implementation should run WP_Secrets_Keyring_Conformance against itself before
shipping.

wrap( string $key_material )   X-Ref
Wraps (encrypts) raw key material for storage.

Must not be deterministic: two calls with the same key material must return
different values. WP_Secrets_Key_Manager::rotate_site_key() stores the
re-wrapped value with update_site_option(), which reports an unchanged value
as a failure, and WP_Secrets_Keyring_Conformance checks this.

return: string|WP_Error Opaque wrapped value on success, WP_Error on failure.
param: string $key_material Raw key material to protect.

unwrap( string $wrapped )   X-Ref
Unwraps (decrypts) previously wrapped key material.

return: string|WP_Error Raw key material on success, WP_Error on failure.
param: string $wrapped An opaque value previously returned by wrap().

get_key_source()   X-Ref
A human-readable description of the key source, for Site Health.

return: string



Generated : Wed Oct 14 08:20:33 2026 Cross-referenced by PHPXref