Class MapIssuerKeyRegistry
java.lang.Object
xyz.tcheeric.cashu.voucher.app.adapter.MapIssuerKeyRegistry
- All Implemented Interfaces:
IssuerKeyRegistry
An
IssuerKeyRegistry backed by a fixed map of issuer id to public key.
Enough for the common case: a merchant application that knows its own issuer id and signing key from configuration. Deployments serving many issuers should implement the port against whatever already holds that mapping rather than growing this class.
Issuer ids are matched case-insensitively, and keys are compared that way too, because hex is written both ways in practice and a case difference is not a different key.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MapIssuerKeyRegistryA registry holding a single issuer, the usual shape for one merchant.publicKeyFor(String issuerId) The public key registered for an issuer.
-
Constructor Details
-
MapIssuerKeyRegistry
-
-
Method Details
-
of
public static MapIssuerKeyRegistry of(@NonNull @NonNull String issuerId, @NonNull @NonNull String publicKeyHex) A registry holding a single issuer, the usual shape for one merchant. -
publicKeyFor
Description copied from interface:IssuerKeyRegistryThe public key registered for an issuer.- Specified by:
publicKeyForin interfaceIssuerKeyRegistry- Parameters:
issuerId- the issuer identifier claimed by a voucher- Returns:
- the hex-encoded public key, or empty when the issuer is unknown
-