Hi.
I am following apple document (https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecTransformPG/EncryptionandDecryption/EncryptionandDecryption.html#//apple_ref/doc/uid/TP40010801-CH3-SW1) to implement the encrypt/decrypt with public/private key on macOS.
when I add below to set padding
The SecTransformExecute will fail as below.
I am following apple document (https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecTransformPG/EncryptionandDecryption/EncryptionandDecryption.html#//apple_ref/doc/uid/TP40010801-CH3-SW1) to implement the encrypt/decrypt with public/private key on macOS.
when I add below to set padding
Code Block SecTransformSetAttribute( encrypt, kSecPaddingKey, kSecPaddingPKCS7Key, &error); if (error) { CFShow(error); exit(-1); }
The SecTransformExecute will fail as below.
Please give some suggestion about this. Thanks.Error Domain=NSOSStatusErrorDomain Code=-2147415748 "The operation couldn’t be completed. (OSStatus error -2147415748 - CSSMERRCSPINVALIDATTRPADDING)" UserInfo=0x6080002750c0 {NSDescription=CSSMERRCSPINVALIDATTRPADDING}