Skip to content

Commit

Permalink
Merge pull request #5 from niscy-eudiw/bug/algos
Browse files Browse the repository at this point in the history
Assigning default signing algorithm from user selection
  • Loading branch information
dtsiflit authored Nov 29, 2024
2 parents 4809b1d + 461d9b8 commit c1fec43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/RqesKit/RQESServiceAuthorized.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@ public class RQESServiceAuthorized: RQESServiceAuthorizedProtocol, @unchecked Se
self.credentialInfo = credentialInfo
self.hashAlgorithmOID = hashAlgorithmOID ?? defaultHashAlgorithmOID
let certs = certificates?.map(\.base64String) ?? credentialInfo.cert.certificates

guard let algo = credentialInfo.key.algo.first else {
throw NSError(
domain: "Signing alogorithm error",
code: 0,
userInfo: [NSLocalizedDescriptionKey: "Failes to retrive list of supported signing algorithms"]
)
}
defaultSigningAlgorithmOID = SigningAlgorithmOID(rawValue: algo)

// STEP 9: calculate hashes
calculateHashResponse = try await RQESService.calculateHashes(rqes, documents: documents.map(\.fileURL), certificates: certs, accessToken: accessToken, hashAlgorithmOID: self.hashAlgorithmOID!)
// STEP 10: Set up an credential authorization request using OAuth2AuthorizeRequest with required parameters
Expand Down

0 comments on commit c1fec43

Please sign in to comment.