Update Framework (headers update)

This commit is contained in:
jeffcheasey88 2023-09-11 15:46:29 +02:00
parent 6824ced972
commit 6470bd8be7
2 changed files with 4 additions and 2 deletions

Binary file not shown.

View file

@ -56,7 +56,7 @@ public class MailConfirmation extends FormResponse {
this.playersWaiting = playersWaiting;
try {
generator = KeyPairGenerator.getInstance("RSA");
generator.initialize(4096); //a changer ?
generator.initialize(4096);
} catch (NoSuchAlgorithmException e){
e.printStackTrace();
}
@ -116,6 +116,8 @@ public class MailConfirmation extends FormResponse {
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{
KeyPair pair = generator.generateKeyPair(); //doit être unique ???
@ -130,7 +132,7 @@ public class MailConfirmation extends FormResponse {
byte[] exponent = pub.getPublicExponent().toByteArray();
byte[] modulus = pub.getModulus().toByteArray();
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[] modLength = ByteBuffer.allocate(4).putInt(modulus.length).array();
System.arraycopy(exLength, 0, key, 11, 4);