mirror of
https://github.com/GravitLauncher/Launcher
synced 2024-11-15 11:39:11 +03:00
[FIX] Jwts token builder
This commit is contained in:
parent
1b81d5956c
commit
fcdaa36421
1 changed files with 4 additions and 4 deletions
|
@ -158,21 +158,21 @@ public void close() {
|
|||
|
||||
public String createHardwareToken(String username, HardwareReportRequest.HardwareInfo info) {
|
||||
return Jwts.builder()
|
||||
.setIssuer("LaunchSerer")
|
||||
.setIssuer("LaunchServer")
|
||||
.setSubject(username)
|
||||
.signWith(server.keyAgreementManager.ecdsaPrivateKey)
|
||||
.setExpiration(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 8))
|
||||
.claim("hardware", info)
|
||||
.signWith(server.keyAgreementManager.ecdsaPrivateKey)
|
||||
.compact();
|
||||
}
|
||||
|
||||
public String createPublicKeyToken(String username, byte[] publicKey) {
|
||||
return Jwts.builder()
|
||||
.setIssuer("LaunchSerer")
|
||||
.setIssuer("LaunchServer")
|
||||
.setSubject(username)
|
||||
.signWith(server.keyAgreementManager.ecdsaPrivateKey)
|
||||
.setExpiration(new Date(System.currentTimeMillis() + 1000 * 60 * 60 * 8))
|
||||
.claim("publicKey", Base64.getEncoder().encode(publicKey))
|
||||
.signWith(server.keyAgreementManager.ecdsaPrivateKey)
|
||||
.compact();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue