Java
Java 17+, on the JDK HttpClient. No third-party HTTP dependency. Wire 8.0 from 0.2.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.
pom.xmlxml
<dependency>
<groupId>io.rootherald</groupId>
<artifactId>rootherald-client</artifactId>
<version>x.y.z</version> <!-- assigned at first release -->
</dependency>The calls
RootHeraldClient.builder().secretKey(…).baseUrl(…).build()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 withIllegalArgumentException.issueChallenge(ChallengeOptions.defaults().ask(ASK_IDENTITY, ASK_POSTURE).expectedDevices(…))→Challenge(nonce, challenge, expiresAt).verify(evidenceJson, AttestOptions.of(nonce).expectedDevices(…))→AttestResult(verdict, verdictNode, assuranceClaimsMet, enrollmentRequired, expected);isPass(); a verdict that does not echo the binding isExpectedNotEnforcedException.issueKeyChallenge(KeyChallengeOptions.of(purpose).expectedDevices(…)), withPURPOSE_SIGNorPURPOSE_DECRYPT, →KeyChallenge(nonce, keyChallenge, expiresAt);certifyKey(nonce, certificationJson)→CertifiedKey(deviceId, keyId, purpose, alg, format, jwk, hardwareBound, certifiedAt).KeySignatures.verifyKeySignature(jwk, message, signature)— ES256 or RS256 by the JWK,java.security, raw or DER.DeviceEncryption.encryptToDevice(key, plaintext)→ the JWE compact serialization as aString. ECDH-ES for an EC key, RSA-OAEP-256 for an RSA key, A256GCM for both, withjavax.cryptoand no Root Herald call. A sign key isIllegalArgumentException; a macOSapple-ecieskey isEnvelopeFormatNotSupportedException.- Exceptions in
io.rootherald:InvalidSecretKeyException,ChallengeException,InvalidEvidenceException,InvalidAskException,UnknownPolicyException,AdmissionRefusedException,QuotaExceededException,ActivationRefusedException,RateLimitedException; baseRootHeraldApiExceptioncarries the other codes. Each is an error code in the API reference.