Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
RPServer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josh Ji
RPServer
Commits
c87ddc73
Commit
c87ddc73
authored
Jan 03, 2023
by
Josh Ji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
username displayName hostname
parent
9dc8ad6c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
src/main/java/com/example/rpserver/controller/MakeCredential.java
.../java/com/example/rpserver/controller/MakeCredential.java
+7
-2
No files found.
src/main/java/com/example/rpserver/controller/MakeCredential.java
View file @
c87ddc73
...
@@ -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
));
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment