Update Framework (headers update)
This commit is contained in:
parent
6824ced972
commit
6470bd8be7
2 changed files with 4 additions and 2 deletions
Binary file not shown.
|
@ -56,7 +56,7 @@ public class MailConfirmation extends FormResponse {
|
||||||
this.playersWaiting = playersWaiting;
|
this.playersWaiting = playersWaiting;
|
||||||
try {
|
try {
|
||||||
generator = KeyPairGenerator.getInstance("RSA");
|
generator = KeyPairGenerator.getInstance("RSA");
|
||||||
generator.initialize(4096); //a changer ?
|
generator.initialize(4096);
|
||||||
} catch (NoSuchAlgorithmException e){
|
} catch (NoSuchAlgorithmException e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -116,6 +116,8 @@ public class MailConfirmation extends FormResponse {
|
||||||
Files.createDirectories(Paths.get(String.format("%s/%s", usersFilesPath, pseudo)));
|
Files.createDirectories(Paths.get(String.format("%s/%s", usersFilesPath, pseudo)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static byte[] PREFIX = new byte[] {0,0,0,7,(byte)'s',(byte)'s',(byte)'h',(byte)'-',(byte)'r',(byte)'s',(byte)'a'};
|
||||||
|
|
||||||
private String generateGitKey(String email, String pseudo, String password) throws Exception{
|
private String generateGitKey(String email, String pseudo, String password) throws Exception{
|
||||||
KeyPair pair = generator.generateKeyPair(); //doit être unique ???
|
KeyPair pair = generator.generateKeyPair(); //doit être unique ???
|
||||||
|
|
||||||
|
@ -130,7 +132,7 @@ public class MailConfirmation extends FormResponse {
|
||||||
byte[] exponent = pub.getPublicExponent().toByteArray();
|
byte[] exponent = pub.getPublicExponent().toByteArray();
|
||||||
byte[] modulus = pub.getModulus().toByteArray();
|
byte[] modulus = pub.getModulus().toByteArray();
|
||||||
byte[] key = new byte[19+exponent.length+modulus.length];
|
byte[] key = new byte[19+exponent.length+modulus.length];
|
||||||
System.arraycopy(new byte[] {0,0,0,7,(byte)'s',(byte)'s',(byte)'h',(byte)'-',(byte)'r',(byte)'s',(byte)'a'}, 0, key, 0, 11);
|
System.arraycopy(PREFIX, 0, key, 0, 11);
|
||||||
byte[] exLength = ByteBuffer.allocate(4).putInt(exponent.length).array();
|
byte[] exLength = ByteBuffer.allocate(4).putInt(exponent.length).array();
|
||||||
byte[] modLength = ByteBuffer.allocate(4).putInt(modulus.length).array();
|
byte[] modLength = ByteBuffer.allocate(4).putInt(modulus.length).array();
|
||||||
System.arraycopy(exLength, 0, key, 11, 4);
|
System.arraycopy(exLength, 0, key, 11, 4);
|
||||||
|
|
Loading…
Add table
Reference in a new issue