gN0Me
gN0Me

Reputation: 537

Encrypting data with a private key on iOS

I have found sample in "Certificate, Key, and Trust Services Programming Guide" about encrypting data with a public key. But how to encrypt with using private key and decrypt with using public key? I cannot find any samples about it. Thanks in advance

Upvotes: 2

Views: 2576

Answers (1)

Petey B
Petey B

Reputation: 11569

Why are you encrypting with the private key? When you encrypt with the private key, that is considered signing not encrypting, becuase it provides no confidentiality. If you want to "encrypt" with the private key, look into data signing, and that should allow you to "encrypt" (read "sign") with the private key and "decrypt" (read "verify signature") with the public key.

Upvotes: 5

Related Questions