I am using JOSESwift. When I use the Encrypter method it returns nil
without details of any error. Below is my code sample. Can anyone please help why does the Encrypter method return nil
?
Intention : I am trying to set wrapping key to my JWE object and from JOSESwift i can understand that Encrypter takes in that cek key.
// Jose implementation.
let joseHeader = JWEHeader(algorithm: .direct,
encryptionAlgorithm: .A128CBCHS256)
let joseEncrypter = Encrypter(keyEncryptionAlgorithm: .RSAOAEP,
encryptionKey: cekKeyData,
contentEncyptionAlgorithm: .A128CBCHS256)!
let josePayload = Payload(Data(base64Encoded: jsonString)!)
let joseJWE = try? JWE(header: joseHeader, payload: josePayload, encrypter: joseEncrypter)