diff options
Diffstat (limited to 'src/app/pabc.service.ts')
-rw-r--r-- | src/app/pabc.service.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/app/pabc.service.ts b/src/app/pabc.service.ts new file mode 100644 index 0000000..b3f15d7 --- /dev/null +++ b/src/app/pabc.service.ts | |||
@@ -0,0 +1,28 @@ | |||
1 | import { HttpClient, HttpHeaders } from '@angular/common/http'; | ||
2 | import { Injectable } from '@angular/core'; | ||
3 | import { Observable } from 'rxjs'; | ||
4 | |||
5 | import { NonceParams } from './nonceparams'; | ||
6 | import { ConfigService } from './config.service'; | ||
7 | import { Identity } from './identity'; | ||
8 | |||
9 | @Injectable() | ||
10 | export class PabcService { | ||
11 | |||
12 | constructor(private http: HttpClient, private config: ConfigService) { } | ||
13 | |||
14 | getNonceFromIssuer(issuer: string): Observable<NonceParams> { | ||
15 | return this.http.get<NonceParams>(issuer + '/pabc'); | ||
16 | } | ||
17 | |||
18 | getPrivacyCredential(issuer: string, cr: object): Observable<any> { | ||
19 | return this.http.post<any>(issuer + '/pabc/cr', cr); | ||
20 | } | ||
21 | |||
22 | |||
23 | getCredentialRequest(crMetadata: object) { | ||
24 | return this.http.post<any>(this.config.get().apiUrl + | ||
25 | '/pabc/cr', crMetadata); | ||
26 | } | ||
27 | |||
28 | } | ||