public-key

Github: readonly access to a private repo

三世轮回 提交于 2019-11-28 04:13:45
I am developing some private projects on Github, and I would like to add nightly cronjobs to my deployments servers to pull the latest version from github. I am currently doing this by generating keypairs on every deployment server and adding the public key to the github project as 'Deployment key'. However, I recently found out that these deployment keys actually do have write access to the project. Hence, every of the server administrators could potentially start editing. Furthermore I can add every deployment key to only one repository, whereas I would like to be able to deploy multiple

Permission denied (publickey,keyboard-interactive) [closed]

喜你入骨 提交于 2019-11-28 04:04:51
I tried to connect to planetlab node using ssh. It throws me error like Permission denied (publickey,keyboard-interactive). What does this mean? Here is the verbose of the exception. > OpenSSH_5.1p1 Debian-5ubuntu1, OpenSSL > 0.9.8g 19 Oct 2007 debug1: Reading configuration data /etc/ssh/ssh_config > debug1: Applying options for * debug2: > ssh_connect: needpriv 0 debug1: > Connecting to planetlab1.csee.usf.edu > [131.247.2.241] port 22. debug1: > Connection established. debug1: > permanently_set_uid: 0/0 debug3: Not a > RSA1 key file /home/keven/.ssh/id_rsa. > debug2: key_type_from_name:

configuring SSLContext using existing SSL key/certificate pair in java (JSSE API)

烈酒焚心 提交于 2019-11-28 02:20:59
问题 I am working on a java-project where I should implement the SSL-protokol on the server-side. Well, this is the first time I will use SSL in my application, so I read a lot about ssl/tls and now I want to implement something in java. I will implement this process using JSSE API: 1) client will connect to me 2) I will make authentification with my pubic key certificate. I means that I will send the client a public key and its corresponding certificate 3) the client encrypt the secret-key using

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

Android In App Billing: securing application public key

瘦欲@ 提交于 2019-11-27 17:17:00
From Android In App Billing version 3 (TrivialDrive)sample application coming with sdk MainActivity.java /* base64EncodedPublicKey should be YOUR APPLICATION'S PUBLIC KEY * (that you got from the Google Play developer console). This is not your * developer public key, it's the *app-specific* public key. * * Instead of just storing the entire literal string here embedded in the * program, construct the key at runtime from pieces or * use bit manipulation (for example, XOR with some other string) to hide * the actual key. The key itself is not secret information, but we don't * want to make it

Adding public key to ~/.ssh/authorized_keys does not log me in automatically

霸气de小男生 提交于 2019-11-27 16:33:33
I added the public ssh key to the authorized_keys file. ssh localhost should log me in without asking for the password. I did that and tried typing ssh localhost , but it still asks me to type in the password. Is there any other setting that I have to go through to make it work? I have followed instruction for changing permissions: Below is the result if I do ssh -v localhost debug1: Reading configuration data /home/john/.ssh/config debug1: Reading configuration data /etc/ssh/ssh_config debug1: Applying options for * debug1: Connecting to localhost [127.0.0.1] port 22. debug1: Connection

Verifying a signature with a public key

℡╲_俬逩灬. 提交于 2019-11-27 16:28:28
问题 I have an external service which call me back after some defined event, and sign his request with its private key. I have stored the public key which look like : -----BEGIN PUBLIC KEY----- ........................................ -----END PUBLIC KEY----- So my work is to check if request's content has not been alterned by verifying signature. Here is my algorithm : // 1 - reading public key : Scanner scanner = new Scanner( new File( keyPath ) ); // encodedPublicKey.toString( ); StringBuilder

Loading raw 64-byte long ECDSA public key in Java

为君一笑 提交于 2019-11-27 14:26:32
I have a raw (r,s) format ECDSA NIST P-256 public key. It seems that there is no simple way to load it into an object that implements java.security.interfaces.ECPublicKey. What is the cleanest way to load a 64 byte public key so that it can be used to check signatures? This answer is going to be tough if we do this using ECPublicKeySpec . So lets cheat a bit: private static byte[] P256_HEAD = Base64.getDecoder().decode("MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE"); public static ECPublicKey convertP256Key(byte[] w) throws InvalidKeySpecException { byte[] encodedKey = new byte[P256_HEAD.length + w

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

How can I get SecKeyRef from DER/PEM file

蹲街弑〆低调 提交于 2019-11-27 10:58:09
I need to integrate my iPhone app with a system, and they require to encrypt data by a given public key, there are 3 files in 3 different format .xml .der and .pem, I have researched and found some articles about getting SecKeyRef from DER/PEM, but they are always return nil. Below is my code: NSString *pkFilePath = [[NSBundle mainBundle] pathForResource:@"PKFile" ofType:@"der"]; NSData *pkData = [NSData dataWithContentsOfFile:pkFilePath]; SecCertificateRef cert; cert = SecCertificateCreateWithData(NULL, (CFDataRef) pkData); assert(cert != NULL); OSStatus err; if (cert != NULL) { err =