|
22 | 22 | from aries_cloudcontroller.model.did_endpoint_with_type import DIDEndpointWithType |
23 | 23 | from aries_cloudcontroller.model.did_list import DIDList |
24 | 24 | from aries_cloudcontroller.model.did_result import DIDResult |
| 25 | +from aries_cloudcontroller.model.jws_create import JWSCreate |
| 26 | +from aries_cloudcontroller.model.jws_verify import JWSVerify |
| 27 | +from aries_cloudcontroller.model.jws_verify_response import JWSVerifyResponse |
25 | 28 |
|
26 | 29 |
|
27 | 30 | class WalletApi(Consumer): |
@@ -99,6 +102,26 @@ async def set_public_did( |
99 | 102 | mediation_id=mediation_id, |
100 | 103 | ) |
101 | 104 |
|
| 105 | + async def wallet_jwt_sign_post( |
| 106 | + self, *, body: Optional[JWSCreate] = None |
| 107 | + ) -> Dict[str, Any]: |
| 108 | + """Create a EdDSA jws using did keys with a given payload""" |
| 109 | + if not body: |
| 110 | + body = JWSCreate() |
| 111 | + return await self.__wallet_jwt_sign_post( |
| 112 | + body=body, |
| 113 | + ) |
| 114 | + |
| 115 | + async def wallet_jwt_verify_post( |
| 116 | + self, *, body: Optional[JWSVerify] = None |
| 117 | + ) -> JWSVerifyResponse: |
| 118 | + """Verify a EdDSA jws using did keys with a given JWS""" |
| 119 | + if not body: |
| 120 | + body = JWSVerify() |
| 121 | + return await self.__wallet_jwt_verify_post( |
| 122 | + body=body, |
| 123 | + ) |
| 124 | + |
102 | 125 | @returns.json |
103 | 126 | @json |
104 | 127 | @post("/wallet/did/create") |
@@ -156,3 +179,19 @@ def __set_public_did( |
156 | 179 | mediation_id: Query = None |
157 | 180 | ) -> DIDResult: |
158 | 181 | """Internal uplink method for set_public_did""" |
| 182 | + |
| 183 | + @returns.json |
| 184 | + @json |
| 185 | + @post("/wallet/jwt/sign") |
| 186 | + def __wallet_jwt_sign_post( |
| 187 | + self, *, body: Body(type=JWSCreate) = {} |
| 188 | + ) -> Dict[str, Any]: |
| 189 | + """Internal uplink method for wallet_jwt_sign_post""" |
| 190 | + |
| 191 | + @returns.json |
| 192 | + @json |
| 193 | + @post("/wallet/jwt/verify") |
| 194 | + def __wallet_jwt_verify_post( |
| 195 | + self, *, body: Body(type=JWSVerify) = {} |
| 196 | + ) -> JWSVerifyResponse: |
| 197 | + """Internal uplink method for wallet_jwt_verify_post""" |
0 commit comments