Ruby
Ruby 3.1+. Depends only on faraday. Wire 8.0 from 0.7.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.
Gemfileruby
gem "rootherald"The calls
RootHerald::Client.new(secret_key:, base_url:)relay_enroll(blob)→ the 201 body for the device'sEnrollComplete/relay_activate(activation)→device_id. A flat TPM body is the 7.0 shape and is refused locally withArgumentError.issue_challenge(ask: %w[identity posture], expected_key:, expected_devices:)→Challengewithnonce,challenge.verify(evidence, nonce:, expected_key:, expected_devices:)→AttestResult:verdict(:pass | :warn | :fail),device,device_id,expected,enrollment_required,assurance_claims_met.issue_key_challenge(purpose:, expected_devices:), with"sign"or"decrypt", →KeyChallengewithnonce,key_challenge;certify_key(certification, nonce:)→CertifiedKeywithdevice_id,key_id,alg,format,jwk,hardware_bound.RootHerald::KeySignatures.verify(jwk, message, signature)— ES256 or RS256 by the JWK,OpenSSL, raw or DER.RootHerald::DeviceEncryption.encrypt_to_device(key, plaintext)→ the JWE compact serialization only that device opens: ECDH-ES for an EC key, RSA-OAEP-256 for an RSA key, A256GCM for both, withOpenSSLand no Root Herald call.keyis theCertifiedKeyfromcertify_key. A sign key isArgumentError; a macOSapple-ecieskey isEnvelopeFormatNotSupportedError, a subclass of it.- Errors:
InvalidSecretKeyError,ChallengeError,InvalidEvidenceError,InvalidAskError,UnknownPolicyError,AdmissionRefusedError,QuotaExceededError,ActivationRefusedError,RateLimitedError,ExpectedNotEnforcedError; baseRootHerald::HttpErrorcarries the other codes. Each is an error code in the API reference.