[FIX] Jwts token builder

This commit is contained in:
Gravita 2021-06-06 00:46:39 +07:00
parent 1b81d5956c
commit fcdaa36421

View file

@ -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();
}