diff options
author | Florian Dold <florian.dold@gmail.com> | 2020-03-13 19:04:16 +0530 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2020-03-13 19:04:16 +0530 |
commit | 1744b1a80063397105081a4d5aeec76936781345 (patch) | |
tree | 53399350dba33fd6e7c916b3c177e36ff7e283f9 /src/types/talerTypes.ts | |
parent | 51eef5419a37187f437115316a00ceec91e4addb (diff) | |
download | wallet-core-1744b1a80063397105081a4d5aeec76936781345.tar.xz |
signature verification for recoup
Diffstat (limited to 'src/types/talerTypes.ts')
-rw-r--r-- | src/types/talerTypes.ts | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/types/talerTypes.ts b/src/types/talerTypes.ts index 2ecb82340..569b93120 100644 --- a/src/types/talerTypes.ts +++ b/src/types/talerTypes.ts @@ -599,6 +599,17 @@ export class Recoup { } /** + * Structure of one exchange signing key in the /keys response. + */ +export class ExchangeSignKeyJson { + stamp_start: Timestamp; + stamp_expire: Timestamp; + stamp_end: Timestamp; + key: EddsaPublicKeyString; + master_sig: EddsaSignatureString; +} + +/** * Structure that the exchange gives us in /keys. */ export class ExchangeKeysJson { @@ -631,7 +642,7 @@ export class ExchangeKeysJson { * Short-lived signing keys used to sign online * responses. */ - signkeys: any; + signkeys: ExchangeSignKeyJson[]; /** * Protocol version. @@ -881,6 +892,17 @@ export const codecForRecoup = () => .build("Payback"), ); +export const codecForExchangeSigningKey = () => + typecheckedCodec<ExchangeSignKeyJson>( + makeCodecForObject<ExchangeSignKeyJson>() + .property("key", codecForString) + .property("master_sig", codecForString) + .property("stamp_end", codecForTimestamp) + .property("stamp_start", codecForTimestamp) + .property("stamp_expire", codecForTimestamp) + .build("ExchangeSignKeyJson"), + ); + export const codecForExchangeKeysJson = () => typecheckedCodec<ExchangeKeysJson>( makeCodecForObject<ExchangeKeysJson>() @@ -889,7 +911,7 @@ export const codecForExchangeKeysJson = () => .property("auditors", makeCodecForList(codecForAuditor())) .property("list_issue_date", codecForTimestamp) .property("recoup", makeCodecOptional(makeCodecForList(codecForRecoup()))) - .property("signkeys", codecForAny) + .property("signkeys", makeCodecForList(codecForExchangeSigningKey())) .property("version", codecForString) .build("KeysJson"), ); @@ -981,10 +1003,9 @@ export const codecForRecoupConfirmation = () => .build("RecoupConfirmation"), ); - export const codecForWithdrawResponse = () => typecheckedCodec<WithdrawResponse>( makeCodecForObject<WithdrawResponse>() .property("ev_sig", codecForString) .build("WithdrawResponse"), - );
\ No newline at end of file + ); |