PHP
PHP 8.1+, on ext-curl and ext-openssl. No Guzzle. Wire 8.0.
In development
This SDK is implemented but not yet published to its package registry. Until it ships, collect an opaque evidence blob on the device and appraise it server-side with @rootherald/node (or any available server SDK). The API shown below is the planned surface and may change before release.
terminalbash
composer require rootherald/rootheraldThe calls
new Rootherald\Client(secretKey: …, baseUrl: …)relayEnroll($blob)→ the 201 body for the device'sEnrollComplete/relayActivate($activation)→deviceId. A flat TPM body is the 7.0 shape and is refused locally with\InvalidArgumentException.issueChallenge(ask: [Client::ASK_IDENTITY, …], expectedKey: …, expectedDevices: …)→Challengewith->nonce,->challenge. Named arguments only.verify($evidence, $nonce, expectedKey: …, expectedDevices: …)→AttestResult:->verdict(Verdict::PASS | WARN | FAIL),->verdictData,->enrollmentRequired,->assuranceClaimsMet,device(),expected().issueKeyChallenge($purpose, expectedDevices: …), withClient::PURPOSE_SIGNorClient::PURPOSE_DECRYPT, →KeyChallengewith->nonce,->keyChallenge;certifyKey($certification, $nonce)→CertifiedKeywith->deviceId,->keyId,->alg,->format,->jwk,->hardwareBound.KeySignatures::verify($jwk, $message, $signature): bool— ES256 or RS256 by the JWK, raw or DER.DeviceEncryption::encryptToDevice($key, $plaintext): string— the JWE compact serialization only that device opens: ECDH-ES for an EC key, RSA-OAEP-256 for an RSA key, A256GCM for both, on ext-openssl with no Root Herald call.$keyis theCertifiedKeyfromcertifyKey. A sign key is\InvalidArgumentException; a macOSapple-ecieskey isEnvelopeFormatNotSupportedException, a subclass of it.- Exceptions in
Rootherald\Exceptions:InvalidSecretKeyException,ChallengeException,InvalidEvidenceException,InvalidAskException,UnknownPolicyException,AdmissionRefusedException,QuotaExceededException,ActivationRefusedException,RateLimitedException,ExpectedNotEnforcedException; other codes are anHttpExceptionwith$serverErrorpreserved. Each is an error code in the API reference.