private-key

PrivateKey trust permissions for local machine “Trusted roots” certificates

二次信任 提交于 2019-11-28 11:21:39
I have a certificate that has to be imported into Certificates/Trusted Root Certification Authorities and has a corresponding private key. To actually access the key from code you need to set private key permissions to grant full access to particular IIS application pool. I totally understand that but the problem is that this can only be set on personal certificates and not trusted root ones. I've tried adding the same certificate to Personal store and the following code doesn't break: X509Store store = new X509Store(StoreName.Root, StoreLocation.LocalMachine); store.Open(OpenFlags.ReadOnly);

Can't get private key with openssl (no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY)

假装没事ソ 提交于 2019-11-28 10:44:14
I have a .key file, when I do openssl rsa -text -in file.key I get unable to load Private Key 140000419358368:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: ANY PRIVATE KEY Also I have a .cer file and when I do openssl x509 -text -in file.cer I get unable to load certificate 140387178489504:error:0906D06C:PEM routines:PEM_read_bio:no start line:pem_lib.c:703:Expecting: TRUSTED CERTIFICATE But if as pointed here I run the command like: openssl x509 -text -inform DER -in file.cer I get Certificate: Data: Version: 3 (0x2) Some more information ... -----BEGIN

Unable to sign a file with nodejs crypto

二次信任 提交于 2019-11-28 05:46:11
问题 I've created a private Key with nodejs crypto and want to sign a file with this key. My code is following: var ecdh = crypto.createECDH('brainpoolP512t1'); ecdh.generateKeys(); var key = ecdh.getPrivateKey('buffer'); var data= fs.readFileSync(req.file.path); var sign = crypto.createSign('sha512'); sign.update(data); var signature = sign.sign(key, 'hex'); But I get the error: Error: error:0906D06C:PEM routines:PEM_read_bio:no start line at Error (native) at Sign.sign (crypto.js:283:26) at /...

JSch to add private key from a string

廉价感情. 提交于 2019-11-28 04:48:18
问题 I have the contents of the key pair file for SFTP as a string. I need to use JSch to add the contents, but addIdentity only accepts a file path. Is there anyway I can do this? I see that the KeyPair class has a method - KeyPair load(JSch jsch, byte[] bytes, byte[] bytes1) I'm not sure what this does. 回答1: There is an addIdentity overload that takes the key from a buffer: public class JSch { ... public void addIdentity(String name, byte[]prvkey, byte[]pubkey, byte[] passphrase) See also Java

How can I use an existing private key to a new iOS development certificate?

∥☆過路亽.° 提交于 2019-11-28 03:24:09
For aesthetic reasons, I would like to use the same private key that I used to create my distribution certificate a while ago, to create a new development certificate (my old one expired). But the "How to create a development certificate:" on the iOS provisioning portal require that you use Keychain Access create a new key. When I try to do Keychain Access > Certificate Assistant > Request a Certificate From a Certificate Authority With "(my key name)" the Certificate Assistant doesn't actually create a CSR file. Does anyone know if this can be done, and if so, how? First, I had to export my

How to sign string with private key

本秂侑毒 提交于 2019-11-27 18:24:36
How can I get the signature of a string using SHA1withRSA if I already have the Private Key as byte[] or String ? Prabath Siriwardena I guess what you say is you know the key pair before hand and want to sign/verify with that. Please see the following code. import java.security.KeyPair; import java.security.KeyPairGenerator; import java.security.NoSuchAlgorithmException; import java.security.Signature; import sun.misc.BASE64Encoder; public class MainClass { public static void main(String[] args) throws Exception { KeyPair keyPair = getKeyPair(); byte[] data = "test".getBytes("UTF8"); Signature

Unable to load Private Key. (PEM routines:PEM_read_bio:no start line:pem_lib.c:648:Expecting: ANY PRIVATE KEY)

邮差的信 提交于 2019-11-27 18:16:41
I have a .key file which is PEM formatted private key file. I didn't make this file but I got this from somewhere. I wanted to see its MD5 hash with openssl tool like below command. openssl rsa -in server.key -modulus -noout But this generates below error. unable to load Private Key 13440:error:0906D06C:PEM routines:PEM_read_bio:no start line:.\crypto\pem\pem_lib.c:648:Expecting: ANY PRIVATE KEY Here's some asn1parse of the .key file. openssl asn1parse -in server.key 0:d=0 hl=4 l= 603 cons: SEQUENCE 4:d=1 hl=2 l= 1 prim: INTEGER :00 7:d=1 hl=3 l= 129 prim: INTEGER

How to import PKCS#8 RSA privateKey (created by OpenSSL) in C#

大兔子大兔子 提交于 2019-11-27 14:53:47
I'm trying to find a way to read a privateKey created using OpenSSL PKCS#8 RSA in C# without use external library. Does Someone know how i can do this? The easiest way to do this with an external library, is using the (free) Chillkat Public / Private Key Component : using that, importing the key can be done using just a few lines of code and if you're willing to pay the $149 or so for the rest of the library, it will make dealing with general crypto concepts a lot easier as well. And unlike the regular Microsoft .NET Framework, the Mono project does seem to have a PKCS8 implementation for

Is it possible to have encryption with multiple private keys (PHP)?

二次信任 提交于 2019-11-27 12:58:41
问题 Or: How to store encrypted data for a bunch of users? I admit, it's a silly question, a private key is limited to only one person as the term already implies. But I have the following scenario: User Tom enters data that needs to be stored encrypted in a database. The user decides he wants to make this information available to Jim and Bob. The users John and Jayne must not be able to decrypt it. Of course also not to user Tim who hacked the server and has access to the encrypted data and the

Converting Strings to encryption keys and vice versa java

99封情书 提交于 2019-11-27 11:42:20
I'm currently working on a way to convert keys into strings and vice versa. It works for the public key conversions, and converts a private key into a String. For some reason the same code won't convert a String back into a private key, which I just can't figure out. The converter code is: import java.security.KeyFactory; import java.security.PrivateKey; import java.security.PublicKey; import java.security.spec.X509EncodedKeySpec; import sun.misc.BASE64Decoder; import sun.misc.BASE64Encoder; @SuppressWarnings("restriction") public class KeyConvert { public static PublicKey stringToPublicKey