File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -424,7 +424,7 @@ class OpenEnterpriseAPI: Ability {
424
424
)
425
425
] ) ,
426
426
name: " proof_req_1 " ,
427
- nonce: " 1103253414365527824079144 " ,
427
+ nonce: Utils . generateNonce ( length : 25 ) ,
428
428
version: " 1.0 "
429
429
)
430
430
@@ -447,7 +447,6 @@ class OpenEnterpriseAPI: Ability {
447
447
default :
448
448
throw Error . WrongResponse ( response)
449
449
}
450
-
451
450
}
452
451
453
452
func getPresentation( _ presentationId: String ) async throws -> Components . Schemas . PresentationStatus {
Original file line number Diff line number Diff line change
1
+ import Foundation
2
+ import XCTest
3
+
4
+ class Utils {
5
+ static func generateNonce( length: Int ) -> String {
6
+ var result : String = " "
7
+
8
+ while ( result. count < length) {
9
+ var randomByte : UInt8 = 0
10
+ _ = SecRandomCopyBytes ( kSecRandomDefault, 1 , & randomByte)
11
+ if ( randomByte >= 250 ) {
12
+ continue
13
+ }
14
+ let randomDigit = randomByte % 10
15
+ result += String ( randomDigit)
16
+ }
17
+ return result
18
+ }
19
+ }
20
+
You can’t perform that action at this time.
0 commit comments