public-key

Best practice for using ssh key pair with different groups?

一曲冷凌霜 提交于 2019-12-04 10:57:20
I'm doing some work with a company outside of my school, and they need my public ssh key. I already have my public ssh key generated for use with github. I set this up some time ago, and if I open the id_rsa.pub file, I see it has my school email address embedded inside. Now I'm wondering if it's typical to reuse this one key with every company you work with, or do you generate a new one for every company. I guess I have a few considerations: If I use the same public key with each company, and my private key were compromised, I'd need to give each company a new public key. My school email

Permission denied (publickey,gssapi-keyex,gssapi-with-mic) on openshift

若如初见. 提交于 2019-12-04 08:55:19
问题 I am having issues with committing changes to my gear. I have tried to run rhc setup, I also deleted my .ssh folder and executed rhc setup again but that also didnt work. Not sure what changed but it worked couple of hours ago. >git push -u <GEAR_NAME> master Permission denied (publickey,gssapi-keyex,gssapi-with-mic). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. >git remote add devstage3 -f ssh://<GEAR_ID>@<GEAR

Public key authentication issues on cygwin

三世轮回 提交于 2019-12-04 03:18:20
I've been trying "ssh localhost" on cygwin (I use WIndows 7), but it keeps asking for the password. When I did "ssh -vvv localhost", I found out that the public key authentications were not happening (or failing). Hence, it was asking for the password. debug1: Authentications that can continue: publickey,password,keyboard-interactive debug3: start over, passed a different list publickey,password,keyboard-interactive debug3: preferred publickey,keyboard-interactive,password debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is

Creating JSch HostKey instance from a public key in .pub format

倾然丶 夕夏残阳落幕 提交于 2019-12-04 02:21:56
问题 I am trying to send a file from a Windows machine to a Linux machine using JSch. Because of that I copied the host public key from the Linux machine to my Windows machine and added the key to my HostKeyRepository . But for some reason I get "invalid key type" exception. Here is my code: HostKeyRepository repo = jsch.getHostKeyRepository(); File file = new File("D:\\Uni\\Arbeit\\ssh_host_rsa_key.pub"); byte[] HK = Files.readAllBytes(file.toPath()); Session session=jsch.getSession(user, host,

Setup SFTP to use public-key authentication

无人久伴 提交于 2019-12-04 02:17:29
How do you setup server to server SFTP to use public-key authentication instead of user account and password? bhups In the client you need to generate its public key and add it to server's authorized key list. The following are the commands you can use. On client machine ssh-keygen -t dsa -f id_dsa mv id_dsa* ~/.ssh/ scp ~/.ssh/id_dsa.pub USER_NAME@SERVER:~/.ssh/HOST_NAME.key On the server cat ~/.ssh/HOST_NAME.key >> ~/.ssh/authorized_keys2 Remember to chmod 700 .ssh and also chmod 600 authorized_keys This is a solution for windows users I had a similar issue on windows so I used Putty from

Generate EC public key from byte array private key in native java (7+)

偶尔善良 提交于 2019-12-03 21:13:31
I'm trying to learn some crypto coding and have generated a 32-byte private key currently held in a byte array ( byte[] privatekey ). I know the public key is generated using the secp256k1 named elliptic curve parameters, and a formula where publickey = G * privatekey , where G is some point on the elliptic curve (ECPoint?), but I am unable to transfer that named parameter spec and formula into actual coding of a public key. I know that since java 7, there are classes included in the java.security.* and java.security.spec.* packages to do this in short code, but I can't find a good example

Convert RSA public key, from XML to PEM (PHP)

邮差的信 提交于 2019-12-03 21:12:15
How convert RSA public key, from XML to PEM (PHP)? we know .pem - (Privacy Enhanced Mail) Base64 encoded DER certificate, enclosed between "-----BEGIN CERTIFICATE-----" and "-----END CERTIFICATE-----" X.509 The SignatureValue element contains the Base64 encoded signature result - the signature generated with the parameters specified in the SignatureMethod element - of the SignedInfo element after applying the algorithm specified by the CanonicalizationMethod. XML_Signature so we end up with $xml = simplexml_load_file($xmlFile); // or simplexml_load_string $pem = "-----BEGIN CERTIFICATE-----\n"

Extract public key from certificate in DER format [closed]

佐手、 提交于 2019-12-03 16:52:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I have a .cer certificate file, and need to extract the Public Key. I can only extract to PEM format. The "outform" parameter does nothing . openssl x509 -inform PEM -in certificate.cer -outform DER -pubkey -noout > publickey.der Is it possible to extract in DER format? 回答1: Solved decoding the base64 PEM file:

Any tutorials on public key encryption in java? [closed]

允我心安 提交于 2019-12-03 15:37:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I've been able find information on symmetric encryption and hashing but I've been having quite a bit of trouble finding much information on any sort of public key encryption for java. What I'd like to do is make a very simple proof of concept program that takes a string ( or a file I suppose), encrypts it with a

Load public key data from file

孤者浪人 提交于 2019-12-03 13:04:20
问题 In my App I generate a public/private key pair and store them for later usage on disk. Loading and re-initialising the private key works fine but for the private key I get a Unknown KeySpec type: java.security.spec.PKCS8EncodedKeySpec - and I have no idea why. That's how I create and save the keys (code a bit simplified to be easier to read): KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); kpg.initialize(4096); KeyPair keyPair = kpg.generateKeyPair(); privKey =keyPair.getPrivate()