2 ms·
> why can't I sign some data with public key without being on secure origin. I'm guessing you mean sign with a private key. In a secure context the Browser ge
by tialaramex 7y ago
> why can't I sign some data with public key without being on secure origin.
I'm guessing you mean sign with a private key.
In a secure context the Browser gets to promise the context that this private key stays private if it wants. For example, should the the private key be posted to Twitter?
In a secure context you get to decide, because only code your wrote runs in that context, if you don't add "post private key to Twitter" code then it doesn't happen.
But in insecure contexts any on-path attacker can substitute their own code for yours. Now your "private" key is in a Twitter post, hilarious.