private key and public key
2011-12-19 13:32
441 查看
You can however sign with the private key and verify the signature with the public key.
While the math involve makes sense when the key roles are reversed (and this is how signatures work), encrypting for privacy doesn't make much sense when the decryption key is well know and public.
If you want to protect against generation of licences by someone else, you ought to be signing, not encrypting. Encryption prevents against reading of data by third parties, and signing prevents against writing of data by third parties. If you encrypt with your private key, you won't be protecting against reading of your data by third parties since there's no reason to believe that your intended public key recipients won't share (intentionally or otherwise) the key with anyone else.
bad key issue:
Ok, found what the issue is: needed to tell makecert 1) that's certificate's subject key type is for "Exchange" 2) to mark private key as exportable
so makecert call looks like
makecert.exe Test.cer -r -n "CN=Test Subject" -sr LocalMachine -ss My -sky Exchang
cert cannot be found:
don't use x64 command to make cert
return certificate.PublicKey.Key as RSACryptoServiceProvider;
return certificate.PrivateKey as RSACryptoServiceProvider;
While the math involve makes sense when the key roles are reversed (and this is how signatures work), encrypting for privacy doesn't make much sense when the decryption key is well know and public.
If you want to protect against generation of licences by someone else, you ought to be signing, not encrypting. Encryption prevents against reading of data by third parties, and signing prevents against writing of data by third parties. If you encrypt with your private key, you won't be protecting against reading of your data by third parties since there's no reason to believe that your intended public key recipients won't share (intentionally or otherwise) the key with anyone else.
bad key issue:
Ok, found what the issue is: needed to tell makecert 1) that's certificate's subject key type is for "Exchange" 2) to mark private key as exportable
so makecert call looks like
makecert.exe Test.cer -r -n "CN=Test Subject" -sr LocalMachine -ss My -sky Exchang
cert cannot be found:
don't use x64 command to make cert
return certificate.PublicKey.Key as RSACryptoServiceProvider;
return certificate.PrivateKey as RSACryptoServiceProvider;
相关文章推荐
- Summary: difference between public, default, protected, and private key words
- C# SharpSsh Private-public a pair key to Upload and Download File
- 如何让OpenSSL得到JKS格式的keystore中的public and private key
- 如何让OpenSSL得到JKS格式的keystore中的public and private key
- Public Key and Private Keys
- Create an SSH public and private key pair for Linux VMs (转载)
- The public key and the private key
- public、protected、private in c++ and java
- Public and Private Interfaces in ruby
- No valid signing identities (i.e. certificate and private key pair) matching
- [Python]private and public
- 生成ssh公有密钥并且注册到Github Generate ssh rsa keys and register public key on Github
- Public and Private Interfaces in ruby
- Converting RSA public key Modulus and Exponent into PEM file
- Jenkins && Pipeline Public/Private Key errors
- 生成ssh公有密钥而且注冊到Github Generate ssh rsa keys and register public key on Github
- iWatch报错: Fail to code sign "***" No valid signing identities (i.e. certificate and private key pair
- No valid signing identities (i.e. certificate and private key pair) matching the team ID “(null)” were found.
- [TS] Class Properties Public, Private and Read Only Modifiers
- OOP in JS Public/Private Variables and Methods