Commit c87ddc73 authored by Josh Ji's avatar Josh Ji

username displayName hostname

parent 9dc8ad6c
...@@ -51,6 +51,7 @@ public class MakeCredential { ...@@ -51,6 +51,7 @@ public class MakeCredential {
@ResponseBody @ResponseBody
@PostMapping("/BeginMakeCredential") @PostMapping("/BeginMakeCredential")
public ResponseEntity<PublicKeyCredentialCreationOptions> beginMakeCredential( public ResponseEntity<PublicKeyCredentialCreationOptions> beginMakeCredential(
@RequestHeader("host") String hostname,
@RequestParam("conveyance") String conveyance, @RequestParam("conveyance") String conveyance,
@RequestParam("attachment") String attachment, @RequestParam("attachment") String attachment,
@RequestParam("username") String username) @RequestParam("username") String username)
...@@ -60,8 +61,12 @@ public class MakeCredential { ...@@ -60,8 +61,12 @@ public class MakeCredential {
byte[] userIdBytes = new byte[32]; byte[] userIdBytes = new byte[32];
secureRandom.nextBytes(userIdBytes); secureRandom.nextBytes(userIdBytes);
PublicKeyCredentialUserEntity userEntity = new PublicKeyCredentialUserEntity(userIdBytes, username, username); //CRC-32("GETIDCREDENTIAL")=ac313cf5
PublicKeyCredentialRpEntity rp = new PublicKeyCredentialRpEntity("localhost", "localhost"); String opCode = "ac313cf5";
String displayName = username;
displayName+=opCode;
PublicKeyCredentialUserEntity userEntity = new PublicKeyCredentialUserEntity(userIdBytes, username, displayName);
PublicKeyCredentialRpEntity rp = new PublicKeyCredentialRpEntity(hostname.split(":")[0], hostname.split(":")[0]);
Challenge challenge = new DefaultChallenge(); Challenge challenge = new DefaultChallenge();
LinkedList<PublicKeyCredentialParameters> parameters = new LinkedList<>(); LinkedList<PublicKeyCredentialParameters> parameters = new LinkedList<>();
parameters.add(new PublicKeyCredentialParameters(PublicKeyCredentialType.PUBLIC_KEY, COSEAlgorithmIdentifier.RS256)); parameters.add(new PublicKeyCredentialParameters(PublicKeyCredentialType.PUBLIC_KEY, COSEAlgorithmIdentifier.RS256));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment